Project

General

Profile

Revision 665

Added by Greg Tress about 16 years ago

Added more boundary code. Need to test.

View differences:

ColonetServerInterface.java
60 60
	public static final String GLOBAL_DEST = "200";
61 61
	public static final String CLIENT_REQUEST_ROBOT_POSITIONS = "86";
62 62
	public static final String CLIENT_ASSIGN_ROBOT_ID = "87";
63
  public static final String CLIENT_SET_VIRTUAL_WALL = "89";
63 64
	public static final String MOVE_TO_ABSOLUTE_POSITION = "83"; //0x53
65
  
64 66

  
65 67
	//Queue instructions
66 68
	public static final String COLONET_QUEUE = "100";
......
359 361
	}
360 362

  
361 363
	/**
362
	* Order a robot to move to an absolute coordinate point.
363
	*/
364
    * Order a robot to move to an absolute coordinate point.
365
    */
364 366
	public void sendAbsoluteMove (int id, int x, int y) {
365 367
      int x_high = (x>>8) & 0xff;
366 368
      int x_low = x & 0xff;
......
369 371

  
370 372
			sendData(MOVE_TO_ABSOLUTE_POSITION + " " + x_high + " " + x_low + " " + y_high + " " + y_low, "" + id);
371 373
	}
374
  
375
  /**
376
   * Establish a boundary for robot motion.
377
   */
378
  public void sendBoundary (int x1, int y1, int x2, int y2) {
379
    String packet = "";
380
		packet += ColonetServerInterface.REQUEST_FROM_SERVER;
381
		packet += " " + CLIENT_SET_VIRTUAL_WALL;
382
    packet += " " + x1 + " " + y1 + " " + x2 + " " + y2;
383
    packet += "\n";
384
    sendString(packet);
385
  }
372 386

  
373 387
	/*
374 388
	* Queue management

Also available in: Unified diff