Skip to content

Add dependency to action_msgs when generating action interfaces#369

Merged
jacobperron merged 4 commits intomasterfrom
find_action_msgs
May 30, 2019
Merged

Add dependency to action_msgs when generating action interfaces#369
jacobperron merged 4 commits intomasterfrom
find_action_msgs

Conversation

@jacobperron
Copy link
Copy Markdown
Member

Fixes ros2/rcl_interfaces#75

I'm not sure if this is the correct thing to do. @dirk-thomas, maybe you can tell me otherwise.

@dirk-thomas
Copy link
Copy Markdown
Member

The current patch didn't work if the action is defined in an .idl file.

@jacobperron
Copy link
Copy Markdown
Member Author

jacobperron commented Apr 27, 2019

The current patch didn't work if the action is defined in an .idl file.

Do you have a recommendation how to identify if an action is being defined in an .idl file?
A naive solution would be to include the dependency regardless of if there are any action definitions.
Or I can add a TODO/issue to come back to this, since this PR is at least covering the common case of using .action files.

@dirk-thomas
Copy link
Copy Markdown
Member

Instead of checking the extension it can check the directory name the interface file is located in.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron
Copy link
Copy Markdown
Member Author

Now we are checking the directory instead of the extension to infer if the interface is an action.

The current problem is ensuring that action_msgs is built before rosidl_generate_interfaces is called.
I'm not sure where to make this happen.

@jacobperron
Copy link
Copy Markdown
Member Author

Since action_msgs itself depends on other message packages (builtin_interfaces and unique_identifier_msgs) and the generators themselves it seems like the only thing we can do is require that the user add a build dependency to action_msgs. We can at least eliminate the cmake lines for finding and depending on it and produce a nice error message in the event that they forget to declare a build depend tag in package.xml.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron
Copy link
Copy Markdown
Member Author

See ros2/example_interfaces#6 for how this makes life a little easier for users.

@jacobperron jacobperron added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels May 29, 2019
@dirk-thomas
Copy link
Copy Markdown
Member

Also a note about this "magic" should be added to the docblock of the macro.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron
Copy link
Copy Markdown
Member Author

Building with connected PRs. Testing things known to use actions (rcl_action, rclcpp_action, and rclpy) and test_msgs:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@jacobperron jacobperron merged commit 6b0ad61 into master May 30, 2019
@delete-merged-branch delete-merged-branch bot deleted the find_action_msgs branch May 30, 2019 00:02
@jacobperron
Copy link
Copy Markdown
Member Author

jacobperron commented May 30, 2019

Looks like builds with OpenSplice aren't happy with this solution: http://build.ros2.org/job/Ddev__example_interfaces__ubuntu_bionic_amd64/4/

😨

Edit: False alarm.

find_package(action_msgs QUIET)
if(NOT ${action_msgs_FOUND})
message(FATAL_ERROR "Unable to generate action interface for '${_tuple_file}'. "
"In order to generate action interfaces you must add a depend tag for 'action_msgs' "
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter warning: see #382.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in review Waiting for review (Kanban column)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

action_msgs is a magic dependency for new action interfaces

2 participants