ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Problem with Action msg

asked 2020-02-11 07:21:28 -0500

MichaelDUEE gravatar image

updated 2020-02-11 07:22:05 -0500

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  
 message_generation ) add_action_files(
 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 flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-02-11 08:07:30 -0500

mgruhler gravatar image

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")

edit flag offensive delete link more

Comments

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 ?

MichaelDUEE gravatar image MichaelDUEE  ( 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).

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

Thank you, that worked!

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

Question Tools

2 followers

Stats

Asked: 2020-02-11 07:21:28 -0500

Seen: 601 times

Last updated: Feb 11 '20