Previous: Running the Simulator
Next: Message Descriptions
ROS Tutorials
If you are not familiar with ROS, you may want to look at the tutorials on the ROS website at http://www.ros.org/wiki/ROS/Tutorials.
We have a tutorial on developing code to interact with the DARPA ARM robot for the software track. It goes over basic message definitions and interfaces for the robot. It assumes good coding capabilities of the user. Please skip any hardware specific steps, as the robot activates itself.
Example Applications
This package provides two examples for how to use the simulated DARPA robot to achieve a task. We use the gazebo simulator, which is an open source simulator capable of simulating robots, sensors and objects in a three-dimensional world. It provides simulated sensor feedback and physically plausible interactions between objects. Before walking through the two applications we will first explain the ROS kinematics service which we will be utilizing in performing our movements. This service provides capability to perform forward and inverse kinematics with a defined set of joints.
The first example application commands the robot pick up a cup. This eample asks gazebo for the current model states, rather than using sensor data, to get the location of the cup. It then uses the ROS kinematics service to move the palm to that cup, close the fingers around it, and move it. The second application shows an example which uses sensor data to locate the desired object. It uses the simulated data from SR4000 laser range sensor to find a ball and the strain gauges on the fingers to grasp it. The depth sensor publishes a point cloud which we can pass to a simple sphere detector, which utilizes RANSAC, to find a spherical object on a table. In this example we move the arm to wing position, move the head so the ball is within the field of view of the SR4000, wait for the sphere detector to locate the ball, then use the kinematics service to move the palm to the ball. We then pick up the ball by closing the fingers and checking the strain gauges so that they stop once sufficient grasping force is detected. Finally we lift the ball and drop it back on the table, to show that it was in the control of the robot, and then move back to the wing position.
The tutorial is broken up into five sections:
- Inverse and Forward Kinematics Service
- Cup Pick Up Code
- Ball Pick Up Code
- Keyboard Handling
- Build, Setup, and Running
You should already have the code in your checkout from installation, but the code can also be found here
Stereo Camera Usage
We use a simulated Bumblebee Stereo Camera. To two images produced can be used to generate a point cloud using ROS's stereo camera processor. To run this simply run the simulator and then run the following launch file:
roslaunch SimRobot stereo.launch
or alternatively:
ROS_NAMESPACE=BB2 rosrun stereo_image_proc stereo_image_proc __name:=proc
This will publish a point cloud on the "/BB2/points" topic. For more details visit the ROS Wiki
Rules to live by
These tips have been learned through use on the real robot. They will be very useful to follow for producing code in simulation which will be successful and nondestructive when run on the robot.
1. Wing Position
Always put the arms in wing position before starting and after finishing an application with the arm. This will reduce the chance of the arm striking the table. This will also be useful when running the same code on the real robot and the simulator, since on the real robot the arms start in a relaxed position hanging down rather than sticking straight out.
2. Finger Spread
Before you change the spread joint of the hand always have fingers open. If the fingers are closed when you change the spread they will often run into each other and get stuck. This can cause damage on the real robot.
3 Strain Gauge
Check the finger strain gauges to stop the hand from gripping harder when too much gripping force is detected. The method to use for the gauges is to look for a change in strain from before to after contact as opposed to looking for a specific strain value, due to noise and drift in the strain gauge readings. If the value changes by more than 400 the strain is too high. The strain values range from 0 to 4091. Initially when there is no strain the value drifts around the middle of this range. On the real robot if fingers press too hard they can break. In addition when two fingers are pressing against the third it is possible to break the third finger. The strain gauges should also be checked, in addition to the Force-Torque sensor, to make sure we have not run the hand into the table. If the hand does run into the table the entire arm should be stopped so none of the components of the hand get broken.
4 Subscribing to Sensors
Only subscribe to topics that you need and only when you need them or your programs will run slower than is necessary. ROS and gazebo have built in methods to not produce data which they know will not get used.
5 Collisions
The kinematics services do not check for collisions along the path when looking for solutions. It is the responsibility of the user to ensure that the arm is not going to collide with anything in the world when executing moves.
Previous: Running the Simulator
Next: Message Descriptions
