# Problem with Action msg

Hello, I wrote my own Action msg for ROS. This is the msg :

#goal
string start_phrase
---
#result
point coordinates
---
#feedback
duration time_elapsed


This is my changes in Cmake :

 find_package(catkin REQUIRED
COMPONENTS   actionlib_msgs
geometry_msgs   rospy   std_msgs
DIRECTORY action    FILES
camera.action

)

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

catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES camera_action   CATKIN_DEPENDS geometry_msgs rospy
actionlib_msgs
#  DEPENDS system_lib )


This is my Package :

  <buildtool_depend>catkin</buildtool_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>rospy</build_depend>
<build_export_depend>geometry_msgs</build_export_depend>
<build_export_depend>rospy</build_export_depend>
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>rospy</exec_depend>
<build_depend>message_generation</build_depend>
<exec_depend>message_runtime</exec_depend>


When I try to catkin_make my src i get this error :

Could not find messages which
'/home/michael/catkin_ws/devel/share/camera_action/msg/cameraAction.msg' depends on. Did you forget to specify generate_messages(DEPENDENCIES ...)?

Cannot locate message [point] in package [camera_action] with paths
[['/home/michael/catkin_ws/devel/share/camera_action/msg']] Call Stack (most recent call first):
/opt/ros/kinetic/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
camera_action/CMakeLists.txt:73 (generate_messages)

I see that there is a problem with point. Does someone have any idea ?

edit retag close merge delete

Sort by » oldest newest most voted

Well, point is no built-in data type (and not a relative one, apparently).

Thus need to specify it in the message description as package/Message. You are most probably referring to geometry_msgs/Point.

In fact, even though you can have relative names (see citation below), I'd recommend to always use the full package/Message format...

When embedding other Message descriptions, the type name may be relative (e.g. "Point32") if it is in the same package; otherwise it must be the full Message type (e.g. "std_msgs/String")

more

If I specify it like geometry_msgs/Point how should I write this in the Cmake file. geometry_msgs or geometry_msgs/Point and where ?

( 2020-02-11 16:28:38 -0500 )edit

In the CMakeLists.txt and the package.xml, you only depend on the package. I.e. on geometry_msgs. In the code where you use it, you need to specify the exact type (i.e. geometry_msgs/Point).

( 2020-02-12 01:38:20 -0500 )edit

Thank you, that worked!

( 2020-02-12 07:21:43 -0500 )edit