User Tools

Site Tools


weblogo:manual:floor_bots

Advanced Floor Robots

This chapter covers advanced floor robots that are tighly coupled to a screen turtle. Such a floor robot repeats very movement that the screen turtle does. There are a few extra commands that each floor robot interprets differently.

The InO-Bot

inobot.jpgThe InO-Bot is the latest addition to our expanding family of floor robots. This robot does not have any buttons like Bee-Bot or Blue-Bot. Instead, Logo controls the robot directly. This is our first true Logo floor turtle!

The InO-Bot comes with a pen holder and a large collection of built-in sensors. Like a bat, it has an ultrasound emitter and receiver that makes it able to measure the distance to an obstacle. It also has an infrared emitter and a corresponding sensor. Whenever an InO-Bot switches on its infrared beam, other InO-Bots can sense that beam.

Furthermore, it has two headlights, and set of 8 full-color LEDs. Finally, it has an extra jack where you could connect a small motor, a fan, a light, or the like.

Did we mention that it can play sounds and even play music?

The Root Robot

This is an advanced floor robot that we do not sell directly. Please visit https://www.rootrobotics.com to buy a Root robot.

Having said this, we like the concept, and because is it so close to a Logo turtle, we decided to offer support for that robot as well.

The Root robot supports precise movements with or without a pen. On a magnetic surface like a whiteboard, it can even move vertically, and it can erase a drawing. It supports a long line of sensors, among them a color sensor to track colored lines, and a sensor that should keep the robot from falling off a table.

Connecting via Bluetooth

All of these floor robots have a Bluetooth radio built in so your computer or tablet can connect. Logo can only communicate with floor robots when connected. Therefore, you need to connect your robot first.

Select “Connect to Bluetooth device…” from the Tools menu to select the robot device to connect to. Please keep in mind that your browser needs to understand Web Bluetooth to connect. The desktop version connects to Bluetooth just fine. The dialog lists all devices known to Logo.

On Windows, the Root robot sometimes does not list correctly; instead an unknown device is listed. Just select that device, and Logo connects if the device is a Root robot.

Once Logo has connected to a robot, it flashes and beeps, and Logo creates a special turtle for you and sets the TELL list to the name of that turtle so commands like FORWARD or RIGHT work with that turtle. The special turtle forwards all commands it knows to the floor robot.

The name of the turtle corresponds to the Bluetooth name of the device.

You should not create more than one special screen turtle. If you need to re-create the turtle, erase it first with the ERASE command.

The Special Turtle

At first sight, the special turtle is just another turtle with the shape of the floor robot, but there are quite a few subtle differences.

  • When you move or turn the turtle, the robot moves and turns in exactly the same way. Also, the PENUP and PENDOWN commands makes the robot raise and lower its pen.
  • The SETSPEED command affects the robot's speed.
  • Several additional properties have been added to the turtle's proeprty list.
  • Some commands like SETWIDTH to set the pen's width affect the screen turtle, but not the robot.
  • The screen turtle silently ignores all commands that the robot cannot execute. It cannot, for example, fill an area, or draw an ellipsis with STAMPOVAL.

Properties

All advanced floor robots have a number of additional properties that cover the robot's sensors. Use the PLIST and GPROP commands to access these properties, and PPROP or PPROPS to modify them.

Events

If you want to process sensor input, it is a great idea to write an event handler.

Logo posts robot events as soon as the robot has been connected to Logo. The event data can be found in the global variable :EVENTDATA. When an event occurs, this variable contains the sensor value. The global variable :EVENTSOURCE contains the name of the floor bot that triggered the event.

To store an event handler, use the PPROP command to store a runlist into the "EVENTS property list, using the event name as the property name.

This example checks the status of InO-Bot's left front obstacle sensor. When triggered, Logo prints “OUCH”, backs up and turns right.

PPROP "EVENTS "INOBOT.FRONTLEFT [
    IF :EVENTDATA [
        PRINT "OUCH
        BK 10
        RT 45
    ]
]

