Skip to content
meppe edited this page Oct 17, 2016 · 26 revisions

The ROS workspace to run ECG demos. This is basically a wrapper GIT repository to collect all required repositories as submodules for running the ECG workbench demos. All code is supposed to run under ROS indigo with Ubuntu 14.04 and ROS kinetic wth Ubuntu 16.04. Everything is tested with Python 2.7 only, Python 3.X will probably not work.

NOTE: This tutorial is geared towards a standalone network of repositories using git submodules, to allow easy integration of our language understanding system for ROS researchers. If you've already done the rest of the tutorials and have ecg_framework_code, etc. installed, you can add a symbolic link (Symlink) to your existing installation instead of using the git submodule in this standalone repository.

ECG System Requirements

The system has been tested on Linux Ubuntu 14.04 environments so far.

The following packages are required:

  • Python (versions 2.7 and up should work)

  • Pyre, a python port of Zyre: use

    pip install https://github.com/zeromq/pyre/archive/master.zip

  • Jython, python for the java platform: use

    sudo apt-get install jython

  • Six, a python package for python 2/3 compatibility: use

    sudo pip install six

  • Java

Installation and Dependencies

The installation notes are based on the following tutorial for DARwin-OP: http://www.generationrobots.com/en/content/83-carry-out-simulations-and-make-your-darwin-op-walk-with-gazebo-and-ros

Install ROS, as well as the prerequisites for the gazebo_darwin packages as follow:

For ROS indigo:

sudo apt-get install git ros-indigo-desktop-full ros-indigo-gazebo-plugins ros-indigo-gazebo-ros ros-indigo-gazebo-ros-control ros-indigo-hector-gazebo ros-indigo-hector-gazebo-plugins ros-indigo-effort-controllers ros-indigo-joint-state-controller ros-indigo-joint-state-publisher ros-indigo-turtlebot-teleop ros-indigo-catkin ros-indigo-pr2-* 

For ROS kinetic:

sudo apt-get install git ros-kinetic-desktop-full ros-kinetic-gazebo-plugins ros-kinetic-gazebo-ros ros-kinetic-gazebo-ros-control ros-kinetic-hector-gazebo ros-kinetic-hector-gazebo-plugins ros-kinetic-effort-controllers ros-kinetic-joint-state-controller ros-kinetic-joint-state-publisher ros-kinetic-turtlebot-teleop ros-kinetic-catkin ros-kinetic-pr2-* --fix-missing

Then clone this ROS git repository. Its root folder is a new catkin workspace, which we assume to be ~/ros_catkin_ecg_ws. You'll execute most other commands in these instructions from there.

git clone https://github.com/icsi-berkeley/ros_catkin_ecg_ws.git ~/ros_catkin_ecg_ws

Next, you need to initialize and update the submodules within this repository. The submodules contain the ROS code for the darwin robot and the ECG workbench. Cd into ~/ros_catkin_ecg_ws and do the following:

cd ~/ros_catkin_ecg_ws
git submodule update --init --recursive	

NOTE: If you've already installed the ecg_interface system elsewhere on your computer, you can just add a Symlink to this path.

Now you need to build the workspace. Do this by

cd ~/ros_catkin_ecg_ws
catkin_make
catkin_make install

Next you need to source come setup file. We recommend to do this automatically by doing that in your .bashrc.

echo "source ~/ros_catkin_ecg_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

Next we setup the ECG NLU system. Make sure you've installed all the packages listed here.

You also have to install a python module called ipaddress using pip:

sudo pip install ipaddress

Next, you have to set the PYTHON for the ECG framework code. Add the following to your .bashrc:

export PYTHONPATH=~/ros_catkin_ecg_ws/src/ros_ecgworkbench/src/ecg/ecg_interface/ecg_robot_code/src/main:~/ros_catkin_ecg_ws/src/ros_ecgworkbench/src/ecg/ecg_interface/ecg_framework_code/src/main:$PYTHONPATH

Source it again:

source ~/.bashrc

You can test if the transport installation worked by opening two terminals, and in the first do:

python ~/ros_catkin_ecg_ws/src/ros_ecgworkbench/src/ecg/ecg_interface/ecg_framework_code/src/tests/transport_test.py chat1 chat2

In the second do:

python ~/ros_catkin_ecg_ws/src/ros_ecgworkbench/src/ecg/ecg_interface/ecg_framework_code/src/tests/transport_test.py chat2 chat1

Now, if you enter text in one terminal, it should show up in the other terminal, too.

Starting Gazebo and Related Modules

Before starting gazebo the first time, I recommend downloading all 3d models for gazebo, since this speeds up the starting processes. To do so, execute the script (takes ~5 minutes, depending on your internet connection):

./download_gazebo_models.sh

You can now start gazebo, which should bring up an indoor environment that we use for our experiments:

roslaunch ros_cqi run_gazebo_darwin_kitchen.launch
roslaunch ros_cqi spawn_darwin.launch

Now press the "play" button at the lower left of the simulator window.

To have the robot walking, execute the test walking script that comes with darwin. I recommend to have a look at that script to see how the walking behaviour is executed. You can find it uner src/darwin_gazebo/src/.

rosrun darwin_gazebo walker_demo.py

Alternatively run the pickup pen scenario from the paper. To get started with our system, you'll want to start the CQI. Do so by entering:

rosrun ros_cqi run_interface.py

Take a look at all files under the folder src/ros_cqi to understand how it works.

Then start the NLU system. Do the following (unfortunately, you have to start the script from the scripts-folder, due to some path problems that we have not resolved so far...):

cd ros_catkin_ecg_ws/src/ros_ecgworkbench/scripts/
rosrun ros_ecgworkbench run_nlu.py 

See troubleshooting section below if you encounter an error with jython at this point. Now, enter the following in the text input console which should have come up, to move the robot to coordinates 1 1:

Robot1, move to location 1 1!

An error may show up in the window, but the robot will move. This is to be fixed in the future...

Troubleshooting

Gazebo

If there are problems with gazebo, especially the downloading of the world models, try the following before starting it:

export LC_NUMERIC=C

Jython

If you encounter an error later when running the ecg_workbench code, saying something like this:

"my" variable $jythonHome masks earlier declaration in same scope at /usr/bin/jython line 15

then you should install the standalone version of jython from jython.org, and then create a script in the same directory as the jar file called just "jython" with the following content:

#!/bin/bash

java -jar /path/to/jython-standalone.version.jar "$@"

Then chmod +x jython and add the directory to your path (e.g. export PATH=/usr/local/jython:$PATH). To disable the ubuntu-version of jython just uninstall it

sudo apt-get remove jython

3D modeling

Gazebo comes with its own sdf model database. However, we'll probably want to also have our own 3d models. Therefore we need to provide an additional model database. Details on how this can be done can be found here:

http://gazebosim.org/tutorials?tut=model_structure&cat=