Ask Your Question
0

How to make actionlib service that depends on other message types?

asked 2018-06-09 16:43:55 -0600

rahvee gravatar image

updated 2018-06-09 18:25:21 -0600

I'm creating a new service using actionlib, where the goal is an external standard message type, PoseWithCovarianceStamped. Here is the .action file:

# Define the goal
PoseWithCovarianceStamped pose
---
# Define the result
bool succeeded
---
# Define a feedback message
float32 percent_complete

When I run catkin_make I get the error message:

CMake Error at [...] (message):
  Could not find messages which
  '[...]'
  depends on.  Did you forget to specify generate_messages(DEPENDENCIES ...)?

  Cannot locate message [PoseWithCovarianceStamped] in package

So then I said "oh, duh, of course I need that." I added geometry_msgs to my CMakeLists.txt like this:

find_package(catkin REQUIRED genmsg actionlib_msgs actionlib geometry_msgs)
add_action_files(DIRECTORY action FILES SetPose.action)
generate_messages(DEPENDENCIES actionlib_msgs geometry_msgs)

But I still get the same error message, and I'm not sure what I'm doing wrong...

Here is a copy of my package.xml with comments removed:

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

  <maintainer email="edward.harvey@todo.todo">turtlebot</maintainer>

  <license>GPLv3</license>

  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>rospy</build_depend>
  <build_export_depend>roscpp</build_export_depend>
  <build_export_depend>rospy</build_export_depend>
  <exec_depend>roscpp</exec_depend>
  <exec_depend>rospy</exec_depend>
  <build_depend>actionlib</build_depend>
  <build_depend>actionlib_msgs</build_depend>
  <exec_depend>actionlib</exec_depend>
  <exec_depend>actionlib_msgs</exec_depend>

  <export>
  </export>
</package>

And here is a copy of my CMakeLists.txt with comments removed:

cmake_minimum_required(VERSION 2.8.3)
project(set_pose)

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
)

find_package(catkin REQUIRED genmsg actionlib_msgs actionlib geometry_msgs)
add_action_files(DIRECTORY action FILES SetPose.action)
generate_messages(DEPENDENCIES actionlib_msgs geometry_msgs)

catkin_package(
)

include_directories(
  ${catkin_INCLUDE_DIRS}
)
edit retag flag offensive close merge delete

Comments

Can you please update your question with your package.xml and CMakeLists.txt?

jayess gravatar imagejayess ( 2018-06-09 17:57:04 -0600 )edit

@jayess Updated. Thanks for looking.

rahvee gravatar imagerahvee ( 2018-06-09 18:25:43 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-06-09 19:05:39 -0600

rahvee gravatar image

Sweet! I figured it out, thanks to @velveteenrobot in this discussion: A string goal with actionlib

I had to change my .action file to say geometry_msgs/PoseWithCovarianceStamped as follows:

# Define the goal
geometry_msgs/PoseWithCovarianceStamped pose
---
# Define the result
bool succeeded
---
# Define a feedback message
float32 percent_complete
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-06-09 16:43:55 -0600

Seen: 201 times

Last updated: Jun 09 '18