Revision 1010
Motion works, but needs fine tuning.
robot.c | ||
---|---|---|
23 | 23 |
#include <pthread.h> |
24 | 24 |
|
25 | 25 |
#include "robot.h" |
26 |
#include "motion.h" |
|
26 | 27 |
#include "gtk_gui.h" |
27 | 28 |
|
28 | 29 |
void sig_chld_handler(int sig); |
30 |
void robot_update(int i); |
|
29 | 31 |
|
30 | 32 |
// global variables |
31 | 33 |
int first_available_id = 0; |
... | ... | |
236 | 238 |
finished = 0; |
237 | 239 |
pthread_mutex_unlock(&all_finished_mutex); |
238 | 240 |
for (i = 0; i < robots_size; i++) |
241 |
if (robots[i].id != -1) |
|
242 |
robot_update(i); |
|
243 |
for (i = 0; i < robots_size; i++) |
|
239 | 244 |
{ |
240 | 245 |
if (robots[i].id == -1) |
241 | 246 |
continue; |
... | ... | |
246 | 251 |
} |
247 | 252 |
} |
248 | 253 |
|
254 |
void robot_update(int i) |
|
255 |
{ |
|
256 |
Robot* r = &(robots[i]); |
|
257 |
if (r->id == -1) |
|
258 |
return; |
|
259 |
move_robot(r); |
|
260 |
} |
|
261 |
|
Also available in: Unified diff