See the Events page for more details about Logo events.

The InO-Bot in Depth

This section explains all special commands and properties available for InO-Bot.

Movements

InO-Bot moves in units of centimeters (cm). the command FORWARD 10 would cause InO-Bot to move forward 10 cm. The maximum distance that InO-Bot can move is 127 cm. If you need InO-Bot to move further, you need to issue multiple movement commands.

InO-Bot can turn in degrees. Each unit is a single degree, so the command RIGHT 20 turns InO-Bot right by 20 degrees. The maximum movement is 180 degrees in either direction.

LEDs

InO-Bot has 8 full-color LEDs that you can program either individually or together.

Please refer to the LED command for details.

Sounds and Music

You can make InO-Bot play simple melodies. Its note range is limited, and the accuracy of the notes is not too good, but sufficient. It can also play a number of predefined sounds.

Please refer to the PLAY.SOUND, PLAY.NOTES and SAY commands for details.

Properties

InO-Bot has a number of additional properties that cover the robot's sensors. Use the PLIST and GPROP commands to access these properties, and PPROP or PPROPS to modify them.

If you want to process sensor input, it is a great idea to write an event handler - see the list of events below.

BATTERY Reports the battery level in Volts.
CALIBRATION Movement calibration, see below.
CONNECTOR Controls the external connector.
DISTANCE Reports the distance to an obstacle.
INFRARED Controls the infrared emitter and receiver.
LIGHT Reports the the value of the light sensor.
LIGHTS Controls the brightness of the headlights.
LINELEFT Reports the status of the left line sensor.
LINERIGHT Reports the status of the right line sensor.
NOISELEVEL Reports the noise level that InO-Bot's microphone records.
FRONTLEFT Reports the status of the front left obstacle sensor.
FRONTRIGHT Reports the status of the front right obstacle sensor.
REARRIGHT Reports the status of the rear left obstacle sensor.
FRONTLEFT Reports the status of the rear right obstacle sensor.

For a detailed description, please see the InO-Bot properties page.

Events

Event Name EVENTDATA Description
INOBOT.CONNECTOR FORWARD, BACK, STOP When InO-Bot's external connector signals a status change (not sure about that).
INOBOT.DISTANCE number When InO-Bot's ultrasound sensors pick up a changed distance.
INOBOT.INFRARED number Sent when InO-Bot's infrared sensors report a changed value.
INOBOT.LIGHT number Sent when InO-Bot's light sensors report a changed value.
INOBOT.LINELEFT TRUE/FALSE Sent when InO-Bot's left line tracking sensor reports a changed value.
INOBOT.LINERIGHT TRUE/FALSE Sent when InO-Bot's right line tracking sensor reports a changed value.
INOBOT.NOISELEVEL number Sent when InO-Bot's built-in microphone report a changed noise level.
INOBOT.FRONTLEFT TRUE/FALSE Sent when InO-Bot's front left obstacle sensor reports a changed value.
INOBOT.FRONTRIGHT TRUE/FALSE Sent when InO-Bot's front right obstacle sensor reports a changed value.
INOBOT.REARLEFT TRUE/FALSE Sent when InO-Bot's rear left obstacle sensor reports a changed value.
INOBOT.REARRIGHT TRUE/FALSE Sent when InO-Bot's rear right obstacle sensor reports a changed value.

Calibration

Do not expect InO-Bot to do exact movements, though! Most often, Ino-Bot needs to be calibrated somewhat. You can use InO-Bot's CALIBRATION property to make the bot's movements and turns more accurate. This property i s a two-element list. The first element is a turn adjustment factor, and the second element is a movement adjustment factor. Initially, both values are set to 1.

Now, tell InO-Bot to turn right 90 degrees, and measure the number of degrees that InO-Bot actually turned. Let us say that InO-Bot actually turned 95 degrees. In that case, you would issue the following command:

PPROP "INOBOT "CALIBRATION [90/95 1]
Error: 90 is not between -5 and 5

