Revision 466
fixed vision bug
Command.cpp | ||
---|---|---|
282 | 282 |
} |
283 | 283 |
|
284 | 284 |
int Command::parse_request_robot_positions(int pool_index) { |
285 |
printf("parse_request_robot_positions\n"); |
|
285 |
printf("*****parse_request_robot_positions\n");
|
|
286 | 286 |
|
287 | 287 |
map<int, VisionPosition> positions = colonet_server->getPositionMonitor()->getAllRobotPositions(); |
288 | 288 |
map<int, VisionPosition>::iterator iter; |
289 | 289 |
|
290 |
char position_buffer[256] = ""; |
|
290 |
char position_buffer[256]; |
|
291 |
position_buffer[0] = 0; |
|
292 |
sprintf(position_buffer, "%d %d", RESPONSE_TO_CLIENT_REQUEST, CLIENT_REQUEST_ROBOT_POSITIONS); |
|
293 |
|
|
291 | 294 |
for (iter = positions.begin(); iter != positions.end(); iter++) { |
292 | 295 |
char tmpbuf[80]; |
293 |
sprintf(tmpbuf, "%d %d %d ", iter->first, iter->second.x, iter->second.y);
|
|
296 |
sprintf(tmpbuf, " %d %d %d", iter->first, iter->second.x, iter->second.y);
|
|
294 | 297 |
strcat(position_buffer, tmpbuf); |
295 | 298 |
} |
296 | 299 |
|
300 |
strcat(position_buffer, "\n"); |
|
301 |
|
|
302 |
printf("position buffer is: %s\n", position_buffer); |
|
303 |
|
|
297 | 304 |
connection_pool->write_to_client(pool_index, position_buffer, strlen(position_buffer)); |
298 | 305 |
|
299 | 306 |
return 0; |
Also available in: Unified diff