open-rmf / rmf

Root repository for the RMF software
Apache License 2.0
223 stars 57 forks source link

rosidl_typesupport_c errors when building main branch from source #409

Closed MankaranSingh closed 6 months ago

MankaranSingh commented 6 months ago

Before proceeding, is there an existing issue or discussion for this?

Description

I am on ubuntu 22.04 using ros2 humble. Initially I installed binary version of open rmf but saw that easy_fleet is only available in main branch so i decided to build from source. I uninstalled the binaries and building rmf is successful without errors but when launching any demos i get:

[fleet_adapter-16]     return importlib.import_module(module_name, package=pkg_name)
[fleet_adapter-16]   File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
[fleet_adapter-16]     return _bootstrap._gcd_import(name[level:], package, level)
[fleet_adapter-16]   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
[fleet_adapter-16]   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
[fleet_adapter-16]   File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
[fleet_adapter-16] ModuleNotFoundError: No module named 'rmf_fleet_msgs.rmf_fleet_msgs_s__rosidl_typesupport_c'
[building_map_server-3] Traceback (most recent call last):
[building_map_server-3]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_generator_py/import_type_support_impl.py", line 46, in import_type_support
[building_map_server-3]     return importlib.import_module(module_name, package=pkg_name)
[building_map_server-3]   File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
[building_map_server-3]     return _bootstrap._gcd_import(name[level:], package, level)
[building_map_server-3]   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
[building_map_server-3]   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
[building_map_server-3]   File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
[building_map_server-3] ModuleNotFoundError: No module named 'rmf_building_map_msgs.rmf_building_map_msgs_s__rosidl_typesupport_c'
mxgrey commented 6 months ago

Are you running

$ source install/setup.bash

in your colcon workspace, like the demo here, before you run your fleet adapter? If the colcon workspace isn't sourced then the linker won't be able to find those libraries.

If that's not the problem then I think it's likely that you don't have a clean build. My best guess is that you have some cmake caches that are linking against compiled RMF message libraries that were in /opt/ros/humble/lib but which were removed when you uninstalled the RMF binaries.

I recommend running $ rm -rf build install in your colcon workspace directory and then rerunning the colcon build command.

MankaranSingh commented 6 months ago

I totally uninstalled everything and retried with ros2 iron. Still no luck. But it's definitely some issue with my system because otherwise everything looks fine on another system which has fresh ubuntu Installed.

Not sure why it's behaving like that.

MankaranSingh commented 6 months ago

Found the issue. I inspected the generated .so files for msgs package and strangely they had python-36m in their name while my default python version is 3.10. I uninstalled python 3.6 and everything seems to work now.