Skip to content

RosInterface Setup

Akhil John edited this page Oct 31, 2017 · 36 revisions

The following tutorial walks you through the manual installation of RosInterface for ROS Kinetic.

1. Install the required softwares:

ROS kinetic:

Follow the instruction on ROS Kinetic to properly install the desktop-full version of ROS kinetic.

V-REP

Download V-REP PRO EDU from http://www.coppeliarobotics.com/downloads.html and then do

$ cd ~
$ tar zvxf ~/Downloads/V-REP_PRO_EDU*.tar.gz

# set the VREP_ROOT variable in ~/.bashrc:
$ echo 'export VREP_ROOT="$HOME/V-REP_PRO_EDU_V3_4_0_Linux"' >> ~/.bashrc
$ source ~/.bashrc

Some required Ubuntu packages:

$ sudo apt install git cmake python-tempita python-catkin-tools python-lxml default-jre xsltproc

Saxon(only if you aren't using V-REP version 3.4.0 or later):

$ cd ~/Downloads
$ wget http://downloads.sourceforge.net/project/saxon/Saxon-HE/9.7/SaxonHE9-7-0-8J.zip
$ cd ~
$ mkdir -p saxon/bin
$ cd saxon
$ unzip ~/Downloads/SaxonHE9-7-0-8J.zip
$ echo -e '#!/bin/sh\njava -jar "`dirname "$0"`/../saxon9he.jar" "$@"' > bin/saxon
$ chmod a+x bin/saxon

# update PATH env var with the location of saxon executable:
$ echo 'export PATH="$PATH:$HOME/saxon/bin"' >> ~/.bashrc
$ source ~/.bashrc

2. Create a catkin workspace and initialize it:

$ mkdir -p ~/vrep_ws/src
$ cd ~/vrep_ws
$ catkin init

3. Copy the required plugins

  • From the programming/ros_packages folder copy all the folders to vrep_ws/src.
  • Rename the v_repExtRosInterface folder to vrep_ros_interface.

4. Install v_repStubsGen:

$ cd ~/vrep_ws/src/vrep_ros_interface
$ mkdir external
$ cd external
$ git clone --recursive https://github.com/fferri/v_repStubsGen.git
$ export PYTHONPATH=$PYTHONPATH:$PWD

5. Add ROS messages

Edit meta/messages.txt and meta/services.txt if you need to include more ROS messages/services. You need to specify the full message/service type, i.e. geometry_msgs/Twist rather than Twist.

6. Compile

$ cd ~/vrep_ws
$ catkin build
$ source devel/setup.bash

If there are any warnings like:

CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message): catkin_package() DEPENDS on 'nav_msgs' but neither 'nav_msgs_INCLUDE_DIRS' nor 'nav_msgs_LIBRARIES' is defined. Call Stack (most recent call first): /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package) CMakeLists.txt:12 (catkin_package)

Make sure you have those packages installed. If they are already installed then add those package names to the find package list in CMakeList.txt of vrep_ros_interface folder and also add them to the package.xml file. Before you rebuild the workspace clean it using:

$ catkin clean

7. Copy library in your V-REP installation folder

$ cp -iv devel/lib/libv_repExtRosInterface.so "$VREP_ROOT/"

8. Open a new terminal and launch roscore:

$ roscore

9. Open another terminal and launch V-REP

$ cd $VREP_ROOT
$ ./vrep.sh

Check if the RosInterface gets loaded successfully.