Catkin_make error

hello I can’t fix the error of catkin_make. I am doing rosject of “ROS basics in 5 days” and when I do the catkin_make I get the following error:

“”"CMake Error at /home/user/catkin_ws/build/turtlebot3_move/cmake/turtlebot3_move-genmsg.cmake:3 (message):
Could not find messages which
‘/home/user/catkin_ws/devel/share/turtlebot3_move/msg/OdomRecordMsgAction.msg’
depends on. Did you forget to specify generate_messages(DEPENDENCIES …)?

Cannot locate message [Point] in package [turtlebot3_move] with paths
[[’/home/user/catkin_ws/devel/share/turtlebot3_move/msg’]]
Call Stack (most recent call first):
/opt/ros/noetic/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
turtlebot3_move/CMakeLists.txt:30 (generate_messages)

– Configuring incomplete, errors occurred!"""

following is CMakeLists.txt

cmake_minimum_required(VERSION 3.0.2)
project(turtlebot3_move)

find_package(catkin REQUIRED COMPONENTS
  rospy
  actionlib_msgs
  std_msgs
  message_generation
)

# add_message_files(
#   FILES
#   Message1.msg
#   Message2.msg
# )

## Generate services in the 'srv' folder
add_service_files(
    FILES
    MoveInSquare.srv
#   Service1.srv
#   Service2.srv
 )
## Generate actions in the 'action' folder
add_action_files(
    FILES
    OdomRecordMsg.action
 )
## Generate added messages and services with any dependencies listed here
generate_messages(
    DEPENDENCIES
	std_msgs  
    actionlib_msgs
 )


catkin_package(
    CATKIN_DEPENDS 
    rospy 
    message_runtime
	actionlib_msgs
#  DEPENDS system_lib
)


include_directories(
# include
    ${catkin_INCLUDE_DIRS}
)

and this is my package.xml

<?xml version="1.0"?>
<package format="2">
  <name>turtlebot3_move</name>
  <version>0.0.0</version>
  <description>The turtlebot3_move package</description>

  <!-- One maintainer tag required, multiple allowed, one person per tag -->
  <!-- Example:  -->
  <!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
  <maintainer email="user@todo.todo">user</maintainer>


  <!-- One license tag required, multiple allowed, one license per tag -->
  <!-- Commonly used license strings: -->
  <!--   BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
  <license>TODO</license>


  <!-- Url tags are optional, but multiple are allowed, one per tag -->
  <!-- Optional attribute type can be: website, bugtracker, or repository -->
  <!-- Example: -->
  <!-- <url type="website">http://wiki.ros.org/turtlebot3_move</url> -->


  <!-- Author tags are optional, multiple are allowed, one per tag -->
  <!-- Authors do not have to be maintainers, but could be -->
  <!-- Example: -->
  <!-- <author email="jane.doe@example.com">Jane Doe</author> -->


  <!-- The *depend tags are used to specify dependencies -->
  <!-- Dependencies can be catkin packages or system dependencies -->
  <!-- Examples: -->
  <!-- Use depend as a shortcut for packages that are both build and exec dependencies -->
  <!--   <depend>roscpp</depend> -->
  <!--   Note that this is equivalent to the following: -->
  <!--   <build_depend>roscpp</build_depend> -->
  <!--   <exec_depend>roscpp</exec_depend> -->
  <!-- Use build_depend for packages you need at compile time: -->
  <!--   <build_depend>message_generation</build_depend> -->
  <!-- Use build_export_depend for packages you need in order to build against this package: -->
  <!--   <build_export_depend>message_generation</build_export_depend> -->
  <!-- Use buildtool_depend for build tool packages: -->
  <!--   <buildtool_depend>catkin</buildtool_depend> -->
  <!-- Use exec_depend for packages you need at runtime: -->
  <!--   <exec_depend>message_runtime</exec_depend> -->
  <!-- Use test_depend for packages you need only for testing: -->
  <!--   <test_depend>gtest</test_depend> -->
  <!-- Use doc_depend for packages you need only for building documentation: -->
  <!--   <doc_depend>doxygen</doc_depend> -->
  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>rospy</build_depend>
  <build_depend>std_msgs</build_depend>
  <build_depend>message_generation</build_depend>
  <build_export_depend>rospy</build_export_depend>
  <exec_depend>rospy</exec_depend>
  <build_export_depend>std_msgs</build_export_depend>
  <exec_depend>std_msgs</exec_depend>
  <build_export_depend>message_runtime</build_export_depend>
  <exec_depend>message_runtime</exec_depend>
  <build_depend>actionlib</build_depend>
  <build_depend>actionlib_msgs</build_depend>
  <build_export_depend>actionlib</build_export_depend>
  <build_export_depend>actionlib_msgs</build_export_depend>
  <exec_depend>actionlib</exec_depend>
  <exec_depend>actionlib_msgs</exec_depend>


  <!-- The export tag contains other, unspecified, tags -->
  <export>
   <!-- Other tools can request additional information be placed here -->

  </export>
</package>

@Joseph1001 hey can you please take a look at my problem please?

Hi @ptgh ,good to hear from you again. I will try my hand at this, but just so you know, modifying Cmake files and the XML file is not my strong suit. :sweat_smile: :

You action Msg file:
image

Now the error mentioned is saying that the program is not able to find the package holding Point, called geometry_msgs since you have not mentioned it under generate_messages().

Just add geometry_msgs package to the following:

Add to find_package so that the program can find the package:

find_package(catkin REQUIRED COMPONENTS
  rospy
  actionlib_msgs
  std_msgs
  message_generation
  geometry_msgs
)

Add to generate_messages, since it holds all the packages needed for message generation.

generate_messages(
    DEPENDENCIES
	std_msgs  
    actionlib_msgs
    geometry_msgs
 )

Add below lines in the XML file:

<build_depend>geometry_msgs</build_depend>
<build_export_depend>geometry_msgs</build_export_depend>
<exec_depend>geometry_msgs</exec_depend>

Give this a try and let me know how it goes.

1 Like

hahaha :joy: many thanks for your reply
actually following are the current files and new error
action file

OdomRecordMsg.action

---
Point[] list_of_odoms
---
float32 current_total

cmakelists.txt file

project(turtlebot3_move_test)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  rospy
  std_msgs
  actionlib_msgs
  message_generation
  sensor_msgs
  geometry_msgs
  
  
)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
################################################

## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
##   * add a build_depend tag for "message_generation"
##   * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
##   * If MSG_DEP_SET isn't empty the following dependency has been pulled in
##     but can be declared for certainty nonetheless:
##     * add a exec_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
##   * add "message_generation" and every package in MSG_DEP_SET to
##     find_package(catkin REQUIRED COMPONENTS ...)
##   * add "message_runtime" and every package in MSG_DEP_SET to
##     catkin_package(CATKIN_DEPENDS ...)
##   * uncomment the add_*_files sections below as needed
##     and list every .msg/.srv/.action file to be processed
##   * uncomment the generate_messages entry below
##   * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)

## Generate messages in the 'msg' folder
# add_message_files(
#   FILES
#   Message1.msg
#   Message2.msg
# )

## Generate services in the 'srv' folder
 add_service_files(
   FILES
   MoveInSquare.srv
#   Service2.srv
 )

## Generate actions in the 'action' folder

 add_action_files(
   FILES
   OdomRecordMsg.action
#   Action2.action
 )

## Generate added messages and services with any dependencies listed here
 generate_messages(
   DEPENDENCIES
   std_msgs
   actionlib_msgs
   sensor_msgs
   geometry_msgs
   
 )

catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES turtlebot3_move_test
  CATKIN_DEPENDS rospy message_runtime
#  DEPENDS system_lib
)

include_directories(
# include
  ${catkin_INCLUDE_DIRS}
)


and package.xml

<?xml version="1.0"?>
<package format="2">
  <name>turtlebot3_move_test</name>
  <version>0.0.0</version>
  <description>The turtlebot3_move_test package</description>

  <!-- One maintainer tag required, multiple allowed, one person per tag -->
  <!-- Example:  -->
  <!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
  <maintainer email="user@todo.todo">user</maintainer>


  <!-- One license tag required, multiple allowed, one license per tag -->
  <!-- Commonly used license strings: -->
  <!--   BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
  <license>TODO</license>


  <!-- Url tags are optional, but multiple are allowed, one per tag -->
  <!-- Optional attribute type can be: website, bugtracker, or repository -->
  <!-- Example: -->
  <!-- <url type="website">http://wiki.ros.org/turtlebot3_move_test</url> -->


  <!-- Author tags are optional, multiple are allowed, one per tag -->
  <!-- Authors do not have to be maintainers, but could be -->
  <!-- Example: -->
  <!-- <author email="jane.doe@example.com">Jane Doe</author> -->


  <!-- The *depend tags are used to specify dependencies -->
  <!-- Dependencies can be catkin packages or system dependencies -->
  <!-- Examples: -->
  <!-- Use depend as a shortcut for packages that are both build and exec dependencies -->
  <!--   <depend>roscpp</depend> -->
  <!--   Note that this is equivalent to the following: -->
  <!--   <build_depend>roscpp</build_depend> -->
  <!--   <exec_depend>roscpp</exec_depend> -->
  <!-- Use build_depend for packages you need at compile time: -->
  <!--   <build_depend>message_generation</build_depend> -->
  <!-- Use build_export_depend for packages you need in order to build against this package: -->
  <!--   <build_export_depend>message_generation</build_export_depend> -->
  <!-- Use buildtool_depend for build tool packages: -->
  <!--   <buildtool_depend>catkin</buildtool_depend> -->
  <!-- Use exec_depend for packages you need at runtime: -->
  <!--   <exec_depend>message_runtime</exec_depend> -->
  <!-- Use test_depend for packages you need only for testing: -->
  <!--   <test_depend>gtest</test_depend> -->
  <!-- Use doc_depend for packages you need only for building documentation: -->
  <!--   <doc_depend>doxygen</doc_depend> -->
  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>actionlib</build_depend>
  <build_depend>actionlib_msgs</build_depend>
  <build_depend>rospy</build_depend>

  <build_depend>std_msgs</build_depend>
  <build_export_depend>actionlib</build_export_depend>
  <build_export_depend>actionlib_msgs</build_export_depend>
  <build_depend>message_generation</build_depend>
  <build_export_depend>rospy</build_export_depend>
  <exec_depend>actionlib</exec_depend>
  <exec_depend>actionlib_msgs</exec_depend>
  <exec_depend>rospy</exec_depend>
  <build_export_depend>std_msgs</build_export_depend>
  <exec_depend>std_msgs</exec_depend>
  <build_export_depend>message_runtime</build_export_depend>
  <exec_depend>message_runtime</exec_depend>
  <build_depend>geometry_msgs</build_depend>
  <build_export_depend>geometry_msgs</build_export_depend>
  <exec_depend>geometry_msgs</exec_depend>
  <build_depend>sensor_msgs</build_depend>
  <build_export_depend>sensor_msgs</build_export_depend>
  <exec_depend>sensor_msgs</exec_depend>

  <!-- The export tag contains other, unspecified, tags -->
  <export>
    <!-- Other tools can request additional information be placed here -->

  </export>
</package>

the error it shows says :
`File “/opt/ros/noetic/lib/python3/dist-packages/genmsg/deps.py”, line 50, in find_msg_dependencies_with_type
raise genmsg.MsgGenerationException(“Cannot read .msg for %s: %s”%(full_type_name, str(e)))
genmsg.base.MsgGenerationException: Cannot read .msg for turtlebot3_move_test/OdomRecordMsgAction: /home/user/catkin_ws/devel/share/turtlebot3_move_test/msg/OdomRecordMsgGoal.msg: Invalid declaration: OdomRecordMsg.action
CMake Error at /opt/ros/noetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
execute_process(/home/user/catkin_ws/build/catkin_generated/env_cached.sh
“/usr/bin/python3” “/usr/lib/python3/dist-packages/em.py” “–raw-errors”
“-F”
“/home/user/catkin_ws/build/turtlebot3_move_test/cmake/turtlebot3_move_test-genmsg-context.py”
“-o”
“/home/user/catkin_ws/build/turtlebot3_move_test/cmake/turtlebot3_move_test-genmsg.cmake”
“/opt/ros/noetic/share/genmsg/cmake/pkg-genmsg.cmake.em”) returned error
code 1
Call Stack (most recent call first):
/opt/ros/noetic/share/catkin/cmake/em_expand.cmake:25 (safe_execute_process)
/opt/ros/noetic/share/genmsg/cmake/genmsg-extras.cmake:303 (em_expand)
turtlebot3_move_test/CMakeLists.txt:77 (generate_messages)

– Configuring incomplete, errors occurred!
See also “/home/user/catkin_ws/build/CMakeFiles/CMakeOutput.log”.
See also “/home/user/catkin_ws/build/CMakeFiles/CMakeError.log”.
make: *** [Makefile:320: cmake_check_build_system] Error 1
Invoking “make cmake_check_build_system” failed`

@ptgh ,unfortunatly, i am not able to figure it out, but i take it that the errors from the previous post are resolved.
Let me forward your query to the @staff ,they are more experienced in section.

2 Likes

Instead of the above line in your custom action file, use the following:

geometry_msgs/Point[] list_of_odoms
1 Like

thank you for your reply but the problem persists with the following error.

CMake Error at /opt/ros/noetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  execute_process(/home/user/catkin_ws/build/catkin_generated/env_cached.sh
  "/usr/bin/python3" "/usr/lib/python3/dist-packages/em.py" "--raw-errors"
  "-F"
  "/home/user/catkin_ws/build/turtlebot3_move_test/cmake/turtlebot3_move_test-genmsg-context.py"
  "-o"
  "/home/user/catkin_ws/build/turtlebot3_move_test/cmake/turtlebot3_move_test-genmsg.cmake"
  "/opt/ros/noetic/share/genmsg/cmake/pkg-genmsg.cmake.em") returned error
  code 1
Call Stack (most recent call first):
  /opt/ros/noetic/share/catkin/cmake/em_expand.cmake:25 (safe_execute_process)
  /opt/ros/noetic/share/genmsg/cmake/genmsg-extras.cmake:303 (em_expand)
  turtlebot3_move_test/CMakeLists.txt:26 (generate_messages)


-- Configuring incomplete, errors occurred!
See also "/home/user/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/user/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

oh I found that I changed .srv file to

MoveInSquare.srv

---
bool complete

instead of the following one:

--
bool complete

the problem is solved
@Joseph1001 @bayodesegun many thanks.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.