Installing the R2 simulator for ROS Indigo

What is r2?

The r2 robot, which is an acronym for Robonaut 2, is a dexterous humanoid robot created by NASA, with the goal of it aiding humans in space (Robonaut 2 is just an upgrade from its predecessor, the Robonaut). The robot was created to ressemble as close as a human (with a head, hands, fingers, etc), it will be used to expand our ability for construction and discovery.

As the model and simulation files are open sourced NASA JSC Robotics with ROS support, we are able to try out the very robot that is used by the NASA team. (Thanks, NASA JSC Robotics!) Therefore, in this tutorial, we’ll be looking at how do we install the r2 simulator into your computer.

 

Installation

Though the installation guide was pretty well documented (at their Wiki here), the main wiki/guide assumes that one would setup the SSH keys required to clone their repository. Therefore, for this tutorial, the SSH section will be tweak (downloading repositories without the need of creating the SSH keys). (Make adjustments accordingly, as quoted by their wiki.)

For this guide, we would be using Ubuntu 14.04, with ROS Indigo (Desktop version) setup beforehand.

 

ROS Environment

Create a file named ~/.ros_clean with the following contents:

(Not really sure what this part is for, but I think it is used to reset the system parameters to installation default)

 

Gazebo

Gazebo will be used to simulate the physical world in a virtual environment. For the r2 robot, it is recommended to use it on Gazebo 5. (If you installed the ros-indigo-desktop-full version, it comes with Gazebo2, but we wouldn’t be using it for the r2 robot.)

To install Gazebo 5, run the following commands:

 

r2  Simulation

Gazebo will be used to simulate the physical world in a virtual environment. For the r2 robot, it is recommended to use it on Gazebo 5. (If you installed the ros-indigo-desktop-full version, it comes with Gazebo2, but we wouldn’t be using it for the r2 robot.)

 

Code Dependencies

A few things packages are required in order for the simulator to compile correctly.  Run the following commands:

 

Workspace

Create a r2_sim workspace in your ~/ directory, and the catkin_initialise the workspace.

 

Cloning the packages

Their repositories were once located in BitBucket, but they migrated their repositories to GitLab. One disadvantage of GitLab over Github is that you need to set up the SSH keys in order to git clone their repositories. (Though this method is more secure)

As the R2 simulation software checkout is configured to work with SSH keys, one would have to setup the SSH keys with GitLab in order to follow their installation guide. However, in this tutorial, we’ll be working around this requirement through a script that manually downloads the required packages.

[Update: I have uploaded the script into Github to simplify the process, so just git clone the repository here: https://github.com/1487quantum/ros-r2-pkg-cloner.git. Follow the instruction as mentioned in the README.]

Open your favourite text editor (gedit, nano, etc.) and paste the following code below. Save it as getPkg.sh in the . This bash script will automatically git clone the required packages into the r2_sim directory.

Open a new window in the text editor and paste the following code below. Save it as r2_url.txt. This file will serve as the url package list.

After that, change the permission of the script to executable and run the script. It would start downloading the packages.

 

Compiling the packages

Change directory to the r2_sim directory and compile the packages.

 

Troubleshooting

Can’t compile robot_instance package

robot_instance has a known dependency issue on develop. Please run the following command to fix:

Log4cpp not found

If you encounter this problem, it can be solved by installing the package mentioned in the error: ros-indigo-Log4cpp.

Setting up the environment

Create another file named ~/.r2_sim with the following:

And source the file each time you want to use the simulation:

Optionally, you can automatically configure the simulation environment every time you open a terminal by running the following:

This will source the ~/.r2_sim file every time you open a new terminal.

 

Running the demo

To test out whether everything is installed properly, run the following commands:

It’ll open up gazebo with the r2 upper body loaded. It would look something like this:

And here’s the rqt_graph:

To test whether the r2 is able to move, run the following 2 commands (it will send some predefined goal points for r2 to move).

 

Troubleshooting

There is no model loaded in Gazebo! What should I do?

For this problem, try restarting the computer. This might be because the packages installed earlier on might not been started,so restarting the computer will allow it to load the necessary packages.

 

References

Share this post:

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *