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

Revision history [back]

I'll give it a try. Before answering your problem, I'll focus on your questions:

  1. No, you schouldn't do that! This will result in different msgs, as the package name is included as well (as e.g. std_msgs/String; there, std_msgs is the package). You will then not be able to use the Client and Server together.
  2. You don't link them, as they are only headers. Thus, you only #include (C++) them. In Python, you import them.
  3. Puh, this is a tough one. I'll recommend you'll go through the catkin documentation. Especially the sections about resolving dependencies and building and installing targets. This is obviously dependent on what you do, i.e. use C++, Python and/or Messages.
  4. as above.

Your main problem is most probably that you haven't properly declared the dependencies in the package where you use the Messages.

Assuming you have the Messages in pkg A and want to use them in pkg B as well, besides obviously having the respective <build_depend> on pkg A and find_packageing pkg A, you should add an add_dependencies(<ACTION_SERVER_NODE> ${catkin_EXPORTED_TARGETS}) in the CMakeLists.txt of pkg B, after your call to add_executable(<ACTION_SERVER_NODE> ...). See also the very bottom of this page.

I'll give it a try. Before answering your problem, I'll focus on your questions:

  1. No, you schouldn't do that! This will result in different msgs, as the package name is included as well (as e.g. std_msgs/String; there, std_msgs is the package). You will then not be able to use the Client and Server together.
  2. You don't link them, as they are only headers. Thus, you only #include (C++) them. In Python, you import them.
  3. Puh, this is a tough one. I'll recommend you'll go through the catkin documentation. Especially the sections about resolving dependencies and building and installing targets. This is obviously dependent on what you do, i.e. use C++, Python and/or Messages.
  4. as above.

Your main problem is most probably that you haven't properly declared the dependencies in the package where you use the Messages.

Assuming you have the Messages in pkg A and want to use them in pkg B as well, besides obviously having the respective <build_depend> on pkg A and find_packageing pkg A, you should add an add_dependencies(<ACTION_SERVER_NODE> ${catkin_EXPORTED_TARGETS}) in the CMakeLists.txt of pkg B, after your call to add_executable(<ACTION_SERVER_NODE> ...). See also the very bottom of this page.. This tells catkin to first build all dependencies before building the respective target.