Revision 1219
Added reset_encoders command
Fixed bugs
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 |
- |
53 |
usb_puts ("# Resetting encoders"); |
|
53 | 54 |
encoders_reset (); |
55 |
robot_reset_encoders (); |
|
54 | 56 |
|
55 | 57 |
for (uint8_t m=0; m<num_measurements; ++m) |
56 | 58 |
{ |
... | ... | |
67 | 68 |
// TODO instead of waiting a fixed time, wait until the wheels |
68 | 69 |
// are not moving any more, using the station's encoders. |
69 | 70 |
|
71 |
// Read the station encoders |
|
70 | 72 |
encoders_read (&(data_station_l[m]), &(data_station_r[m])); |
71 |
//TODO robot_read_encoders () |
|
72 |
data_robot_l[m]=23;
|
|
73 |
data_robot_r[m]=42;
|
|
73 |
|
|
74 |
// Read the robot encoders
|
|
75 |
robot_read_encoders (&(data_robot_l[m]), &(data_robot_r[m]));
|
|
74 | 76 |
} |
75 | 77 |
|
76 | 78 |
send_encoder_data (0, direction1, data_station_l, data_robot_l); |
Also available in: Unified diff