Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add idl pipeline using a separate extension point #331

Merged
merged 3 commits into from
Nov 21, 2018
Merged

Conversation

dirk-thomas
Copy link
Member

@dirk-thomas dirk-thomas commented Nov 19, 2018

This is the sixth PR integrating #298 step-by-step.

Builds on top of #326. Needs ros2/system_tests#310.

  • It introduces a new extension point for IDL-based message generators named rosidl_generate_idl_interfaces beside the existing one named rosidl_generate_interfaces. Existing generators will continue to work and can be migrate one-by-one to the new interface. Once that is completed the code related to the legacy pipeline can be removed.
  • It adds support to transform .action files to .idl files.
  • It adds support to parse actions from .idl files into an object representation.

Linux build: Build Status

@dirk-thomas dirk-thomas added enhancement New feature or request in review Waiting for review (Kanban column) labels Nov 19, 2018
@dirk-thomas dirk-thomas self-assigned this Nov 19, 2018
@dirk-thomas
Copy link
Member Author

The latest commit derives the actually communicated goal service, result service and feedback message from the three pieces provided by the .action / .idl file: a2624af
(before merging it should be squashed with the commit before which added only the user provided pieces).

@dirk-thomas
Copy link
Member Author

Need to rebase on idl-stage-5 to pass CI, squashing the last two commits in that process...

@dirk-thomas dirk-thomas force-pushed the idl-stage-6 branch 2 times, most recently from b9f64e4 to 1d368cc Compare November 20, 2018 23:24
--arguments-file "${arguments_file}"
--output-dir "${CMAKE_CURRENT_BINARY_DIR}/rosidl_adapter/${PROJECT_NAME}"
--output-file "${idl_output}")
execute_process(
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like execute_process() happens at configure time. It doesn't look like it can have file or target dependencies, or even run at build time. If I configure a package, change an .msg file and build, then I would expect this to not re-generate the .idl file. Does anything tell CMake to re-run rosidl_adapter at build time?

Copy link
Member Author

Choose a reason for hiding this comment

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

This call ensures that CMake is re-run when any of the passed in interface files changes.

# Split .srv into two .msg files
foreach(_idl_file ${_idl_files})
get_filename_component(_extension "${_idl_file}" EXT)
set(_non_idl_files "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this makes the foreach() below do nothing, and since services are now split by rosidl_adapter, can the foreach() below be deleted?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure I see which line you are referring to? _non_idl_files is being populated in line 153 and further below used..

Copy link
Contributor

Choose a reason for hiding this comment

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

I confused _non_idl_files and _non_idl_tuples. Nevermind

assert isinstance(goal_request, Message)
assert goal_request.structure.type.namespaces == type_.namespaces
assert goal_request.structure.type.name == type_.name + \
ACTION_GOAL_SERVICE_SUFFIX + SERVICE_REQUEST_MESSAGE_SUFFIX
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the struct names for actions in .idl would be fine without SERVICE_<REQUEST/RESPONSE>_MESSAGE_SUFFIX at the end of them, but this works

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the suffix is needed to avoid potential collisions. The idea is that each type of interface lives in its own "namespace" without colliding with items of other types. E.g. a package can define a Fibonacci.msg, Fibonacci.srv and Fibonacci.action without the risk of collisions.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought ACTION_GOAL_SERVICE_SUFFIX by containing an underscore avoided the namespace collision already.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you describe the exact change you propose.

Do you want the user defined goal / result types to not have a request / response suffix?

@dirk-thomas dirk-thomas force-pushed the idl-stage-6 branch 2 times, most recently from 873b97a to 4ab49ff Compare November 21, 2018 04:36
@dirk-thomas
Copy link
Member Author

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status
    • The tuple conversation can't replace all colons but only the last one since the first part is an absolute path which contains a colon on Windows: 4ab49ff
    • Build Status

@dirk-thomas
Copy link
Member Author

Squashed the last two commit and merging...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants