Drive
Every robot needs a drive class. What does this mean? A drive class basically mediates between the Navigation System and the commands that are sent to the robot. This is the structure:
Every drive must implement the move() method. From the navigation system it receives:
- RobotPort port - The port via which commands are to be sent
- DirectedPoint location - The location of the corresponding robot
- VectorGeometry force - This is the tricky bit. This is the vector in which direction the robot should be moving at this very moment.
- double rotation - How much off is the robot facing from the point it is supposed to be facing
- double factor - An orientation number. By how much to scale down the speed of the robot (basically, tells you whether or not to move at full speed)
In the FourWheelHolonomicDrive you can see an implementation of such a method. It sends the commands to a FourWheelHolonomicPort port (a robot that is actually has the required wheels)