Ros2 Humble on Docker and CoppeliaSim 4.4.0

Typically: "How do I... ", "How can I... " questions
fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: Ros2 Humble on Docker and CoppeliaSim 4.4.0

Post by fferri »

formica wrote: 07 Feb 2023, 11:51 This is the output for 'ldd libsimExtROS2Interface.so.
Every lib seems to be satisfied:

Code: Select all

	linux-vdso.so.1 (0x00007ffef03ac000)
	libstd_srvs__rosidl_typesupport_cpp.so => /opt/ros/humble/lib/libstd_srvs__rosidl_typesupport_cpp.so (0x000014a7a7c0e000)
	libexample_interfaces__rosidl_typesupport_cpp.so => /opt/ros/humble/lib/libexample_interfaces__rosidl_typesupport_cpp.so (0x000014a7a7bfe000)
	libimage_transport.so => /opt/ros/humble/lib/x86_64-linux-gnu/libimage_transport.so (0x000014a7a7b27000)
	librclcpp.so => /opt/ros/humble/lib/librclcpp.so (0x000014a7a720d000)
	libsensor_msgs__rosidl_typesupport_cpp.so => /opt/ros/humble/lib/libsensor_msgs__rosidl_typesupport_cpp.so (0x000014a7a7b1a000)
	librcutils.so => /opt/ros/humble/lib/librcutils.so (0x000014a7a7b02000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x000014a7a7adc000)
	libtf2_ros.so => /opt/ros/humble/lib/libtf2_ros.so (0x000014a7a7a41000)
	libtf2_msgs__rosidl_typesupport_cpp.so => /opt/ros/humble/lib/libtf2_msgs__rosidl_typesupport_cpp.so (0x000014a7a7a39000)
	librclcpp_action.so => /opt/ros/humble/lib/librclcpp_action.so (0x000014a7a71ec000)
	librcl_action.so => /opt/ros/humble/lib/librcl_action.so (0x000014a7a71d9000)
	liblibstatistics_collector.so => /opt/ros/humble/lib/liblibstatistics_collector.so (0x000014a7a71d2000)
	librcl.so => /opt/ros/humble/lib/librcl.so (0x000014a7a7194000)
	libstatistics_msgs__rosidl_typesupport_cpp.so => /opt/ros/humble/lib/libstatistics_msgs__rosidl_typesupport_cpp.so (0x000014a7a718f000)
	libtracetools.so => /opt/ros/humble/lib/libtracetools.so (0x000014a7a718a000)
	libgeometry_msgs__rosidl_typesupport_cpp.so => /opt/ros/humble/lib/libgeometry_msgs__rosidl_typesupport_cpp.so (0x000014a7a717f000)
	libstd_msgs__rosidl_typesupport_cpp.so => /opt/ros/humble/lib/libstd_msgs__rosidl_typesupport_cpp.so (0x000014a7a7172000)
	libbuiltin_interfaces__rosidl_typesupport_cpp.so => /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_typesupport_cpp.so (0x000014a7a716d000)
	libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x000014a7a6f43000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x000014a7a6f23000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x000014a7a6cfb000)
	/lib64/ld-linux-x86-64.so.2 (0x000014a7a7c16000)
	librosidl_typesupport_cpp.so => /opt/ros/humble/lib/librosidl_typesupport_cpp.so (0x000014a7a6cf5000)
	libaction_msgs__rosidl_typesupport_cpp.so => /opt/ros/humble/lib/libaction_msgs__rosidl_typesupport_cpp.so (0x000014a7a6ced000)
	libmessage_filters.so => /opt/ros/humble/lib/libmessage_filters.so (0x000014a7a6ce8000)
	librmw.so => /opt/ros/humble/lib/librmw.so (0x000014a7a6cdc000)
	libament_index_cpp.so => /opt/ros/humble/lib/libament_index_cpp.so (0x000014a7a6cd1000)
	libclass_loader.so => /opt/ros/humble/lib/libclass_loader.so (0x000014a7a6cbe000)
	librcpputils.so => /opt/ros/humble/lib/librcpputils.so (0x000014a7a6cb0000)
	libconsole_bridge.so.1.0 => /lib/x86_64-linux-gnu/libconsole_bridge.so.1.0 (0x000014a7a6ca8000)
	libtinyxml2.so.9 => /lib/x86_64-linux-gnu/libtinyxml2.so.9 (0x000014a7a6c90000)
	librcl_interfaces__rosidl_typesupport_cpp.so => /opt/ros/humble/lib/librcl_interfaces__rosidl_typesupport_cpp.so (0x000014a7a6c85000)
	librcl_yaml_param_parser.so => /opt/ros/humble/lib/librcl_yaml_param_parser.so (0x000014a7a6c79000)
	librosgraph_msgs__rosidl_typesupport_cpp.so => /opt/ros/humble/lib/librosgraph_msgs__rosidl_typesupport_cpp.so (0x000014a7a6c74000)
	librmw_implementation.so => /opt/ros/humble/lib/librmw_implementation.so (0x000014a7a6c65000)
	librcl_logging_interface.so => /opt/ros/humble/lib/librcl_logging_interface.so (0x000014a7a6c60000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x000014a7a6b79000)
	libtf2.so => /opt/ros/humble/lib/libtf2.so (0x000014a7a6b5a000)
	librcl_logging_spdlog.so => /opt/ros/humble/lib/librcl_logging_spdlog.so (0x000014a7a6b53000)
	librcl_interfaces__rosidl_typesupport_c.so => /opt/ros/humble/lib/librcl_interfaces__rosidl_typesupport_c.so (0x000014a7a6b48000)
	librcl_interfaces__rosidl_generator_c.so => /opt/ros/humble/lib/librcl_interfaces__rosidl_generator_c.so (0x000014a7a6b2c000)
	librosidl_runtime_c.so => /opt/ros/humble/lib/librosidl_runtime_c.so (0x000014a7a6b21000)
	libyaml.so => /opt/ros/humble/lib/libyaml.so (0x000014a7a6aff000)
	libspdlog.so.1 => /lib/x86_64-linux-gnu/libspdlog.so.1 (0x000014a7a6a82000)
	librosidl_typesupport_c.so => /opt/ros/humble/lib/librosidl_typesupport_c.so (0x000014a7a6a7c000)
	libbuiltin_interfaces__rosidl_generator_c.so => /opt/ros/humble/lib/libbuiltin_interfaces__rosidl_generator_c.so (0x000014a7a6a77000)
	libfmt.so.8 => /lib/x86_64-linux-gnu/libfmt.so.8 (0x000014a7a6a56000)

