RosPlugin

The RosPlugin is part of the V-REP API framework. Make sure not to mix up the RosPlugin with the RosInterface, which are two different ROS interfaces in V-REP. Unlike the RosInterface, the RosPlugin does not duplicate the C/C++ ROS API. Instead it represents a higher-level abstraction, and applies subscribed messages and emits topics automatically on/from scene objects. This can appear a little bit confusing, but allows in several cases to simplify the interaction with ROS. On the other hand, the RosPlugin is not very flexible, and does not directly support many standard ROS messages. For that reason, it often makes more sense to use the RosInterface instead of the RosPlugin. You can recognize RosPlugin API functions from the simExtROS_ prefix.

ROS is a distributed pseudo operating system allowing for easy management and communication between multiple computers connected in a network. Please refer to the official ROS documentation for details about ROS.

V-REP can act as a ROS node that other nodes can communicate with in following 3 ways:

  • The V-REP RosPlugin node offers ROS services. V-REP RosPlugin services are available as soon as V-REP is launched (given that roscore is running and the Rosplugin to V-REP was correctly loaded).
  • The V-REP RosPlugin can be enabled to advertise topics, and publish data to them. V-REP RosPlugin publishers can only be enabled and are only operational while a simulation is running. One exception to this is the info topic: data to that topic will be streamed as long as V-REP is running.
  • The V-REP RosPlugin can be enabled to subscribe to topics, read data from them, and apply the data to specific objects/items inside V-REP. V-REP RosPlugin subscribers can only be enabled and are only operational while a simulation is running.
  • The RosPlugin functionality in V-REP is enabled via a plugin: libv_repExtROS.so or libv_repExtROS.dylib. The code to the plugin is open source and is located in the programming/ros_packages folder. The plugin can easily be adapted to your own needs. The plugin is loaded when V-REP is launched, but the load operation will only be successful if roscore was running at that time. Make sure to inspect V-REP's console window or terminal for details on plugin load operations.

    Following diagram illustrates how ROS messages are handled on the server side (i.e. on the V-REP RosPlugin side):

    [ROS message handling, server side]


    Have a look at following simulation scenes for a quick start with the RosPlugin:

  • rosPluginTopicPublisherAndSubscriber1.ttt
  • rosPluginTopicPublisherAndSubscriber2.ttt
  • controlTypeExamples.ttt (focus on the dark red robot)
  • Also have a look at the ROS tutorial and the external controller tutorial.



    Recommended topics

  • RosPlugin API list
  • RosPlugin services
  • RosPlugin publishers
  • RosPlugin subscribers
  • ROS tutorial