fatal error: Geometry_msgs/Vector3Stamped.h directory not found
i tried to use this Github File: https://github.com/ros-drivers/um7.git i used git clone to download it, changed the CMakeLists.txt and tried the Command catkin_make. But it doesnt work i get the fatal Error back. I used already the geometry_msgs/Vector3 without problems but Vector3Stamped doesnt work... is there any Library to replace it ? or do anybody have a tip what i can Install to let it work ?
i use a Raspberry Pi4, Ubuntu 20.04 (focal) and Ros Noetic
i added the first the Error output, then the changes in the CMakeLists.txt and then the complete cpp File here :
Error if i let geometry_msgs/Vector3Stamped.h active :
/home/ubuntu/um7_driver/src/um7/src/main.cpp:37:10: fatal error: geometry_msgs/Vector3Stamped.h: No such file or directory 37 | #include "geometry_msgs/Vector3Stamped.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make[2]: * [CMakeFiles/um7_driver_2.dir/build.make:63: CMakeFiles/um7_driver_2.dir/um7/src/main.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:1097: CMakeFiles/um7_driver_2.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... [ 1%] Built target std_msgs_generate_messages_cpp [ 1%] Built target _actionlib_msgs_generate_messages_check_deps_GoalStatus [ 1%] Built target _rosserial_msgs_generate_messages_check_deps_TopicInfo make: * [Makefile:141: all] Error 2
Invoking "make -j4 -l4" failed
Error if i comment geometry_msgs/Vector3Stamped out:
/home/ubuntu/um7_driver/src/um7/src/main.cpp:38:10: fatal error: ros/ros.h: No such file or directory 38 | #include "ros/ros.h" | ^~~~~~~~~~~ compilation terminated. make[2]: * [CMakeFiles/um7_driver_2.dir/build.make:63: CMakeFiles/um7_driver_2.dir/um7/src/main.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:1097: CMakeFiles/um7_driver_2.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... [ 1%] Built target std_msgs_generate_messages_nodejs [ 1%] Built target _actionlib_msgs_generate_messages_check_deps_GoalID [ 1%] Built target _actionlib_msgs_generate_messages_check_deps_GoalStatusArray make: * [Makefile:141: all] Error 2 Invoking "make -j4 -l4" failed
Changes in CMakeLists.txt :
catkin_workspace()
include_directories( ${catkin_INCLUDE_DIRS})
add_executable( um7_driver_2 /home/ubuntu/um7_driver/src/um7/src/main.cpp ) target_link_libraries( um7_driver_2 ${catkin_LIBRARIES} )
the new CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.3) project(um7_test)
find_package(catkin REQUIRED COMPONENTS roscpp serial sensor_msgs message_generation)
add_service_files( FILES Reset.srv )
generate_messages()
catkin_package( INCLUDE_DIRS include CATKIN_DEPENDS message_runtime )
#
Build
#
Specify additional locations of header files
Your package locations should be listed before other locations
include_directories(include ${catkin_INCLUDE_DIRS} )
Declare a cpp executable
add_executable(um7_driver src/main.cpp src/registers.cpp src/comms.cpp) target_link_libraries(um7_driver ${catkin_LIBRARIES} ) add_dependencies(um7_driver um7_generate_messages_cpp)
#
Install
#
install(TARGETS um7_driver RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} )
#
Testing
#
if(CATKIN_ENABLE_TESTING) find_package(roslint REQUIRED) catkin_add_gtest(${PROJECT_NAME}_test_registers test/test_registers.cpp src/registers.cpp) catkin_add_gtest(${PROJECT_NAME}_test_comms test/test_comms.cpp src/comms.cpp src/registers.cpp) target_link_libraries(${PROJECT_NAME}_test_comms util ${catkin_LIBRARIES})
file(GLOB LINT_SRCS src/*.cpp include/um7/registers.h include/um7/comms.h) roslint_cpp(${LINT_SRCS}) roslint_add_test() endif()
include_directories( ${catkin_INCLUDE_DIRS})
add_executable( um7_driver_2 /home/ubuntu/um7_driver/src/um7/src/main.cpp ) target_link_libraries( um7_driver_2 ${catkin_LIBRARIES} )
Complete cpp File main.cpp:
/** * * \file * \brief Main entry point for UM7 driver. Handles serial connection * details, as well as all ROS message stuffing, parameters, * topics, etc. * \author Mike Purvis mpurvis@clearpathrobotics.com (original code for UM6) * \copyright Copyright (c) 2013, Clearpath Robotics, Inc. * \author Alex Brown rbirac@cox.net ...
Could you include the compilation log, and the changes that was made in the
CMakeLists.txt
?@Fxaxo: Some friendly advice: you need to pay more attention to the format of file names: the first letter of
geometry_msgs
is not capitialized, and the first letter ofVector3Stamped.h
is capitalized.@Fxaxo Please don't create an "answer" unless you are telling us what the solution to the title of this post is. Additional information like you posted below should be added as a comment (like this one.) Please delete that answer and instead put the new info into a comment.
The line in which you include ros.h is not valid c. Also, please show us the exact text of the error from
catkin_make
.oh okaz i understand ! okaz i postet the error output in the question. i already tried to install some sudo apt-get plug ins like ros-roscpp-msg to work with the ros library but it still not work... also with the geometry_msgs i installed already the ros-geometry-msgs
I suspect you are missing required lines in
CMakeLists.txt
. Have you provided lines with the necessaryroscpp
info? There are many, many examples ofCMakeLists.txt
for you to look at.hm i compared my CMakeLists to many others who using the lib ros/ros.h and i didnt found anything wrong ... i added the complete CMakeList like i have it in the question can u have a look on it and maybe see whats missing ?
Your
CMakeLists.txt
file does not look like any I have ever seen for a ROS1 package. You really need to find one from a package that actually compiles and use it as a reference for your own project.