Project

General

Profile

Revision 146

Added by Jason knichel over 16 years ago

made the server output an arbitrary sensor matrix instead of a random one

View differences:

trunk/code/projects/colonet/ColonetServer/Command.cpp
228 228
  }
229 229

  
230 230
  //TODO: change after we start keeping track of bom matrix
231
  /*
231 232
  int number_robots = rand()%10;
232 233
  int bom_matrix[number_robots][number_robots];
233 234
  for (int ii = 0; ii < number_robots; ii++) {
......
237 238
      bom_matrix[ii][j] = matrix_value;
238 239
    }
239 240
  }
241
  */
242
  int number_robots = 3;
243
  int bom_matrix[number_robots][number_robots];
244
  for (int ii = 0; ii < number_robots; ii++) {
245
    for (int j = 0; j < number_robots; j++) {
246
      bom_matrix[ii][j] = ((ii*3+j)%17)-1;
247
    }
248
  }
249
  
240 250

  
241 251
  printf("number of robots is %d\n", number_robots);
242 252

  
......
262 272

  
263 273
int Command::parse_request_xbee_ids(int pool_index) {
264 274
  //TODO: make this better
265
  int number_robots = rand() % 10;
275
  //TODO: change when we actually know this data
276
  //int number_robots = rand() % 10;
277
  int number_robots = 3;
266 278

  
267 279
  char xbee_id_buffer[MAX_RESPONSE_LEN];
268 280
  char temp_xbee_id_buffer[MAX_RESPONSE_LEN];

Also available in: Unified diff