ways, but RobotBASIC offers rCommands that provide
solutions for specific problems such as this one.
Each rCommand has two parameters — the first of
which specifies a function or action to be taken. In this
case, the action is to drive the robot in one of four arcing
motions (forward-right, forward-left, reverse-right, or
reverse-left). The second parameter in the command is an
eight-bit byte that further defines the requested
movement. Since we only have eight bits at our disposal,
the data for this rCommand has to be encoded to allow
it to fit.
The first two bits in the byte specify which of the
above actions to take. The remaining six bits specify the
severity of the arc with the value indicating the speed of
the slower wheel as a percentage of the speed of the
faster wheel. With only six bits, we cannot pass the
percentage of 0-99, so the command assumes the value
passed is half of the desired amount. This limits the
resolution to 2%, but that is still a very small variation in
the robot’s motion.
The important point is how easily the turning
behaviors can be implemented using this RROS
command. The controlling parameter is formed by adding
one of four predefined constants (ForwRight, ForwLeft,
RevRight, and RevLeft) to half of the turning parameter
TurnAmount.
If you are implementing this project on a different
platform, the first portion of the program should not
have to be altered at all; the second portion should be
easy to modify by just substituting code that moves your
robot in the appropriate manner.
Mounting the Tablet
For our second example, the tablet will be mounted
on the robot allowing the sensor data to be indicative of
the orientation of the robot itself. Ideally for a finished
project, the robot would be designed to house the tablet
in an attractive manner. For our experimentation, we just
needed a quick and functional solution.
Figure 3 shows a holding bracket for the tablet that
we constructed from foam board using only a razor blade
and white glue. The details of the construction will
depend on the robot and tablet you use. Take care to
ensure that the bracket does not obstruct the camera’s
view as we will be using it in next month’s project.
Our bracket allows the tablet to be mounted on the
RB- 9 chassis in either the portrait (Figure 4) or landscape
mode (Figure 5). Both options work well for
demonstrating a finished project, but we quickly found
we needed an alternative mounting during the
development phase.
Figure 6 shows another foam board bracket that
holds both the tablet and the lightweight keyboard dock
as shown in Figure 7. While this arrangement is far less
attractive, it allows programs to be easily modified and
immediately tested without constantly connecting and
SERVO 01.2014 71
Figure 5.
Figure 6.