The XRP robot kit is an easy-to-use programmable robot for STEAM education. It has 2 wheels driven by encoded DC motors. The standard kit also includes a servo motor, distance sensor, and a line sensor, all of which this library can control.
The units for blocks that control the wheels are:
For each block, there is a short description entry and a detailed block and component description. You can click on block pictures in the short description table to access the details.
Drive straight for the specified distance (mm) at the specified speed (mm/second). Specify a negative distance to go backwards. Note: the speed cannot be zero, because the move would take forever.
Drive at the specified speed (mm/second) for a specified duration (milliseconds). The speed can be different for the left and right wheels, so you can travel in an arc.
Change the heading by the specified amount (degrees), moving the wheels at the specified speed (mm/sec). The robot turns about a point halfway between the wheels.
Stop both wheels.
Wait for both wheels to stop. This uses the predicted end time of the current move, rather than actually waiting for the wheels to stop, so it may exit early.
Set the specified servo motor to the specified angle (deg). The standard XRP kit includes one servo motor, but the board can drive 2.
Read roll rate (degrees/second). Positive roll tilts the left edge up.
Read pitch rate (degrees/second). Positive pitch tilts the nose up.
Read yaw rate (degrees/second). Positive yaw changes the heading to the right.
Read the distance sensor (cm).
Read the left and right line sensors.
Get the number of encoded DC motors.
The XRP robot kit can drive up to 4 encoded DC motors, but by default the XRP library only supports the first two (in order to speed up the feedback loop).
In order to control more motors, edit to return 3 or 4. Then use the Encoded DC Motors library to control the additional motors, using index 3 or 4. Note that the units are are different in the Encoded DC Motors library (encoder counts instead of mm).
Some useful XRP facts from the manufacturer's documentation:
Many thanks to Steve Spaeth, who wrote a preliminary version of this library.