
This is the most recent schematic for the Midnight Prowlerbot. I decided that it was best to simply control the CMUCam2+ using the Java GUI available from http://www.cs.cmu.edu/~cmucam2/downloads.html. Besides, it is interesting to be able to access video from the camera and actually see it - in some cases it has helped identify lighting issues that could never have been observed any other way. Incidentally, proper lighting is absolutely crucial for getting good results with the CMUCam 2+.
Instead of directly controlling the robot through bluetooth as was once done, now the robot is controlled indirectly through bluetooth to the CMUCam 2+ and eventually to the ABB. By sending servo settings for servo 2 on the CMUCam2+, it is possible to instruct the ABB. The ABB just polls the servo 2 output from the CMUCam 2+ for instruction. Of course the robot can also be controlled directly by wireless PS2 controller. However, the intent of controlling the robot through the servo 2 output is to allow the CMUCam 2+ GUI to make decisions for the robot based upon video processing feedback.
At first, an attempt to port the Java GUI to VB.Net was tried and failed. It didn't fail miserably, and it actually worked somewhat, but the serial port event handling in VB.Net seemed quirky and unreliable so I gave up on it. In some cases, an event would trigger when only a single character was in the buffer while in other cases an event would trigger only one time when there were multiple messages received. Apparently, carriage return (chr 13) does not necessarily indicate the end of a message even if every attempt is made to assure that it should.
I wanted the program to be in VB.Net simply because the GUI editing in VB.Net is far easier than it is in Java. After one too many frustrations with serial port control and VB.Net, I gave up and just started editing the Java program instead. However, trying to add any GUI object to an existing Java program can be a crapshoot if your Java is as rusty as mine. So, I decided to simplify the existing Java GUI for my benefit by converting it to a Netbeans (http://www.netbeans.org/) based program.
As I understand the Java community, and I'm no Java pro but more of a Java hack, Netbeans is loved or hated with no in between. Netbeans is a GUI answer for the difficult to use GUI functions of Java. Although there are GUI assistants available for other IDE's, such as Eclipse, I've come to prefer the GUI development in Netbeans. It may have something to do with the fact that I used to use Netbeans long ago when it was the only IDE with GUI support.
Unfortunately, to use the GUI assistant in Netbeans I had to first redo the CMUCam GUI program using the Netbeans GUI assistant - I couldn't just convert the existing program to use the GUI assistant. This went fairly smoothly, but the more that I used Netbeans the more it annoyed me because it seems to snag and just stop every so often, even with the autosave turned off.
I eventually got the CMUCam GUI converted to Netbeans anyway and found it very easy to add robot control to the GUI for sending the robot in a compass direction, and added functions for controlling the robot just as I was able to with the first generation control program that I wrote. I even added the ability to load an area layout, place the robot in a room of the layout, place the robot goal, and have the robot automatically navigate to the goal. Screenshots of the modified Java GUI and program explanations will be posted later.
Instead of directly controlling the robot through bluetooth as was once done, now the robot is controlled indirectly through bluetooth to the CMUCam 2+ and eventually to the ABB. By sending servo settings for servo 2 on the CMUCam2+, it is possible to instruct the ABB. The ABB just polls the servo 2 output from the CMUCam 2+ for instruction. Of course the robot can also be controlled directly by wireless PS2 controller. However, the intent of controlling the robot through the servo 2 output is to allow the CMUCam 2+ GUI to make decisions for the robot based upon video processing feedback.
At first, an attempt to port the Java GUI to VB.Net was tried and failed. It didn't fail miserably, and it actually worked somewhat, but the serial port event handling in VB.Net seemed quirky and unreliable so I gave up on it. In some cases, an event would trigger when only a single character was in the buffer while in other cases an event would trigger only one time when there were multiple messages received. Apparently, carriage return (chr 13) does not necessarily indicate the end of a message even if every attempt is made to assure that it should.
I wanted the program to be in VB.Net simply because the GUI editing in VB.Net is far easier than it is in Java. After one too many frustrations with serial port control and VB.Net, I gave up and just started editing the Java program instead. However, trying to add any GUI object to an existing Java program can be a crapshoot if your Java is as rusty as mine. So, I decided to simplify the existing Java GUI for my benefit by converting it to a Netbeans (http://www.netbeans.org/) based program.
As I understand the Java community, and I'm no Java pro but more of a Java hack, Netbeans is loved or hated with no in between. Netbeans is a GUI answer for the difficult to use GUI functions of Java. Although there are GUI assistants available for other IDE's, such as Eclipse, I've come to prefer the GUI development in Netbeans. It may have something to do with the fact that I used to use Netbeans long ago when it was the only IDE with GUI support.
Unfortunately, to use the GUI assistant in Netbeans I had to first redo the CMUCam GUI program using the Netbeans GUI assistant - I couldn't just convert the existing program to use the GUI assistant. This went fairly smoothly, but the more that I used Netbeans the more it annoyed me because it seems to snag and just stop every so often, even with the autosave turned off.
I eventually got the CMUCam GUI converted to Netbeans anyway and found it very easy to add robot control to the GUI for sending the robot in a compass direction, and added functions for controlling the robot just as I was able to with the first generation control program that I wrote. I even added the ability to load an area layout, place the robot in a room of the layout, place the robot goal, and have the robot automatically navigate to the goal. Screenshots of the modified Java GUI and program explanations will be posted later.
No comments:
Post a Comment