Revision 938
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
Colonet.java | ||
---|---|---|
541 | 541 |
*/ |
542 | 542 |
public void setSelectedBot (int id) { |
543 | 543 |
this.selectedBot = id; |
544 |
lblSelected.setText("" + this.selectedBot); |
|
544 | 545 |
} |
545 | 546 |
|
546 | 547 |
/** |
... | ... | |
713 | 714 |
// Otherwise, we are selecting a bot, or doing nothing |
714 | 715 |
RobotIcon r = robotIcons.getBoundingIcon(pt); |
715 | 716 |
if (r != null) |
717 |
{ |
|
716 | 718 |
selectedBot = r.getID(); |
719 |
lblSelected.setText("" + selectedBot); |
|
720 |
} |
|
717 | 721 |
} |
718 | 722 |
} |
719 | 723 |
|
... | ... | |
811 | 815 |
} else if (source == btnActivate) { |
812 | 816 |
vectorController.setZero(); |
813 | 817 |
vectorController.sendToServer(); |
814 |
robotIcons.get(selectedBot).clearDestination(); |
|
818 |
if (selectedBot >= 0) |
|
819 |
{ |
|
820 |
robotIcons.get(selectedBot).clearDestination(); |
|
821 |
} |
|
815 | 822 |
} else if (source == btnSetBounds) { |
816 | 823 |
boundary.set = true; |
817 | 824 |
panelWebcam.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR)); |
... | ... | |
896 | 903 |
// Robot Position Request |
897 | 904 |
if (count % 1 == 0) { |
898 | 905 |
csi.sendPositionRequest(); |
899 |
csi.sendImageRequest(); |
|
900 | 906 |
} |
901 | 907 |
// Battery Request |
902 | 908 |
if (count % 30 == 0) { |
... | ... | |
1129 | 1135 |
image.flush(); |
1130 | 1136 |
System.gc(); |
1131 | 1137 |
try { |
1132 |
imagePath = new URL(ColonetConstants.WEBCAM_PATH + "?rand=" + rand.nextInt(100000));
|
|
1138 |
imagePath = new URL(ColonetConstants.WEBCAM_PATH); |
|
1133 | 1139 |
} catch (MalformedURLException e) { |
1134 | 1140 |
System.out.println("Malformed URL: could not form URL from: [" + ColonetConstants.WEBCAM_PATH + "]\n"); |
1135 | 1141 |
} |
... | ... | |
1148 | 1154 |
csi.warn("Could not load webcam.\n" + e); |
1149 | 1155 |
return; |
1150 | 1156 |
} catch (IOException e) { |
1151 |
getInfoPanel().append("IOException while trying to load image."); |
|
1157 |
getInfoPanel().append("IOException while trying to load image.\n");
|
|
1152 | 1158 |
} |
1153 | 1159 |
} |
1154 | 1160 |
} |
Also available in: Unified diff