This tutorial will show you how to use the Arbotix-M Robocontroller board to control DYNAMIXEL servos with ROS.
Before you can use the Arbotix board with ROS, you need to flash a proper firmware. Follow the Quick Start Guide from TrossenRobotics to learn how to program the board with Arduino IDE.
If you have successfully programmed the example sketches, open the ros sketch from Arbotix Sketches (File -> Sketchbook -> ArbotiX Sketches -> ros).
Then compile it (the green check button) and upload (the green arrow button) to the board.
The rest of this tutorial can be done in any machine that runs ROS and have an Internet connection. It can be Leo Rover
or your computer
The driver for Arbotix board is distributed in arbotix package. It can be installed from official repository just by typing:
Make sure your setup looks like this:
Then, type in your terminal:
A terminal prompt should appear. Type help for the list of commands.
Connect the Dynamixel you want to set id to. Then type ls to see id of connected servo.
Type mv [source] [target] to change it. For example, when the servo has ID 1 and we want to set it to 2, just type:
You can also read and change some parameters to test servo movement with get and set commands. For example, to read current position of servo with ID 1, type:
To move the servo to position 300 (the range is between 0 and 1023), type:
To set the goal speed of the servo to half of the maximum, type:
The servo should start moving continuously in one direction.
We will create a package that tests the arbotix driver. Let's start by creating a catkin workspace (if you don't have one yet):
and an empty package:
Inside the package, create config/test.yaml file with the following content:
And launch/test.launch with the following:
Build the package and source the result space:
Now, run the launch file, by typing:
You should see new topics spawned (check with rostopic list):
And new services (check with rosservice list):
To shortly summarize the features:
We can try to test the features using rostopic and rosservice tools.
Assuming you have connected the servo with ID 1, start by setting the speed to a safe value (0.2 rad/s in this case):
Move servo to a default neutral value:
Relax joint:
This tutorial will show you how to use the Arbotix-M Robocontroller board to control DYNAMIXEL servos with ROS.