Revision 1226
Robot/Station communication:
- Implemented timeouts
- Implemented command acknowledgement
test_encoders.c | ||
---|---|---|
50 | 50 |
int16_t *data_robot_l =malloc (num_measurements*sizeof (uint16_t)); |
51 | 51 |
int16_t *data_robot_r =malloc (num_measurements*sizeof (uint16_t)); |
52 | 52 |
- usb_puts ("# Resetting encoders"); |
53 |
usb_puts ("# Resetting encoders" NL); |
|
53 | 54 |
encoders_reset (); |
54 | 55 |
robot_reset_encoders (); |
55 | 56 |
|
... | ... | |
58 | 58 |
{ |
59 | 59 |
robot_set_motors (direction1, velocity, direction2, velocity); |
60 | 60 |
delay_ms (on_delay); |
61 |
|
|
62 | 61 |
robot_set_motors_off (); |
63 | 62 |
delay_ms (off_delay); |
64 | 63 |
|
65 |
// TODO use the robot_set_motors_time function, but wait for completion |
|
66 |
// message from robot |
|
67 |
|
|
68 |
// TODO instead of waiting a fixed time, wait until the wheels |
|
69 |
// are not moving any more, using the station's encoders. |
|
70 |
|
|
71 | 64 |
// Read the station encoders |
72 | 65 |
encoders_read (&(data_station_l[m]), &(data_station_r[m])); |
73 | 66 |
|
Also available in: Unified diff