ROS2 Bouncy error: no module named rosidl_generator_c
Hello everyone, I am using Ubuntu 18.04 and trying to build ROS2 Bouncy.
The thing is, first I had problems building rosidlgeneratorpy 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/__init__.py", 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/__init__.py", 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.
Asked by nickcage on 2019-07-02 11:44:46 UTC
Comments
Help, anyone?
Asked by nickcage on 2019-07-08 04:11:49 UTC
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.
Asked by gvdhoorn on 2019-07-08 04:13:30 UTC
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?
Asked by nickcage on 2019-07-08 04:40:41 UTC
No, that would most likely require Bouncy on all participants.
But I would still use the binary packages on Bionic if possible.
Asked by gvdhoorn on 2019-07-08 04:41:25 UTC
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?
Asked by nickcage on 2019-07-08 04:46:23 UTC
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).
Asked by gvdhoorn on 2019-07-08 04:57:20 UTC
I have my custom nodes, I don't intend to change anything base ROS packages.
Asked by nickcage on 2019-07-08 05:35:17 UTC
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.Asked by gvdhoorn on 2019-07-08 05:37:21 UTC
This thing with ARM is a limitation on our client's side so we cannot question it. As for the PC side, I did as you said and it built fine. Thank you for your help.
Asked by nickcage on 2019-07-08 05:47:09 UTC
re: ARM: I think you misunderstood me. I meant to say that if your ARM system uses a slightly different version of Bouncy than
apt
installs, you would need to build Bouncy from source on your PC.Asked by gvdhoorn on 2019-07-08 06:28:36 UTC
Yeah, as you suggested I tried and the example worked. Thank you very much.
Asked by nickcage on 2019-07-10 14:07:35 UTC
Closing as
not relevant
any more as the original problem was not solved, but was also no longer a problem as building from source wasn't necessary in the first place.Asked by gvdhoorn on 2019-07-10 14:09:44 UTC