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

ros2: is it possible? code, message and action definitions in the same package

asked 2020-11-02 13:18:09 -0600

updated 2020-11-06 16:21:56 -0600

I have a package with actions, messages and code.

The code references the action and messages. However there is a compilation error. It looks like the action include files are not found during the colcon build command.

The question is simple: is it possible to use a actions and message definitions from code in the same packages?

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
2

answered 2022-07-27 20:48:10 -0600

ravijoshi gravatar image

updated 2022-07-27 20:48:32 -0600

Yes, it is possible.

Earlier, I have tested it and it works. However, as stevemacenski suggested in his answer, it is better to keep interface definitions in a separate package.

You need to use rosidl_target_interfaces, if you are on Foxy or Galactic. Please check the following answer for detailed instructions: https://answers.ros.org/question/4021...

edit flag offensive delete link more
0

answered 2020-11-07 12:54:15 -0600

updated 2020-11-07 12:55:12 -0600

Yes, SLAM Toolbox is an example of just that. However, it is easier to have them in a separate package.

edit flag offensive delete link more

Comments

Thanks Steve, I will check that.

Pablo Iñigo Blasco gravatar image Pablo Iñigo Blasco  ( 2020-11-11 15:24:12 -0600 )edit

What's the trick to it?

danzimmerman gravatar image danzimmerman  ( 2022-07-27 18:12:21 -0600 )edit
0

answered 2022-07-27 19:10:46 -0600

danzimmerman gravatar image

https://docs.ros.org/en/humble/Tutori... seems to cover this.

I just refactored into a separate interface package, so I haven't tried it this way.

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2020-11-02 13:18:09 -0600

Seen: 947 times

Last updated: Jul 27 '22