CMake error with custom messages
I created 2 custom messages in my package to publish data through one of my nodes. The .msg files are:
bearing_angles.msg
float left_edge
float right edge
bearArray.msg
bearArray[] bear_array
I changes my CMakeLists.txt of my package, so it looks like this:
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
message_generation
)
add_message_files(
FILES
Num.msg
bearing_angles.msg
bearArray.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES door_detector_1
CATKIN_DEPENDS roscpp rospy std_msgs message_runtime
# DEPENDS system_lib
)
But when I build my package from catkin_ws directory, with catkin_make, I get this error:
File "/opt/ros/melodic/lib/python2.7/dist-packages/genmsg/msg_loader.py", line 326, in load_msg_depends
load_msg_depends(msg_context, depspec, search_path)
File "/opt/ros/melodic/lib/python2.7/dist-packages/genmsg/msg_loader.py", line 315, in load_msg_depends
depspec = msg_context.get_registered(resolved_type)
File "/opt/ros/melodic/lib/python2.7/dist-packages/genmsg/msg_loader.py", line 439, in get_registered
if self.is_registered(full_msg_type):
File "/opt/ros/melodic/lib/python2.7/dist-packages/genmsg/msg_loader.py", line 428, in is_registered
package, base_type = package_resource_name(full_msg_type)
File "/opt/ros/melodic/lib/python2.7/dist-packages/genmsg/names.py", line 104, in package_resource_name
val = tuple(name.split(PRN_SEPARATOR))
RuntimeError: maximum recursion depth exceeded while calling a Python object
CMake Error at /opt/ros/melodic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
execute_process(/home/spyros/catkin_ws/build/catkin_generated/env_cached.sh
"/usr/bin/python2" "/usr/bin/empy" "--raw-errors" "-F"
"/home/spyros/catkin_ws/build/door_detector_1/cmake/door_detector_1-genmsg-context.py"
"-o"
"/home/spyros/catkin_ws/build/door_detector_1/cmake/door_detector_1-genmsg.cmake"
"/opt/ros/melodic/share/genmsg/cmake/pkg-genmsg.cmake.em") returned error
code 1
Call Stack (most recent call first):
/opt/ros/melodic/share/catkin/cmake/em_expand.cmake:25 (safe_execute_process)
/opt/ros/melodic/share/genmsg/cmake/genmsg-extras.cmake:303 (em_expand)
door_detector_1/CMakeLists.txt:74 (generate_messages)
-- Configuring incomplete, errors occurred!
See also "/home/spyros/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/spyros/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:768: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
I think I miss something in the CMakeLists.txt file, but I didn't find it so far. What am I missing here? Any feedback is appreciated.
I use Ubuntu 18, ROS melodic, and my node is written in python 2.7
UPDATE (CMake error): After @gvdhoorn answer
CMake Error at /home/spyros/catkin_ws/build/door_detector_1/cmake/door_detector_1-genmsg.cmake:3 (message):
Could not find messages which
'/home/spyros/catkin_ws/src/door_detector_1/msg/bearing_angles.msg' depends
on. Did you forget to specify generate_messages(DEPENDENCIES ...)?
Cannot locate message [float] in package [door_detector_1] with paths
[['/home/spyros/catkin_ws/src/door_detector_1/msg']]
Call Stack (most recent call first):
/opt/ros/melodic/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
door_detector_1/CMakeLists.txt:74 (generate_messages)
-- Configuring incomplete, errors occurred!
See also "/home/spyros/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/spyros/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:768: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed