Uncommenting generate_messages(...) breaks import of (non-ROS) Python module
Yesterday I created the first custom message for my ROS package, and it broke a Python import that I was using:
from oars_gb.libraries.dynamixels.dynamixel_controller import DynamixelController
Yields:
Traceback (most recent call last):
File "/home/kyle/oars/catkin_ws/src/trans-atlantic-sailboat/oars_gb/nodes/acting/motor_controller.py", line 4, in <module>
from oars_gb.libraries.dynamixels.dynamixel_motor import DynamixelMotor
ImportError: No module named libraries.dynamixels.dynamixel_motor
To me, it seems as though it's finding the oars_gb
module (my ROS package), but not the submodules...
I traced it down to uncommenting generate_messages(...)
in CMakeLists.txt:
## UNCOMMENTING THIS (LIKE IT IS NOW) BREAKS THE IMPORT
generate_messages(
DEPENDENCIES
std_msgs
# geometry_msgs
# sensor_msgs
)
I can still import the module by running from oars_gb.libraries.dynamixels.dynamixel_motor import DynamixelMotor
in a Python interpreter (with PYTHONPATH
set accordingly, as it should be for ROS).
Also, I don't know if this helps to provide any clues, but commenting out generate_messages(...)
after I've broken it and rerunning catkin_make
isn't enough to fix the problem. I have to delete catkin_ws/devel
and then run catkin_make
again.
The full repo is available here.
Thanks!