Oops! What happened? Well, Logo treats everything inside square brackets literally; it does not calculate the expression “90/95”. Instead, Logo created a list with 4 elements: [90 / 95 1]. If you want Logo to calculate the expression, use the LIST command to have Logo construct the list:

PPROP "INOBOT "CALIBRATION LIST 90/95 1

Now, try again, and see if InO-Bot turns 90 degrees. You may need to repeat the procedure a few times.

Try to send InO-Bot forward 10 cm, and measure the actual distance. If InO-Bot actually moved 9.5 cm, for example, you enter this command:

PPROP "INOBOT "CALIBRATION LIST 90/95 10/9.5

Does InO-Bot advance 10 cm now?

If you measure in inches instead of cm, you can use the same method. 10 cm are 3.937 inches; now, measure the actual distance (9.5 cm would in this example be 3.74 inches), and enter this command:

PPROP "INOBOT "CALIBRATION LIST 90/95 3.937/3.74

The Root Robot in Depth

This section contains all info that is specific to the Root robot.

Movements

The Root robot moves in millimeter units, so FORWARD 10 causes a movement of 10 mm = 1 cm. It can turn in units of single degrees. The PENERASE command activates the eraser.

LEDs

The Root robot has four LEDs that can change color, and that have a few blinking effects.

Please refer to the LED command for details.

Sounds and Music

The Root robot can play notes as beeps. Additionally, the SAY command causes it to talk robot gibberish.

Please refer to the PLAY.SOUND, PLAY.NOTES and SAY commands for details.

Properties

BATTERY Reports the battery level in percent.
BUMPERLEFT Reports the state of the left bumper sensor.
BUMPERRIGHT Reports the state of the right bumper sensor.
CLIFF Reports the state of the cliff sensor.
COLORS Reports the state of the color sensor array.
LIGHT Reports the light sensors.
STALLED Reportes whether a motor is stalled.
TOUCHFRONTLEFT Reports the status of the top front left touch sensor.
TOUCHFRONTRIGHT Reports the status of the top front right touch sensor.
TOUCHREARLEFT Reports the status of the top rear left touch sensor.
TOUCHREARRIGHT Reports the status of the top rear right touch sensor.

For a detailed description, please see the Root properties page.

Events

Event Name EVENTDATA Description
ROOTBOT.BUMPERLEFT TRUE or FALSE Triggered when the state of the front left bumper sensor changes. The value is either TRUE or FALSE.
ROOTBOT.BUMPERRIGHT TRUE or FALSE Triggered when the state of the front right bumper sensor changes. The value is either TRUE or FALSE.
ROOTBOT.CLIFF TRUE or FALSE The cliff sensor triggers when Root is about to fall of the table.
ROOTBOT.COLORS 5-element list Root's 32 color sensors are divided into five groups of 6 sensors, with the middle group being 8 sensors. When the colors of a group change, the corresponding list element (the first element is the left group) changes its name to the color that most sensors in that group detect.
ROOTBOT.LIGHT word Triggered when the light sensors (left or right, corresponding to the list's first and secoind element) changes. Possible values are DARK, LEFT, RIGHT, or BRIGHT, depending of the state of both sensors.
ROOTBOT.STALLED string Sent when one of the motors reports a stalled state. Possible values are NONE, LEFT, RIGHT, or MARKER for the pen motor.
ROOTBOT.TOUCHFRONTLEFT TRUE or FALSE Sent when Root's top front left sensor field is touched or released.
ROOTBOT.TOUCHFRONTRIGHT TRUE or FALSE Sent when Root's top front right sensor field is touched or released.
ROOTBOT.TOUCHREARLEFT TRUE or FALSE Sent when Root's top rear left sensor field is touched or released.
ROOTBOT.TOUCHREARRIGHT TRUE or FALSE Sent when Root's top rear right sensor field is touched or released.

Calibration

The Root robot does not need any calibration.

weblogo/manual/floor_bots.txt · Last modified: 2019/01/04 12:31 by michael