I didn’t have the time to work on this project for the last few weeks. I just tested the code on my machine on windows (a few weeks back) and now on linux. It seems to work fine but the usual disclaimer applies (no warranty, use at your own risk, etc.).
gridvision.ch/robot.zip
The file contains the compiled version (robot.jar) and the sources in the src directory. A shell script (start.sh) to start the tool on linux is included.
Following software is required to build/run:
Java6 JDK from java.sun.com/javase/downloads/index.jsp
Java3D from java3d.dev.java.net/
Serial API from rxtx.org/
A Java IDE from jetbrains.com/ or eclipse.org/ or netbeans.org/
The sourcecode is completely undocumented and pretty messy. Feel free to contact me (ICQ: 77313116) if you have any questions/ideas.
I recommend to check the “Run” checkbox as soon as you successfully started the tool and then start to experiment with the controls on the user interface.
You can use the mouse to control the 3D view. Left button & drag = rotate, middle button & drag = zoom, right button & drag = translate. shift & left button set the red target cylinder used in waypoint mode.
The first steering cross is used to control the body offset. The second controls the body pitch/yaw.
You can drag the mouse on the third steering cross to control the walking direction of the hexapod. The red dot on this steering cross controls the walking radius of the hexapod. Dragging the red dot to the right makes the hexapod walk foreward.
Dragging the red dot to the middle makes the rotation radius smaller. The hexapod will eventually rotate on place when the red dot is in the middle of the cross.
The fourth steering cross is almost the same, just with the reverse walking direction.
It uses some time to get used to this type of control, but you can also enable the “Walk to Way Point” checkbox and set the target point for a simpler way to control the hexapod.
The class with the main method is:
ch.gridvision.robot.RobotControlGUI
The serial communication API is disabled in the sourcecode, you have to replace the line:
robotController = new NullRobotController();
with the line:
robotController = new ServoRobotController();
to reenable the serial API in the class RobotControlGUI. You also have to check that the correct port and parameters are used in the class ServoRobotController.
Martin