The robot can be driven by (independently) setting the speed of the left or right wheel. Because this is not very intuitive, the wheels component provides a higher level interface for the higher layers.
The most important feature of this module is to translate a circle radius into wheel speeds. Using the distance between the wheels and the circle radius, the relative speed difference between the inner wheel and the outer wheel (in the turn) can be calculated.
Another feature which is not provided by the simulation interface is the ability to halt the robot. Because the robot does not have brakes, the brake command sets the wheel speeds to near zero. Setting the speed to zero does not stop the wheels but just cuts power, resulting in unintended movement.
The wheels component accepts the following commands:
- BRAKE: Stop the robot.
- SETSPEED: Manually set the speed of the wheels. Parameters are a dictionary with keys left and right to indicate the left and right wheel speed.
- DIRECTION: Set the speed, direction, and rotation radius of the vehicle. Parameters are a dictionary with keys speed, direction (left: -1, right: 1, straight: 0), radius (turn radius).