Controlling PhantomX Pincher Robot Arm
In this tutorial, we will show you how to configure and remotely control PhantomX Pincher Robot connected to the Rover.
Prerequisites
Before you begin, make sure you have internet connection on your Rover.
pageConnect to the InternetAlso, you need to have ROS installed both on a Rover and your computer
pageInstall ROS on Turtle RoverpageInstall ROS on your host machineAnd, of course, assembled Pincher Arm together with ArbotiX-M Robocontroller connected to your Rover.
1. On your computer
1.1 Flash ArbotiX-M Robocontroller board
To program Arbotix board, you can follow the Getting Started Guide from Trossen Robotics.
If everything works, open and upload the following sketch
1.2 Install Arbotix ROS drivers
You can install arbotix ROS packages from repository (ros-kinetic-arbotix
package), but for the pincher gripper to work, you need to build an unrealeased 0.11.0 version which adds support for prismatic joints.
To build it, you can follow these steps:
1.3 Set Dynamixel IDs
Connect Arbotix-M board to your computer through FTDI-USB Cable
Source your catkin workspace (either /opt/ros/kinetic
or ~/ros_ws/devel
depending on how you installed Arbotix ROS drivers) and run:
arbotix_terminal
by default, assumes the board is connected on /dev/ttyUSB0
port. If it is attached to another device, you can specify it like this:
To check which port the device connects to, you can, for instance, run dmesg -w
(Ctrl+C to exit), connect the device and check kernel logs.
If you are using Ubuntu on Windows Subsytem for Linux
, you need to open Device Manager and look under Ports for COM port number of the device. COM[N]
corresponds to /dev/ttyS[N]
path. (e.g. COM4 -> /dev/ttyS4). You might need to run:
A terminal prompt should appear. Type help
for list of commands.
Connect the Dynamixel you want to set id to. Then type ls
to see id of connected servo and mv [source] [target]
to change it. For example, when the servo has id 1 and we want to set it to 2, just type mv 1 2
.
On PhantomX pincher arm, servo ids should look like this:
When done, type Ctrl+C to exit terminal
1.4 Test Arbotix ROS drivers
We will create a package that tests arbotix driver. Let's start by creating an empty package
Inside your package, create config/test.yaml
file with following content (change port if needed):
You can set more parameters for each joint, like maximum speed, minimum and maximum angle etc. A brief documentation (Unfortunately, a little outdated) can be found here
And launch/test.launch
with following:
Now, build your workspace
From now on, you need to run source ~/ros_ws/devel/setup.bash
on every terminal session you open (or add it to ~/.bashrc
)
Run Master node on one terminal
And on another, run your launch file
Now, check available topics and services
You should see command
topics that let you set position (in radians) for each servo and joint_states
topic that informs about position and velocity of each joint. There should also be services that allow enabling, relaxing or setting speed (in radians/sec) for each servo.
Let's try to move servo1
joint.
First, set speed to a safe value (0.2 r/s in this case):
Move servo to a default neutral value:
The maximum angle range for a dynamixel servo is [-150, 150] degrees which is equal to approximately [-2.62, 2.62] in radians
Relax joint:
You can also use arbotix_gui
to control each joint. Just type:
A graphical application should appear:
Enable and relax servos by clicking on checkboxes and set position by moving sliders.
Summary
Here's a recording of a terminal session in which we do things mentioned in the tutorial up to this point:
1.5 Install turtlebot_arm packages
The turtlebot_arm packages contain very useful utilities for PhantomX Pincher arm such as:
configuration for arbotix driver
URDF model of the arm
Moveit! configuration package
IKFast Kinematics solver plugin
MoveIt! pick and place demo
Let's build it
To use this packages with PhantomX Pincher, you need to have TURTLEBOT_ARM1
environment variable set to pincher
. To set it automatically on every terminal session, add export
command to .bashrc
file:
Make sure to have roscore
running, then type:
This should run Arbotix driver, robot_state_publisher and set robot_description
parameter.
To view robot arm model with actual position:
Open
rviz
For
Fixed Frame
selectarm_base_link
Click
Add
in Displays panelSelect
RobotModel
and clickOk
To test Motion Planning with MoveIt! :
Run
turtlebot_arm_moveit
launch file:Click on
Planning
tab in Motion Planning displayMove interactive marker to intended position
Click on
Plan
to see Motion visualization and thenExecute
or just click onPlan and Execute
Run pick and place demo (in another terminal session)
2. On your Turtle Rover
2.1 Prepare catkin workspace
Let's prepare a catkin workspace for pincher arm. Start by sourcing the workspace you want to extend. If you don't have an existing development workspace, just do:
Download necessary packages
We only need turtlebot_arm_bringup
and turtlebot_arm_description
packages, so we can remove the rest
Use rosdep
to check for missing dependencies
You should see an error message similar to this:
Download missing packages and their recursive dependencies
Run rosdep again to install any new system dependencies
Now, build the workspace
2.2 Start necessary Nodes
Source your workspace
For ROS to work on multiple machines, you need to set specific Environment Variables:
Add these lines to ~/.bashrc
to set them automatically
Now, run Master node on one terminal
And on another, type:
2.3 Control the arm from your computer
Source your workspace containing turtlebot_arm packages
Set required variables
Replace X.X.X.X with your local IP address. To check your address, you can use ip address
command
You can now use the examples we described earlier, e.g.:
or MoveIt! demo:
Last updated