Robotics StackExchange | Archived questions

Cannot import module control_msgs

Hi everyone,

I am currently using ROS Crystal from source. I have a second workspace where i have included the control_msgs package for bouncy. LINK.

The problem in that after successfully building the package and sourcing the corresponding install/setup.bash file, I still cannot import that particular module in python.

The error is the typical ImportError: No module named control_msgs.

Any advide? Thanks

UPDATE

Trying to fix this myself at: https://github.com/nzlz/control_msgs/tree/crystal-devel

Error:

nestor@n-pc:~/ros2_mara_ws$ colcon build --merge-install --packages-select control_msgs
Starting >>> control_msgs
--- stderr: control_msgs                         
CMake Error at /home/nestor/ros2_ws/install/rosidl_adapter/share/rosidl_adapter/cmake/rosidl_adapt_interfaces.cmake:60 (message):
  execute_process(/usr/bin/python3 -m rosidl_adapter --package-name
  control_msgs --arguments-file
  /home/nestor/ros2_mara_ws/build/control_msgs/rosidl_adapter__arguments__control_msgs.json
  --output-dir
  /home/nestor/ros2_mara_ws/build/control_msgs/rosidl_adapter/control_msgs
  --output-file
  /home/nestor/ros2_mara_ws/build/control_msgs/rosidl_adapter/control_msgs.idls)
  returned error code 1:

  KeyError processing template 'struct.idl.em': 'duration'

Call Stack (most recent call first):
  /home/nestor/ros2_ws/install/rosidl_cmake/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:126 (rosidl_adapt_interfaces)
  CMakeLists.txt:39 (rosidl_generate_interfaces)


make: *** [cmake_check_build_system] Error 1
---
Failed   <<< control_msgs   [ Exited with code 2 ]

Summary: 0 packages finished [1.49s]
  1 package failed: control_msgs
  1 package had stderr output: control_msgs

Asked by nzlz on 2018-12-13 12:12:24 UTC

Comments

What python version are you using?

Asked by allenh1 on 2018-12-13 14:22:01 UTC

not working with any, 2 or 3.

Asked by nzlz on 2018-12-13 14:25:43 UTC

What does python --version say?

Asked by allenh1 on 2018-12-13 14:29:00 UTC

2.7 and 3.6.7. But this must be an issue related to he control_msgs repo as @dirk-thomas has pointed.

Asked by nzlz on 2018-12-13 14:51:14 UTC

Were you able to compile https://github.com/nzlz/control_msgs? I had to add unique_identifier_msgs as a dependency.

Asked by ipa-hsd on 2019-02-22 10:31:01 UTC

Answers

Looking at the CMakeLists.txt file of the package I don't think it is functional at the moment. While it enumerates several interface files (https://github.com/ros-controls/control_msgs/blob/d6e9ea87b3fdbb3449e8c63d70c51fbb939680fe/control_msgs/CMakeLists.txt#L24-L43) it doesn't call rosidl_generate_interfaces anywhere. You might want to fill a ticket upstream about the problem.

Asked by Dirk Thomas on 2018-12-13 14:31:17 UTC

Comments

Okay, thanks!

Asked by nzlz on 2018-12-13 14:38:28 UTC

Hello Dirk,

I submitted the issue but I got no answer. Since I have an old repo that I manage to build successfully, I am just trying to migrate the control_msgs myself. Could you please take a look at the updated post?

Thanks in advance,

Asked by nzlz on 2018-12-14 06:49:23 UTC

I have now added an issue to track this: https://github.com/ros-controls/control_msgs/issues/25

Asked by Mathias Lüdtke on 2018-12-14 10:35:24 UTC