robot simulator that mirrors the sensory configurations
supported by the RROS chip.
When the RROS is activated, the high-level commands
and functions normally used to control the simulator and
read data from its sensors automatically communicate over
a link with the RROS chip — commanding the real motors
and requesting data from the real sensors. When you write
a program to control your robot, you can concentrate on
what needs to be done without having to worry about the
details of how it actually gets done because the RROS does
it for you.
The RROS’ ability to manage the robot’s resources —
while masking the details from the user — makes it a true
operating system. For example, the RobotBASIC function
rFeel() can be used to obtain the state of various perimeter
proximity sensors regardless of what type of sensors are
This is such an important point, let’s look at another
example. The raw data obtained from ranging sensors can
differ dramatically. Even though PING))) and Maxbotix
ranging sensors are both ultrasonic, PING))) sensors provide
a reading involving time, while the Maxbotix sensors
provide a linear voltage.
Sharp IR ranging sensors are different still, providing a
nonlinear voltage that must be transformed to be useful.
When the function rRange() is used though, the reading
provided will be the distance measured in 1/4 inch units —
no matter what sensor is used to make the measurement.
The RROS’ ability to manage sensors is equally true for
motors. The command rForward 40 moves the simulated
robot a distance equal to its diameter. When properly
calibrated, the same command will move a real robot a
distance equal to its diameter – no matter what type of
motors are used or how they are interfaced.
Special rCommands are used to calibrate the RROS so
that the real robot mimics — within reason — the operation
of the simulator. Simulator-based behaviors that are
controlled by sensory feedback correlate surprisingly well
with a real robot.
Build Your Robot Your Way
The RROS chip makes it easy to build a robot your way.
Analyze what you want your robot to do and choose
motors that make sense for your application.
Experiment with the simulator to determine what
sensors are appropriate for the situations your robot will be
expected to face. Allow your cost limitations, your robot’s
environment, even your robot’s size to dictate your final
Connect your motors and sensors to the RROS chip and
it will handle all your interfacing needs, allowing you to
program your robot using RobotBASIC’s high-level simulator
commands. Let’s look at a simplified example to illustrate
Creating a Sample Behavior
Assume you want to
build a robot that can
detect when a wall is
perimeter sensors, and
then turn away based on
which sensors were
triggered. The RobotBASIC
simulator has five
proximity sensors spaced
equally across the front
half of the robot as shown in Figure 1. Each bit in the
sensor reading corresponds to one of the sensors, with the
LSB corresponding to the right-most sensor. The robot could
respond in many ways, but for this example, let’s assume
the following behavior:
• The robot should move forward until a wall is
detected, then ...
• It should turn left approximately 90º if either of the
two right sensors are triggered.
• It should turn right approximately 90º if either of the
two left sensors are triggered.
• Approximately means the specified angle plus a
random amount up to 30º.
The code in Figure 2 implements a program on the
simulator that creates the desired behavior, and Figure 3
shows how the simulated robot moves in response to that
program. Notice that the code in Figure 2 is easy to follow
because it does not have to deal with the complicated low-level tasks of controlling motors or actually reading sensors.
Building the Robot
Now that we’ve used the simulator to help us develop
a program to control a robot, let’s see how the RROS can
be used to build a robot capable of performing these same
d = rFeel()
if d&3 // either of the right sensors
elseif d&24 // either of the left
SERVO 09.2012 61