Image Credit: Scottish Enterprise / Rob McDougall
V-REP allows the use of ROS through a dedicated interface,
is part of the V-REP API framework.
By duplicating the C/C++ ROS API, V-REP can act as a ROS node and enables
communication via ROS topics.
In order to do this, the interface has to be installed.
To install the interface, please follow Coppellia’s
RosInterface installation instructions
Before compiling the interface, you have to tell V-REP that you will be using
custom messages. This is relatively easy to do and can be done by adding the
desired messages to the
messages.txt file located in the
meta folder of your
RosInterface folder, prior to compiling the interface.
In our case:
marty_msgs/ServoMsg marty_msgs/ServoMsgArray marty_msgs/Accelerometer
Entering Simulation Mode
Now that the interface has been installed, the
ros_marty package has to be
set to simulation mode. Two files have to be edited:
config.cfg first. This file is located within
thankfully, the change to be made is simple. Set the
false variable to
simulated: false # Whether Marty is being simulated
Next, let’s edit
marty.launch. This file is located in the
launch folder of
ros_marty package. Again, the change is relatively simple, set the
<param name="use_sim_time" value="false"/> <!-- Enable if Simulated -->
Now, instead of using a “real-time” clock, it will use the simulator’s timing system. This is important as V-REP can be sped up or slowed down.