Do you launch coppeliaSim in the same shell where running libLoadErrorCheck.sh succeeds?

maf
Posts: 16
Joined: 16 Jan 2023, 16:34

Re: Ros2 Humble on Docker and CoppeliaSim 4.4.0

Post by maf »

Hi, I have a very similar issue.
Running a docker image with ROS, with Coppeliasim 4.4.0 inside the image itself.

Using a docker image with ROS2 Foxy has no problems, Coppeliasim starts and loads the ROS2 plugin.

The same does not work with ROS2 Humble, the ROS2 plugin cannot be loaded.

Code: Select all

error: library ( /root/ws/coppeliasim/libsimExtROS2.so ) load: "Cannot load library /root/ws/coppeliasim/libsimExtROS2.so: (/root/ws/coppeliasim/libsimExtROS2.so: undefined symbol: _ZN13rclcpp_action10ClientBase15add_to_wait_setEP14rcl_wait_set_t)"
[CoppeliaSim:error]   plugin 'ROS2': load failed (could not load). The plugin probably couldn't load dependency libraries. For additional infos, modify the script 'libLoadErrorCheck.sh', run it and inspect the output.
So, it is about an undefined symbol in the rclcpp_action library. Looks like they changed the API from Foxy to Humble.
Also for me all the libraries references (output of ldd) seem fine.

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: Ros2 Humble on Docker and CoppeliaSim 4.4.0

Post by fferri »

maf wrote: 07 Feb 2023, 14:56 Using a docker image with ROS2 Foxy has no problems, Coppeliasim starts and loads the ROS2 plugin.

The same does not work with ROS2 Humble, the ROS2 plugin cannot be loaded.
Looks like an ABI problem, then you should recompile the ROS2 plugin.

maf
Posts: 16
Joined: 16 Jan 2023, 16:34

Re: Ros2 Humble on Docker and CoppeliaSim 4.4.0

Post by maf »

Looks like an ABI problem, then you should recompile the ROS2 plugin.
Hi, not sure it was an ABI problem, but recompiling the simExtROS2 plugin solved the issue. Thank you.

For others' reference: before attempting compilation of the plugin, make sure you check-out the tag that corresponds to your version of Coppeliasim (coppeliasim-v4.4.0-revX, in the context of this forum thread)

formica
Posts: 60
Joined: 13 Mar 2013, 12:13

Re: Ros2 Humble on Docker and CoppeliaSim 4.4.0

Post by formica »

The procedure to compile the plugin is not so clear at the first point (compilation of libplugin).
Can you please give me an hint?

maf
Posts: 16
Joined: 16 Jan 2023, 16:34

Re: Ros2 Humble on Docker and CoppeliaSim 4.4.0

Post by maf »

Hi, this is more or less what I did (from the readme files, error messages, and my intuition):

- make sure to checkout the tag 4.4.0 of simExtROS2
- make sure to source the ROS shell initialization script
- rename the root of the plugin to sim_ros2_interface (see readme)
- export CoppeliaSim_DIR=<your path>
- apt install xsltproc
- pip install xmlschema
- colcon build

After building, replace the simExtROS2.so library file in the coppeliasim root, with the one created in the build folder of the plugin. I suggest you make a sym link, and also backup the original .so file

formica
Posts: 60
Joined: 13 Mar 2013, 12:13

Re: Ros2 Humble on Docker and CoppeliaSim 4.4.0

Post by formica »

Thank you maf.
Recompiling the plugin was the solution.

Regards

Post Reply