This package provides two synchronized nodes which implement a reactive grasping task on a real KUKA LWR 4+ robot endowed with a Pisa IIT/SoftHand and a sensorized 5 IMUs Glove.
-
Follow the instruction in the README.md at CentroEPiaggio/vito-robot@3b74d18 to properly clone the vito-robot package in your catkin workspace.
git clone --recursive [email protected]:CentroEPiaggio/vito-robot.git cd vito-robot git checkout 3b74d1878909c8790d4946acbbc5628675ec70fc git submodule update cd ..
-
Compile it through
catkin_make
and check if everything works as expected (i.e. executeroslaunch vito_description display.launch
). -
Clone the reactive_grasping package (use the
--recursive
flag) in your catkin workspace and compile everything (again withcatkin_make
).git clone --recursive [email protected]:alextoind/reactive-grasping-task.git
- have the CentroEPiaggio/vito-robot@3b74d18 and last commit of reactive-grasping-task packages compiled in the catkin workspace;
- Be sure that the Glove (the only hardware needed) is properly connected to the /dev/ttyACM0 serial port (i.e. the default one). If the port differs, change it in the Glove settings (check glove_acquisition package);
- In a terminal, execute
roslaunch reactive_grasping_description display.launch
and wait for the robot to reach the home pose (this may take a while). Setuse_rviz:=false
to speed up the simulation. - If you touch the Glove with an object, the simulated robot should perform a grasp primitive to "grab" it. When the hand is closed, touch it again to let the robot open it and come back to the home pose. Do it as many times as you want (infinite loop until ROS shutdown).
- have the CentroEPiaggio/vito-robot@3b74d18 and last commit of reactive-grasping-task packages compiled in the catkin workspace;
- have the PC in the KUKA local network with IP set to 192.168.0.150. Check connection with the right arm:
ping 192.168.0.10
; - check the SoftHand ID: use the qbmove library in the SoftHand package (
ls /dev | grep USB
to get the current hand port) and set this value to match it; - Be sure that the Glove is properly connected to the /dev/ttyACM0 serial port (i.e. the default one). If the port differs, change it in the Glove settings (check glove_acquisition package);
- move the robot in a pose near to the task home using gravity compensation mode;
- IMPORTANT: have a hand on the emergency button from now on;
- start the KRL script:
- set KUKA robot in position mode;
- enter in the script;
- disable robot brakes;
- run the code until it waits for communication from the PC;
- execute the following commands in distinct terminals (leave them open until the end of the task):
roslaunch reactive_grasping_description display.launch use_rviz:=true use_robot_sim:=false load_moveit:=false right_arm_enabled:=true right_hand_enabled:=true
;roslaunch reactive_grasping_moveit_configuration move_group.launch allow_trajectory_execution:=true fake_execution:=false info:=true debug:=false
;- enable the motion planning from rviz when the MoveIt library is successfully loaded;
- [optional] check if the KUKA robot and the SoftHand can be moved properly
rosrun rqt_joint_trajectory_controller rqt_joint_trajectory_controller
; roslaunch reactive_grasping task_core.launch
;
- If you touch the Glove with an object, the KUKA robot should perform a grasp primitive to grab it. When the hand is closed, touch it again to let the robot open it and come back to the home pose. Do it as many times as you want (infinite loop until ROS shutdown).
The demo can be tested either in the simulated Gazebo scenario or with the real KUKA robot, and it shows the whole sequence of grasp primitives performable by the robot. This can be useful to see if everything work as expected.
To start the demo, it is only necessary to add use_demo:=true
when launching display.launch
in both the previous scenarios.
The comparision_dataset.yaml can be calibrated by enabling the ROS param calibration. Touch the glove several times and interactively choose which acceleration map is is satisfactory (use the MATLAB script visualize_acceleration_maps.m to help you visualizing the maps). The chosen acceleration maps has to be searched in the *_accelerations_map.dat log file and copied (in the proper position) in the comparison_dataset.yaml configuration file. It has to be notice that the robot won't perform the grasp primitive while calibrating.
- This package is not standalone: the Centro E. Piaggio vito_robot package (commit CentroEPiaggio/vito-robot@3b74d18) has to be compiled on your machine.
- The ReactiveGraspingDetection class uses linux-specific commands, e.g.
system("mkdir -p ...")
. - This code has been developed for ROS Indigo on ubuntu 14.04. No warranty for other distributions.
The two classes provides several parameters which can be set by the user at runtime:
- verbose_mode
- very_verbose_mode
- only_detection
- calibration
- glove_topic_name
- accel_map_topic_name
- topic_queue_length
- filter_coeff_a
- filter_coeff_b
- num_imus
- gravity_value
- contact_threshold
- window_size
- tails_scale_factor
- delay_threshold
- action_server
- log_file_base_path
- log_file_name_raw
- log_file_name_filt
- log_file_name_map
- verbose_mode
- very_verbose_mode
- hand_synergy_joint
- hand_synergy_topic
- joint_state_topic
- topic_queue_length
- action_server
- move_group
- move_group_home
- frame_base
- frame_ee_kuka
- frame_ee_glove
- time_for_grasp
- arm_velocity_threshold
- arm_distance_threshold
- hand_velocity_threshold
- hand_distance_threshold