ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question

Revision history [back]

There header files are generated automatically from .srv files that you put in your package_folder/srv. (In this case chapter2_srv1.srv) You also need an additional line in your CMakeLists.txt that tells catkin to generate those messages. This should be explained in the book.

add_service_files(
  FILES
  chapter2_srv1.srv
)

and also add message_generation to catkin components in the CMakeLists.txt. example:

find_package(catkin REQUIRED COMPONENTS
   roscpp
   rospy
   std_msgs
   message_generation
)

and also in your package.xml you need the message generation dependency

  <build_depend>message_generation</build_depend>
  <run_depend>message_runtime</run_depend>

There header files are generated automatically from .srv files that you put in your package_folder/srv. (In this case chapter2_srv1.srv) You also need an additional line in your CMakeLists.txt that tells catkin to generate those messages. This should be explained in the book.

add_service_files(
  FILES
  chapter2_srv1.srv
)

and also add message_generation to catkin components in the CMakeLists.txt. example:

find_package(catkin REQUIRED COMPONENTS
   roscpp
   rospy
   std_msgs
   message_generation
)

and also finally in your package.xml you need the message generation dependency

  <build_depend>message_generation</build_depend>
  <run_depend>message_runtime</run_depend>

here is the link for the tutorial.