ROS2 Interface

The ROS 2 Interface is part of the CoppeliaSim API framework. It duplicates the C++ ROS 2 API with a good fidelity. This makes it the ideal choice for very flexible communication via ROS2. You can recognize ROS2 Interface API functions from the simROS2- prefix.

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

CoppeliaSim can act as a ROS2 node that other nodes can communicate with via services, topics and actions.

The ROS2 Interface functionality in CoppeliaSim is enabled via a plugin: libsimROS2.*. The plugin can easily be adapted to your own needs. The plugin is loaded with:

#python simROS2 = require('simROS2') --lua simROS2 = require('simROS2')

Make sure to inspect CoppeliaSim's console window or terminal for details on plugin load operations.

Have a look at following simulation scenes/models for a quick start with the ROS Interface:

  • scenes/messaging/ros2InterfaceTopicPublisherAndSubscriber.ttt
  • scenes/messaging/controlTypeExamples/controlledViaRos2.ttt
  • models/tools/ros2Interface helper tool.ttm (model allowing to operate CoppeliaSim in stepping mode, e.g. in order to manually step the simulation)
  • Also have a look at the ROS2 tutorial and the external controller tutorial.