There are several ROS interfaces available for CoppeliaSim. Each one offers a specific behaviour, feature, or a way to operate:
The ROS Interface: the ROS Interface duplicates the C++ ROS API with a good fidelity. This makes it the ideal choice for very flexible communication via ROS, but might require a little bit more insight on the various messages and the way ROS operates.
The ROS 2 Interface: the ROS 2 Interface duplicates the C++ ROS 2 API with a good fidelity. This makes it the ideal choice for very flexible communication via ROS 2, but might require a little bit more insight on the various messages and the way ROS 2 operates.
ROS interfaces developed by others: those are not directly supported by us. For instance, the CoppeliaSim ROS bridge.
All ROS interfaces can normally operate side-by-side, but we highly recommend you to first try your hands on the ROS Interface, since this is the most flexible and natural approach. The packages to the first two above listed ROS interfaces are located here and here. Use the catkin tools to build those packages, otherwise you might run into difficulties.
As an example, a vision sensor ROS2 publisher could look like:
-- Enable an image publisher:
-- Publish the image of the vision sensor:
The subscriber on the other hand could look like:
-- Enable an image subscriber:
sub=simROS2.createSubscription('/image', 'sensor_msgs/msg/Image', 'image_callback')
-- Here we have received an image
Also have a look at the ROS tutorial and the external controller tutorial.