This package implements the Adaptive Grasp Controller for the Pisa/IIT SoftHand and the KUKA LWR. This controller can be used as an alternative for the simple grasp in the SOMA Planner. In order to try this on a real robot, the IMU Glove for the Pisa/IIT SoftHand is required.
This package is tested to work on Ubuntu 14.04 with ROS Indigo. To build the Adaptive Grasp Controller, it is necessary to have the following packages from the GitHub page of Centro Piaggio:
- hrl-kdl (branch: indigo-devel) : https://github.com/CentroEPiaggio/hrl-kdl
- finger_fk (branch: soma_july_review) : https://github.com/CentroEPiaggio/finger_fk
- IMU (branch: master) : https://github.com/CentroEPiaggio/IMU
- kuka-lwr (branch: soma_devel) : https://github.com/CentroEPiaggio/kuka-lwr
- pisa-iit-soft-hand (branch: indigo_devel) : https://github.com/CentroEPiaggio/pisa-iit-soft-hand
- vito-robot (branch: soma_july_review) : https://github.com/CentroEPiaggio/vito-robot
For testing on real robot with IMU Glove install also:
- imu_glove_finger_touch_utils (branch: master) : https://github.com/CentroEPiaggio/imu_glove_finger_touch_utils
First of all, your should have correctly sourced your ROS environment and the setup.bash
of your workspace. Make also sure that you have no symlink to the workspace. To install everything clone this package into the src
of your catkin workspace folder and just cd to the package folder and run the bash script install_adaptive.sh
as follows:
cd adaptive_grasp_controller/scripts
chmod +x install_adaptive.sh
./install_adaptive.sh
This script will check for the needed conditions and for missing packages and proceed to clone, switch to the correct branches and make all necessary repos. If any missing packages are found during the installation, please install them and re-run the script.
Troubleshooting:
- if any error related to
TransmissionSharedPtr
appears while compilinggazebo_ros_soft_hand
, please checkout to theqb_interface_devel
branch of the packagepisa-iit-soft-hand
- if
Import Error
for any.srv
module is found, please delete thedevel
and thebuild
folders or at least the relevant folders inside them and re-run the scriptinstall_adaptive.sh
- if
catkin_make command not found
error is encountered, repeat the above stated step
This controller has been coded in the form of a ROS service. Most of the parameters of the Adaptive Grasp can be changed from the adaptive_grasp_config.yaml
and the publish_touch_demo.yaml
files which are already loaded by the launchAdaptiveGraspSim.launch
and the launchPublishTouchDemo.launch
launch files. A short description of each parameter is given in the yaml files themself.
N.B. A proper and synced functioning of the Adaptive IMU Grasping depends highly on the specifications of the used system (thus on a smooth functioning of the SoftHand and KUKA hardware interfaces for ROS).
In four separate terminals run the following commands:
roslaunch adaptive_grasp_controller launchLWRSoftHandJointTraj.launch
roslaunch adaptive_grasp_controller launchAdaptiveGraspSim.launch
roslaunch imu_glove_finger_touch_utils launchCollisionIdentification.launch
rosservice call /adaptive_grasp_controller "run: true"
The Adaptive Grasp will be performed for the default finger set in publish_touch_demo.yaml
.
Roslaunch in separate terminals the launch files for the robot and the controller service as follows:
roslaunch adaptive_grasp_controller launchLWRSoftHandJointTraj.launch
roslaunch adaptive_grasp_controller launchAdaptiveGraspSim.launch
The first file launches a KUKA LWR 4+ robot with a Pisa/IIT SoftHand mounted on it. Please make sure that the args right_arm_enabled
and right_hand_enabled
are set correctly: these args should be set to true
in case of a real robot launch (in this case the arg use_gazebo
must be set to false
) and should be set to false
for simulations in Gazebo (obviously now the arg use_gazebo
must be set to true
). Also set the arg use_other_utils
to true
in launchAdaptiveGraspSim.launch
for finger forward kinematics.
Here we suppose that the robot is already in a grasp pose above the object to be grabbed. The object will not be present in the scene as it is complicated to simulate contacts between objects and the robotic hand (especially the Pisa/IIT SoftHand) inside Gazebo.
The Adaptive Grasp can be tried out in simulation without an acutal touch sensing device (IMU Glove). In order to simulate the touch on a particular finger two steps need to be carried out.
-
Set the
finger_id
,input_synergy_threshold
andoutput_synergy_threshold
inpublish_touch_demo.yaml
. The ids of the fingers are 1 for thumb, 2 for index, 3 for middle, 4 for ring, and 5 for little. The synergy values should be doubles between 0.0 and 1.0. These params are better explained in the yaml itself. -
Launch the node that simulates the touch detection as follows:
roslaunch adaptive_grasp_controller launchPublishTouchDemo.launch
At this point, the robot should be loaded in Gazebo and the terminals should look as in the image below:
Now the final step is to call the Adaptive Grasp service:
rosservice call /adaptive_grasp_controller "run: true"
The hand will start to close and a touch will be detected on the specified finger (finger_id
) when the synergy value reaches input_synergy_threshold
. Then the adaptive motion will be computed and forwarded to the robot. During execution, when the synergy value exceeds output_synergy_threshold
the adaptive motion is stopped and the hand will complete the closing.
In summary, in order to try the Adaptive Grasping simulation four terminals are required. The following is a possible terminator split configuration:
Even here we suppose that the robot is already in a grasp pose above the object to be grabbed. In order to do experiments using the IMU Glove, the collision_identification
node needs to be running.
roslaunch imu_glove_finger_touch_utils launchCollisionIdentification.launch
Remember that the this launch starts also the qb_interface_imu
node which communicates with the IMU Glove.
Finally call the Adaptive Grasp service by typing in a new terminal window the following:
rosservice call /adaptive_grasp_controller "run: true"
This will make the robot start to close the hand and whenever a touch is found by the collision_identification
node the id of the finger in collision will be published to the topic /finger_touching_topic
. This will cause a change in the grasping strategy (For more, refer to the deliverable).
Instead of launching launchPublishTouchDemo.launch
, finger touches can be simulated by manually publishing the id of the finger, that we suppose touches the object, to the topic /finger_touching_topic
.
For example:
Before calling the Adaptive Grasp Controller service:
rostopic pub -r 10 /touching_finger_topic std_msgs/Int8 "data: 0"
When the Adaptive Grasp Controller service has been called and the SoftHand starts to close, a finger touch on the thumb can be passed manually to the controller by publishing (also on another terminal window) on /finger_touching_topic
as follows:
rostopic pub -r 10 /touching_finger_topic std_msgs/Int8 "data: 1"