ROS2 Bouncy error: no module named rosidl_generator_c [closed]

asked 2019-07-02 11:44:46 -0500

nickcage gravatar image

Hello everyone, I am using Ubuntu 18.04 and trying to build ROS2 Bouncy.

The thing is, first I had problems building rosidl_generator_py which could not link to libpython3.6m.a because it was not built with -fPIC. That was a little odd so I tried installing Python 3.6 manually from source using ./configure --enable-shared. However, new library did not show up. Then I messed around with update-alternatives (I have not touched any Python symbolic links since I know it could brick my system). Tried building again and now I'm getting this error:

Starting >>> rosidl_generator_c
Starting >>> rosidl_generator_dds_idl
--- stderr: rosidl_generator_c                                                                                                                
Traceback (most recent call last):
File "/home/rtrk/ros2_ws/src/ros2/rosidl/rosidl_generator_c/bin/rosidl_generator_c", line 8, in <module>
from rosidl_generator_c import generate_c
ModuleNotFoundError: No module named 'rosidl_generator_c'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/home/rtrk/ros2_ws/src/ros2/rosidl/rosidl_generator_c/bin/rosidl_generator_c", line 20, in <module>
rosidl_generator_c = loader.load_module()
 File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
 File "<frozen importlib._bootstrap_external>", line 823, in load_module
 File "<frozen importlib._bootstrap_external>", line 682, in load_module
 File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
 File "<frozen importlib._bootstrap>", line 684, in _load
 File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
 File "<frozen importlib._bootstrap_external>", line 678, in exec_module
 File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
 File "/home/rtrk/ros2_ws/src/ros2/rosidl/rosidl_generator_c/rosidl_generator_c/", line 17, in <module>
 from rosidl_cmake import convert_camel_case_to_lower_case_underscore
File "/home/rtrk/ros2_ws/install/rosidl_cmake/lib/python3.6/site-packages/rosidl_cmake/", line 21, in <module>
import em
ModuleNotFoundError: No module named 'em'
make[2]: *** [rosidl_generator_c/rosidl_generator_c/msg/bool.h] Error 1
make[1]: *** [CMakeFiles/rosidl_generator_c_interfaces__rosidl_generator_c.dir/all] Error 2
make: *** [all] Error 2
Failed   <<< rosidl_generator_c [ Exited with code 2 ]
Aborted  <<< rosidl_generator_dds_idl
--- stderr: rcutils                                           
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'em'
make[2]: *** [include/rcutils/logging_macros.h] Error 1
make[1]: *** [CMakeFiles/rcutils.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2
Aborted  <<< rcutils

I hope someone can help me with this issue and I will provide some more relevant info if needed.

Thank you in advance.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by gvdhoorn
close date 2019-07-10 14:09:12.420215


Help, anyone?

nickcage gravatar imagenickcage ( 2019-07-08 04:11:49 -0500 )edit

Seeing as Bouncy is a nr of releases and patch releases old: why are you trying to build Bouncy? 18.04 has binary packages available and Dashing is the current release.

gvdhoorn gravatar imagegvdhoorn ( 2019-07-08 04:13:30 -0500 )edit

Are ros2 versions compatible? I need to run publisher and subscriber on two systems but one of them is an ARM that has to use Bouncy, it's just the way it is right now. So can I install Crystal on PC and leave the Bouncy on the ARM?

nickcage gravatar imagenickcage ( 2019-07-08 04:40:41 -0500 )edit

No, that would most likely require Bouncy on all participants.

But I would still use the binary packages on Bionic if possible.

gvdhoorn gravatar imagegvdhoorn ( 2019-07-08 04:41:25 -0500 )edit

Oh, so you think I could install the Bouncy on 18.04. from binary? But is adding code easy, what needs to be done afterwards?

nickcage gravatar imagenickcage ( 2019-07-08 04:46:23 -0500 )edit

But is adding code easy, what needs to be done afterwards?

unless you can explain what you mean by this, I cannot answer it.

The normal workflow would be to create your own packages, that you compile against the installed ROS version.

Editing base ROS packages is rarely done (but is supported).

gvdhoorn gravatar imagegvdhoorn ( 2019-07-08 04:57:20 -0500 )edit

I have my custom nodes, I don't intend to change anything base ROS packages.

nickcage gravatar imagenickcage ( 2019-07-08 05:35:17 -0500 )edit

Then I would suggest to use the normal workflow and create a colcon workspace, place your packages in there and then build them.

I don't really understand why you'd want to build everything from source if it's not needed.

If your ARM board is using a slightly different version of Bouncy that isn't the version currently installable using apt, you may need to build things from source, but I would suggest to not jump to conclusions and first try.

gvdhoorn gravatar imagegvdhoorn ( 2019-07-08 05:37:21 -0500 )edit