Revision 765
More sophisticated hack; bot 4 is default
trunk/code/projects/colonet/server/Command.cpp | ||
---|---|---|
184 | 184 |
int cmd = atoi(tokens[3]); |
185 | 185 |
int bot = atoi(tokens[1]); |
186 | 186 |
if (cmd == 96) { |
187 |
|
|
188 | 187 |
wl_send_robot_to_robot_global_packet(3, 9, NULL, 0, bot, 0); |
189 | 188 |
printf("Sent recharge request to %d\n", bot); |
189 |
return 0; |
|
190 | 190 |
} |
191 |
if (cmd == 97) { |
|
192 |
wl_send_robot_to_robot_global_packet(3, 10, NULL, 0, bot, 0); |
|
193 |
printf("Sent recharge stop request to %d\n", bot); |
|
194 |
return 0; |
|
195 |
} |
|
191 | 196 |
/* END OF HACK */ |
192 | 197 |
|
193 | 198 |
memset(arguments, 1, PACKET_DATA_LEN); |
trunk/code/projects/colonet/client/Colonet.java | ||
---|---|---|
837 | 837 |
} else if (source == btnCommand_ResumeTask) { |
838 | 838 |
|
839 | 839 |
} else if (source == btnCommand_ChargeNow) { |
840 |
|
|
840 |
if (selectedBot >= 0) |
|
841 |
csi.sendRecharge(selectedBot); |
|
842 |
else |
|
843 |
csi.sendRecharge(4); |
|
841 | 844 |
} else if (source == btnCommand_StopCharging) { |
842 |
|
|
845 |
if (selectedBot >= 0) |
|
846 |
csi.sendRechargeStop(selectedBot); |
|
847 |
else |
|
848 |
csi.sendRechargeStop(4); |
|
843 | 849 |
} else if (source == btnAddTask) { // Queue Management |
844 | 850 |
taskAddWindow.prompt(); |
845 | 851 |
} else if (source == btnRemoveTask) { |
trunk/code/projects/colonet/client/ColonetServerInterface.java | ||
---|---|---|
66 | 66 |
public static final String REQUEST_BOM_MATRIX = "144"; |
67 | 67 |
public static final String REQUEST_XBEE_IDS = "145"; |
68 | 68 |
public static final String RECHARGE = "96"; //0x60 |
69 |
public static final String RECHARGE_STOP = "97"; //0x61 |
|
69 | 70 |
|
70 | 71 |
//Queue instructions |
71 | 72 |
public static final String COLONET_QUEUE = "100"; |
... | ... | |
383 | 384 |
System.out.println("Sent recharge command to ID " + id); |
384 | 385 |
} |
385 | 386 |
|
387 |
/** |
|
388 |
* Tell a robot to stop recharing now |
|
389 |
*/ |
|
390 |
public void sendRechargeStop (int id) { |
|
391 |
sendData(RECHARGE_STOP + "", id + ""); |
|
392 |
System.out.println("Sent recharge stop command to ID " + id); |
|
393 |
} |
|
394 |
|
|
386 | 395 |
/** |
387 | 396 |
* Establish a boundary for robot motion. |
388 | 397 |
*/ |
Also available in: Unified diff