Install v_repExtRosInterface - lavz-upiita/CoppeliaSim-V-REP- GitHub Wiki

The ROSInterface is part of the V-REP API framework that allows V-REP to act as a ROS node. The ROSInterface is enable via the plugin libv_repExtRosInterface.so.

This tutorial show how to compile the libv_repExtRosInterface.so plugin using ROS tools on Ubuntu based computers.

Note: the newer versions of V-REP have already a precompiled version of libv_repExtRosInterface.so, if this is the case, skip to the Test ROS Inteface section.

Before start

Before start check the next programs are installed

ROS

To install ROS follow these instructions according to your Ubuntu distribution. For better understanding of the ROS tools, it is recommendable to read the tutorials.

V-REP

  1. Download V-REP from this site.
  2. Move the file V-REP_PRO_XXXX_linux.tar.gz just downloaded to a convenient directory and unpack it.
  3. Enter the V-REP directory.
  4. Right-click the file vrep.sh, select the Propierties option.
  5. On the Permissions tab check "Allow executing file as program" and click the "close" button.
  6. Start the program by double click on vrep.sh file and hitting the "Run" option.
  7. Include the next line to the file ~/.bashrc:

VREP_ROOT=[VREP_DIR]

where [VREP_DIR] must be replaced by the V-REP directoy location.

Python 2.7 or superior

For the newest Ubuntu distributions python 2.7 is already installed, but it can be installed executing the next instructions on a terminal:

$ sudo apt-get update

$ sudo apt-get install python2.7

Other Packages

To compile the ROSInterface plugin, the next packages most be installed via terminal:

  • git
  • cmake
  • python tempita
  • python catkin tools
  • python lxml
  • default jre
  • xslt proc
  • ros-[distro]-brics-actuator

where [distro] is the installed ROS distribution. These packages can be installed by executing the next line on a terminal:

$ sudo apt-get install git cmake python-tempita python-catkin-tools python-lxml default-jre xsltproc ros-[distro]-brics-actuator

where [distro] must be replace by the ROS distribution name (ie: hidro,kinetic,lunar).

Aditional Notes

  1. For simplicity, the location ~/catkin_sw will be used as the ROS workspace directory location.
  2. It will be considered that the user has already create and configure the ROS environment.

Compile v_repExtRosInterface.so

  1. Enter the source directory on your ROS workspace

$ cd ~/catkin_ws/src

  1. Download ROSInterface source code

$ git clone --recursive https://github.com/CoppeliaRobotics/v_repExtRosInterface.git vrep_ros_interface

  1. Enter the vrep_ros_interface directory

$ cd vrep_ros_interface

and copy the external directory to the source directory

$ cp -fr external ..

  1. Enter the workspace root directory

$ cd ~/catkin_ws

and compile the ROS workspace

$ catkin_make

If compilation succeeded, the file libv_rep_ExtRosInterface.so must be created on ~/catkin_ws/devel/lib/

  1. Enter the lib/ directory

$ cd ~/catkin_ws/devel/lib

and copy libv_rep_ExtRosInterface.so to the V-Rep directory

$ cp libv_rep_ExtRosInterface.so $VREP_ROOT

Test ROS Interface

  1. On a terminal launch the ROS master node

$ roscore

  1. On a new terminal enter V-REP directory

$ cd $VREP_ROOT

and launch V-REP

$ ./vrep.sh

  1. On a third terminal check the Ros topic list

$ rostopic list

if the /tf topic appears, then the communication was successful.

Final notes

  1. For V-Rep and Ros can interact successfully, the ROS master node must be running before launching V-REP