human-PR2 comanipulation demo
Summary
This tutorial explains the
human-robot comanipulation demo with the PR2 as demonstrated on IROS 2011, San Francisco, California (incl. video). Detailed information on the kinematic loops can be found in the iTaSC_comanipulation_demo.pdf, downloadable at the end of this page. The following paper contains detailed information on the application, including the force nulling control design: Vanthienen, D., De Laet, T., Decré, W., Bruyninckx, H., De Schutter, J. (2012). Force-Sensorless and Bimanual Human-Robot Comanipulation. 10th IFAC Symposium on Robot Control. international symposium on robot control. Dubrovnik, Croatia, 5-7 September 2012 (art.nr. 127)
comanipulation: Human-Robot Comanipulation
Installation
Dependencies
- itasc and it's dependencies
- trajectory_generators
- ROS Electric or Fuerte is required for this tutorial (core and PR2 functionality)
- the following ROS packages
- tf
- tf_conversions
- geometry_msgs
- pr2_controllers
- pr2_kinematics
- pr2_robot
Instructions for ROS Electric
The easiest way to install all needed dependencies:
- ROS Electric and how to find the debian packages on ros.org
- PR2 related code look at
- Orocos toolchain (use version/branch toolchain-2.5)
- get the Orocos toolchain, if you don't have it yet, it makes sense for this application to get it the ROS way
sudo apt-get install ros-electric-rtt-common-msgs
sudo apt-get install ros-electric-rtt-ros-comm
sudo apt-get install ros-electric-rtt-ros-integration
git clone http://git.mech.kuleuven.be/robotics/rtt_geometry.git
- Orocos kinematics and dynamics
sudo apt-get install ros-electric-orocos-kinematics-dynamics
- rFSM
- needs lua:
sudo aptitude install liblua5.1-0-dev
sudo aptitude install liblua5.1-0
sudo aptitude install lua5.1
- rtt-lua tab completion:
git clone git://gitorious.org/orocos-toolchain/rttlua_completion.git
git clone https://github.com/kmarkus/rFSM.git
- opencv_additions (dependencies of findFace)
git clone http://git.mech.kuleuven.be/robotics/opencv_additions.git
- Trajectory Generators
git clone http://git.mech.kuleuven.be/robotics/trajectory_generators.git
- iTaSC
git clone http://git.mech.kuleuven.be/robotics/itasc.git
git clone http://git.mech.kuleuven.be/robotics/itasc_core.git
git clone http://git.mech.kuleuven.be/robotics/itasc_robots_objects.git
git clone http://git.mech.kuleuven.be/robotics/itasc_solvers.git
git clone http://git.mech.kuleuven.be/robotics/itasc_tasks.git
- rtt-ros integration messages (more info)
rosrun rtt_rosnode create_rtt_msgs pr2_controllers_msgs
Instructions for ROS Fuerte
The easiest way to install all needed dependencies: (
How to find the debian packages on ros.org)
- ROS Fuerte
- PR2 related code look at
- Orocos toolchain (use version/branch toolchain-2.5)
- get the Orocos toolchain, if you don't have it yet, it makes sense for this application to get it the ROS way
git clone http://git.mech.kuleuven.be/robotics/rtt_common_msgs.git
git clone http://git.mech.kuleuven.be/robotics/rtt_ros_comm.git
git clone http://git.mech.kuleuven.be/robotics/rtt_ros_integration.git
git clone http://git.mech.kuleuven.be/robotics/rtt_geometry.git
- Orocos kinematics and dynamics
sudo apt-get install ros-fuerte-orocos-kinematics-dynamics
- rFSM
- needs lua:
sudo aptitude install liblua5.1-0-dev
sudo aptitude install liblua5.1-0
sudo aptitude install lua5.1
- rtt-lua tab completion:
git clone git://gitorious.org/orocos-toolchain/rttlua_completion.git
git clone https://github.com/kmarkus/rFSM.git
- opencv_additions (dependencies of findFace)
git clone http://git.mech.kuleuven.be/robotics/opencv_additions.git
- Trajectory Generators
git clone http://git.mech.kuleuven.be/robotics/trajectory_generators.git
- iTaSC
git clone http://git.mech.kuleuven.be/robotics/itasc.git
git clone http://git.mech.kuleuven.be/robotics/itasc_core.git
git clone http://git.mech.kuleuven.be/robotics/itasc_robots_objects.git
git clone http://git.mech.kuleuven.be/robotics/itasc_solvers.git
git clone http://git.mech.kuleuven.be/robotics/itasc_tasks.git
- rtt-ros integration messages (more info)
rosrun rtt_rosnode create_rtt_msgs pr2_controllers_msgs
Installation of the tutorial
git clone http://git.mech.kuleuven.be/robotics/itasc_comanipulation_demo.git
Setup
It is strongly recommended that you add the following to a setup script or your .bashrc
- Make sure that all packages are added to you ROS_PACKAGE_PATH variable
- Source env.sh in the orocos_toolchain stack
- Set the LUA_PATH variable:
if [ "x$LUA_PATH" == "x" ]; then LUA_PATH=";;"; fi
if [ "x$LUA_CPATH" == "x" ]; then LUA_CPATH=";;"; fi
export LUA_PATH="$LUA_PATH;`rospack find ocl`/lua/modules/?.lua"
export LUA_PATH="$LUA_PATH;`rospack find kdl`/?.lua"
export LUA_PATH="$LUA_PATH;`rospack find rFSM`/?.lua"
export LUA_PATH="$LUA_PATH;`rospack find rttlua_completion`/?.lua"
export LUA_PATH="$LUA_PATH;`rospack find kdl_lua`/lua/?.lua"
export LUA_CPATH="$LUA_CPATH;`rospack find rttlua_completion`/?.so"
export PATH="$PATH:`rosstack find orocos_toolchain`/install/bin"
Make
rosmake itasc_comanipulation_demo_app
Don't forget to...
- Run the convert_xacro.sh script in the itasc_pr2 package:
roscd itasc_pr2
./convert_xacro.sh
The example
The following figure shows the component layout of the comanipulation demo. (Click on it to get a pdf version.)
comanipulation layout An overview of all components involved can be found
here
Execution
- Open two terminals
- go in both to itasc_comanipulation_demo_app:
roscd itasc_comanipulation_demo_app
- (On a simulated PR2: open an extra terminal and start the PR2 in simulation
- run the PR2 low level controllers in the first (P controller with reduced gain):
./runControllers
- run the application in the second terminal:
./run.sh
- When your application has gone trough the configuration and starting phase, it will reach the running state: You should find a line on your screen saying "=>iTaSCFSM=>Running=>CompositeTaskFSM->Initialized State"
- To interact with the CompositeTaskFSM, you can send events to it: send events to interact (don't forget to go in and afterwards out!!!) eg.:
-
event_firer.itasc_common_events_in.write("e_parallelIn")
-
event_firer.itasc_common_events_in.write("e_parallelOut")
-
event_firer.itasc_common_events_in.write("e_obstacleForceParallelLimitsIn")
-
event_firer.itasc_common_events_in.write("e_obstacleForceParallelLimitsOut")
- more eventnames can be found in scripts/composite_task_fsm.lua => transitions
FAQ
Joint and segment mapping
A KDL::Tree has no order when asking it's segments (getSegments) which makes sense since there are branches on a tree. In practice, the getSegments returns the segments in alphabetical order, which is the default order you'll get the joint segments of the PR2 and the columns of the Jacobian matrices. The itasc_pr2 component maps the inputs and outputs from the robot side to this "general" order. For each chain between the base and the object frame you request from the component, the order is internally stored in the logical order from root to leave (a chain has an order of segments). Also in this case, the output towards the iTaSC side is mapped in the "general" order (the alphabetical order).
Compilation problems
- Q: When I compile itasc_solvers, I get a linking error, he can't find choleski_semidfinite...
- A: You probably forgot to source the env.sh in the orocos_toolchain stack