Project

General

Profile

Revision 938

Added by Ryan Cahoon over 15 years ago

OpenCV now works directly with firewire, coriander is not needed
New vision algorithm integrated, a few issues left with algorithm that
tracks the movement of a specific robot
Removed experimental interface to send images over commands socket
--plan to use php in webserver instead
Separated processing of client requests into a separate thread
Fixed bugs updating UI of java client

View differences:

Command.cpp
278 278
      return -1;
279 279
    }
280 280
    break;
281
    
282
  case CLIENT_REQUEST_IMAGE:
283
    if (parse_request_image(pool_index)) {
284
      return -1;
285
    }
286
    break;
287 281

  
288 282
  case CLIENT_REQUEST_ROBOT_POSITIONS:
289 283
    if (parse_request_robot_positions(pool_index)) {
......
372 366
}
373 367

  
374 368
/**
375
 * @brief This function parses a client's request for an image from the over head camera
376
 * 
377
 * @param pool_index The index in the connection pool of the client that sent this command
378
 *
379
 * @return 0 on success, negative error code on failure
380
 */
381
int Command::parse_request_image(int pool_index) {
382
  //printf("*****parse_request_image\n");
383
  
384
  unsigned char buffer[150000];
385
  int length;
386
  
387
  //get the latest image data from the vision module
388
  length = getImageBytes(buffer, 150000);
389
  
390
  if (length > 0)
391
    connection_pool->write_to_client(pool_index, (char *)buffer, length);
392
  else
393
    return -1;
394
  
395
  return 0;
396
}
397

  
398
/**
399 369
 * @brief This functions parses a client's request for the positions of robots
400 370
 * 
401 371
 * @param pool_index The index in the connection pool of the client that sent this command

Also available in: Unified diff