The Bioloid is a a robot construction kit made of servomotors, sensors and frame elements. You can find
more information on the manufacturer’s official website at http://www.robotis.com/zbxe/bioloid_en.
Urbi cannot run directly on the Bioloid controller (CM5, CM510). Urbi runs on your computer and
talks to the Bioloid controller over serial link (RS232, or wireless depending on your configuration).
Urbi can also talk directly to the motor bus if you have an usb2dynamixel.
Urbi for Bioloid is using a custom firmware in the CM-5 controller. You must upload the new firmware
in your CM-5 using the procedure below. This operation is reversible.
Download the firmware file from our website at http://www.gostai.com/downloads/urbi-for-bioloid.zip.
- Start the robot terminal software from Robotis (installed with your Bioloid software).
- Make sure your CM-5 batteries are fully charged or that it is plugged to a power supply.
- Connect your CM-5 to the serial port of your computer.
- Turn off your CM-5 (using the red on/off button).
- Maintain the ‘#’ key pressed on your keyboard while turning the CM-5 back on. A message
like this one should be displayed:
SYSTEM O.K. (CM5 boot loader V1.xx)
-#######
- Press enter, type load and press enter again. Display should be:
SYSTEM O.K. (CM5 boot loader V1.xx)
-#######
-load
Write Address: 00000000
Ready..
- In the menu, select “Files”, “Transmit file” (Control-T) and select the firmware file you
downloaded. After a few seconds, display should turn to:
Ready..Success
(and other information)
Look at http://www.urbiforge.com/index.php/Robots/Bioloid for up-to-date information on how
to download Urbi for Bioloid.
Connect your CM-5 to the PC and turn it on before starting Urbi.
When you start Urbi, the initialization script in global.u will connect to the CM-5 (edit the file to
change the port if required), scan for devices and instantiate them. It will create:
- one bioloid object representing the connexion to the CM5.
- one object per motor (AX12 (Section 23.3.2)) named motorid and motors[id] where id
is the motor identifier.
- one object per sensor (AXS1 (Section 23.3.3)) named sensorid and sensors[id] where
id is the sensor id (e.g., sensor100, sensors[100]).
Once initialized, do not disconnect any motor that was detected or everything will run very
slow.
At this point you might want to give motor names more adapted to your model. Here is an
example:
do (Global)
{
var wheelL = motors[1];
var wheelR = motors[2];
var headYaw = motors[7];
};
All the AX12 features are exposed in urbiscript. The following section lists the main slots with code
examples explaining how to use them. You can use Object.localSlotNames and refer to the AX12
documentation for more information.
- val
The current motor position when read, the target position when written to.
motor6.val = 90deg;
motor6.val = 0 time:5s;
at (motor6.val > 0) echo("tick") onleave echo("tack");
motor6.val = 0 sin:1s ampli:20deg,
- cwLimit, ccwLimit
Set min and max reachable angles. When they are both equal to 0, the motor is put in
continuous rotation mode. In this mode, writing to val has no effect: the motor moves at the
speed given by the speed slot.
- speed
When read, gives the current rotation speed. When written to, set the speed at which following
commands will be executed. In continuous rotation mode, start moving the motor at given speed.
motor6.speed = 2;
motor6.val = 90deg;
motor6.cwLimit = motor6.ccwLimit = 0;
motor6.speed = 1;
- torque
Current torque the motor is giving.
- load
Shut down the motor when 0.
at(motor6.torque > 5) motor6.load = 0;
All the AXS1 features are exposed in urbiscript. The following section lists the main slots with code
examples explaining how to use them. You can use Object.localSlotNames and refer to the AXS1
documentation for more information.
- IRLeft, IRCenter, IRRight
Amount of infrared received by the sensor using the internal emitter. This sensors detect
light reflected by objects nearby in the direction of the sensor.
- lightLeft, lightCenter, lightRight
Amount of infrared received by the sensor without the emitter. Detects infrared light
sources such as incandescent light, candles, ...
- buzzerIndex
Play a note when written to.
- buzzerTime
Set length of next played note.
- clapCount
Number of successive claps detected by the microphone.
- soundVolume
Volume of sound received by the microphone.
at (sensor100.soundVolume->changed?)
motor6.speed = sensor100.soundVolume * 6;
at (sensor100.clapCount == 4)
motor6.speed = 0;
- soundVolumeMax
Holds maximum sound volume recorded so far. Write 0 to this slot to reset.