Differences

This shows you the differences between two versions of the page.

Link to this comparison view

rasb:lab:03 [2026/06/26 15:32]
rares.sarmasag
rasb:lab:03 [2026/06/30 14:48] (current)
rares.sarmasag [Lab 3: NXP Cup Autonomous Car]
Line 1: Line 1:
 ====== Lab 3: NXP Cup Autonomous Car ====== ====== Lab 3: NXP Cup Autonomous Car ======
 +{{:​rasb:​lab:​nxpcar-lab.zip|Lab 3 skel}}
 ===== Duration ===== ===== Duration =====
  
Line 83: Line 83:
   * **''​exercise2_pixy_vector/''​** — Coordinate mapping and error estimation.   * **''​exercise2_pixy_vector/''​** — Coordinate mapping and error estimation.
     * ''​pixy_vector.c''​ / ''​.h'':​ Student implementation file and interface.     * ''​pixy_vector.c''​ / ''​.h'':​ Student implementation file and interface.
-    * ''​test_pixy_vector.c'': ​The local unit test suite.+    * ''​test_pixy_vector.o'': ​Precompiled ​local unit test suite object.
   * **''​exercise3_steering/''​** — Steering actuator command conversion.   * **''​exercise3_steering/''​** — Steering actuator command conversion.
     * ''​steering.c''​ / ''​.h'':​ Student implementation file and interface.     * ''​steering.c''​ / ''​.h'':​ Student implementation file and interface.
-    * ''​test_steering.c'': ​The local unit test suite. +    * ''​test_steering.o'': ​Precompiled ​local unit test suite object. 
-  * **''​Makefile''​** — Compiles and executes both test suites ​(via ''​make test''​).+  * **''​test_runner''​** — Precompiled interactive test runner TUI dashboard executable
 +  * **''​Makefile''​** — Compiles and links student implementations with precompiled ​test objects ​(via ''​make test''​).
  
 Students do not need to modify the full vehicle firmware. You will implement and validate the core modules locally, write your PID gains in the configuration file, and flash the precompiled vehicle firmware. Students do not need to modify the full vehicle firmware. You will implement and validate the core modules locally, write your PID gains in the configuration file, and flash the precompiled vehicle firmware.
Line 176: Line 177:
 Clamp the selected $x$ coordinate to the valid image boundaries $[0, \text{frame\_width} - 1]$ before normalization. Clamp the selected $x$ coordinate to the valid image boundaries $[0, \text{frame\_width} - 1]$ before normalization.
  
-Recommended normalization ​formula+Students should derive a linear scaling ​formula ​to map the clamped $x$ coordinate from the pixel space $[0, \text{frame\_width} - 1]$ to the normalized target space $[-1.0, 1.0]$. 
-<​code ​text+
-center = (frame_width ​- 1) / 2.0 +
-error = (x - center) / center +
-</​code>​+
  
 ==== Examples for frame_width = 79 ==== ==== Examples for frame_width = 79 ====
Line 223: Line 221:
   2. Map this clamped value linearly to a standard servo PWM pulse width in the range ''​[1000,​ 2000]''​ microseconds,​ where ''​1500''​ microseconds represents the center position (wheels straight).   2. Map this clamped value linearly to a standard servo PWM pulse width in the range ''​[1000,​ 2000]''​ microseconds,​ where ''​1500''​ microseconds represents the center position (wheels straight).
  
-Recommended ​conversion formula: +Students should derive a linear ​conversion formula ​that maps the clamped PID steering command from $[-1.0, 1.0]$ to the physical servo PWM pulse width range $[1000, 2000]$ microseconds. 
-<code text> +
-servo_us = 1500 + pid_output * 500 +
-</​code>​+
  
 ==== Examples ==== ==== Examples ====
Line 260: Line 256:
   * Written answers to the theoretical questions in Exercise 1;   * Written answers to the theoretical questions in Exercise 1;
   * Your C implementations for ''​exercise2_pixy_vector/​pixy_vector.c''​ and ''​exercise3_steering/​steering.c'';​   * Your C implementations for ''​exercise2_pixy_vector/​pixy_vector.c''​ and ''​exercise3_steering/​steering.c'';​
-  * Terminal output logs or screenshots showing that both local test suites pass successfully. 
  
 ===== Grading Criteria ===== ===== Grading Criteria =====
rasb/lab/03.1782477137.txt.gz · Last modified: 2026/06/26 15:32 by rares.sarmasag
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0