1. Installation
You can install the grasping pipeline in two ways:
Using the grasping pipeline docker image
Manually installing the grasping pipeline and all its dependencies
1.1. Using the grasping pipeline docker image
This is the easiest way to get started with the grasping pipeline, but comes with the drawback that it does not run natively on the host. This especially means that you are more likely to experience issues regarding the network setup with ROS.
The instructions can be found in the HSRB_ROS_Docker_Image repository.
Note
After installation you might want to add the following alias to your .bashrc file to make it easier to start the docker container:
$ echo "alias hsr='cd ~/HSR/ && bash ./RUN-DOCKER-CONTAINER.bash'" >> ~/.bashrc
This allows you to start the docker container by simply typing hsr in the terminal.
After adding the alias, source the new .bashrc file:
$ source ~/.bashrc
1.2. Manually installing the grasping pipeline and all its dependencies
This option assumes that you already have installed:
ROS noetic and the most common ROS packages (ros-noetic-desktop-full)
The toyota HSR packages (ros-noetic-tmc-desktop-full)
moveit (ros-noetic-moveit)
vision-msgs (ros-noetic-vision-msgs)
tf2-sensor-msgs (ros-noetic-tf2-sensor-msgs)
ros-numpy (ros-noetic-ros-numpy)
If you have not installed these packages yet, please refer to the commands in the Dockerfile of the HSRB_ROS_Docker_Image repository (Link) on how to install ROS, the toyota HSR packages and moveit. If possible, use the versions specified in the Dockerfile.
Warning
You will need access to the private v4r github repositories, because some of the repositories include confidential data from toyota. This means that you have to setup your github ssh-key (Link for instructions)
1.2.1. Creating a catkin workspace
We recommend to create a new catkin workspace for the grasping pipeline. You can do so with the following commands:
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws
$ catkin build
1.2.2. Cloning all grasping pipeline repositories
After installing the ROS dependencies and setting up the ssh key, you can finally clone all necessary grasping pipeline repositories into your catkin workspace:
$ cd ~/catkin_ws/src
$ curl -s https://raw.githubusercontent.com/v4r-tuwien/grasping_pipeline/main/scripts/clone_grasping_pipeline.bash | bash
1.2.3. Installing the python dependencies
The grasping pipeline is written in python3 and uses several python packages. The dependenciesare listed in the requirements.txt file.
Note
If you want to install the dependencies in a virtual environment, you have to modify the launch files found in ./grasping_pipeline/launch:
<arg name="venv" value="/path/to/venv/bin/python3" />
<node> pkg="pkg" type="node.py" name="node" launch-prefix = "$(arg venv)" />
To install the dependencies (either in the virtual environment or system-wide):
$ cd ~/catkin_ws/src/grasping_pipeline
$ pip install -r requirements.txt
Note
If you encounter an error while installing the dependencies, you might need to update your pip version:
$ pip install --upgrade pip==22.3.1 --user
This installs the new pip version in the `~/.local/bin` directory. Make sure to add this directory to your PATH variable in your .bashrc file:
$ echo "export PATH=$PATH:/home/INSERT_USERNAME/.local/bin" >> ~/.bashrc
Afterwards, source the .bashrc file:
$ source ~/.bashrc
1.2.4. Helpful aliases
It is recommended to add the following aliases to your .bashrc file to make it easier to use the grasping pipeline. The aliases make it possible to start the grasping pipeline and rviz by simply typing gp and rv in the terminal.
1.2.4.1. Add an alias for starting the grasping pipeline:
$ echo "alias gp='bash ~/catkin_ws/src/grasping_pipeline/src/pipeline_bringup.sh'" >> ~/.bashrc
This allows you to start the grasping pipeline by simply typing gp in the terminal.
1.2.4.2. Add alias for starting rviz with a configuration file customized for the grasping pipeline
$ echo "alias rv='rviz -d ~/catkin_ws/src/grasping_pipeline/config/grasping_pipeline.rviz'" >> ~/.bashrc
This allows you to start rviz with the grasping pipeline configuration by simply typing rv in the terminal.
1.2.5. Building the ROS workspace
After adding the aliases, source the new .bashrc file:
$ source ~/.bashrc
Finally, build the workspace:
$ cd ~/catkin_ws
$ catkin build
If you encounter an error while building because some packages are missing, please look at the error messages and try to install the missing packages using apt-get or pip and notify one of the roadies of this issue.
After building the workspace, you can source the setup.bash file:
$ cd ~/catkin_ws
$ source devel/setup.bash