Interacting with V-REP using ROS topics

We will now discuss how to use topics to communicate with V-REP. This is useful when we want to send information to the objects of the simulation, or retrieve data generated by robots. While services are enabled when V-REP starts, topic communication happens only on demand, initializing publisher and subscriber variables in the simulation scene.

The most common way to program the simulation scene of V-REP is via Lua scripts. Every object of the scene can be associated to a script that is automatically invoked when a simulation starts and is cyclically executed during the simulation time.

In the next example, we will create a scene with two objects. One will be programmed to receive a float data from ...

Get Mastering ROS for Robotics Programming - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.