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

Adds includes for action wrapper IDL messages fields. #337

Merged
merged 4 commits into from
Dec 5, 2018

Conversation

hidmic
Copy link
Contributor

@hidmic hidmic commented Dec 4, 2018

Small pull request, fixing missing includes for action wrapping messages.

@hidmic hidmic requested a review from dirk-thomas December 4, 2018 20:10
@tfoote tfoote added the in progress Actively being worked on (Kanban column) label Dec 4, 2018
self.includes = [
Include('builtin_interfaces/msg/Time.idl')
]

Copy link
Member

Choose a reason for hiding this comment

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

Includes are not specific to an Action but are available through the IdlContent instance. Therefore I don't think this should be added to the Action class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since it is the Action that's adding the field, I thought it was cleaner to keep it as an implementation detail.

@@ -235,6 +235,7 @@ def extract_content_from_ast(tree):
name=goal_request_basename),
goal_request, result_response, feedback_message)
content.elements.append(action)
content.elements.extend(action.includes)
Copy link
Member

Choose a reason for hiding this comment

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

This could add an explicit Include instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, that's the other option, assuming we keep both parser and Action specific fields in sync.

@@ -234,6 +234,7 @@ def extract_content_from_ast(tree):
namespaces=goal_request.structure.type.namespaces,
name=goal_request_basename),
goal_request, result_response, feedback_message)
content.elements += action.implicit_includes
Copy link
Member

Choose a reason for hiding this comment

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

This might result in a duplicate include though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Why not add the deduplication here (rather than in potentially every location which uses this API)?


all_includes = content.get_elements_of_type(Include)
unique_include_locators = set([
include.locator for include in all_includes])
Copy link
Member

Choose a reason for hiding this comment

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

I would expect the linter to warn about this. This likely needs to be a set comprehension instead.

Copy link
Member

Choose a reason for hiding this comment

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

@hidmic Once you have checked this (and updated if necessary) please squash merge this PR into idl-stage-7.

@jacobperron
Copy link
Member

Running CI with this branch seems to resolve the current build error, moving onto another:

Build Status

04:26:19 /home/rosbuild/ci_scripts/ws/src/ros2/rcl_interfaces/test_msgs/test/test_cpp_type_support.cpp: In member function ‘virtual void ActionCppTypeSupport_can_get_type_support_Test::TestBody()’:
04:26:19 /home/rosbuild/ci_scripts/ws/src/ros2/rcl_interfaces/test_msgs/test/test_cpp_type_support.cpp:24:60: error: ‘test_msgs’ was not declared in this scope
04:26:19      rosidl_typesupport_cpp::get_action_type_support_handle<test_msgs::action::Fibonacci>();

@dirk-thomas
Copy link
Member

I am going ahead and merge this in order to be able to build and test from a single branch.

@dirk-thomas dirk-thomas merged commit f686839 into idl-stage-7 Dec 5, 2018
@dirk-thomas dirk-thomas deleted the hidmic/idl-stage-7 branch December 5, 2018 14:58
@dirk-thomas dirk-thomas removed the in progress Actively being worked on (Kanban column) label Dec 5, 2018
@@ -234,7 +234,13 @@ def extract_content_from_ast(tree):
namespaces=goal_request.structure.type.namespaces,
name=goal_request_basename),
goal_request, result_response, feedback_message)
content.elements.append(action)
Copy link
Member

Choose a reason for hiding this comment

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

The patch remove the appending of the action.

dirk-thomas pushed a commit that referenced this pull request Feb 5, 2019
* Adds includes for action wrapper IDL messages fields.

* move includes

* add includes before action

* Deduplicates implicit action includes.
dirk-thomas pushed a commit that referenced this pull request Feb 12, 2019
* Adds includes for action wrapper IDL messages fields.

* move includes

* add includes before action

* Deduplicates implicit action includes.
dirk-thomas added a commit that referenced this pull request Mar 12, 2019
…ction types (#334)

* add Python function for IDL-based generators

* update C and C++ message generators to use IDL-based extension point

* update includes in typesupport packages

* replace separate action generation with IDL-based approach

* don't pass .action files to legacy message generators

* temporary use custom map in not yet updated generator

* strip action specific suffixes from include filename

* add action templates to list of dependencies

* match constants with message

* traits

* native path

* escape JSON correctly

* rsplit

* fix warning

* comment fix

* unique include directives

* make pydot optional

* fix linter

* linter

* fix comment

* remove service check for feedback suffix

* use UINT8_MAX

* fix comment

* extend action struct with FeedbackMessage

* update C and C++ introspection typesupport generators to use IDL-based extension point

* add missing symbols

* address linter warnings

* instantiate parser on demand

* Add option to generate_files() for keeping idl filename case (#336)

* remove unused var

* remove comment

* fix missing import introduced during rebase

* change exported variable from <pkg>_INTERFACE_FILES to <pkg>_IDL_FILES and only include .idl files

* keep <pkg>_INTERFACE_FILES for legacy generators

* fix upper string length for nested strings

* fix default value for strings with upper bounds

* fix classification of unbounded sequence of bounded strings

* fix previous fix

* Adds includes for action wrapper IDL messages fields. (#337)

* Adds includes for action wrapper IDL messages fields.

* move includes

* add includes before action

* Deduplicates implicit action includes.

* Use set comprehension instead (nit fix)

* fix adding actions

* Add missing closing brace for 'extern C'

* fix missing service request/response symbols

* don't generate png of AST by default

* expose function to get AST

* no enum support yet

* fix more missing symbols

* fixup

* fix includes

* undef NO_ERROR for Windows

This was causing a build issue in tf2_msgs where a constant with the same name is defined.

* dump working copy

* fix struct identifier extraction when having an annotation

* match renamed action types

* update grammar to improve parse performance

* remove obsolete ImplicitFieldCollision logic

* update action tests

* fix value range of char in adapter

* fix char being unsigned

* disable debug images of AST

* use unique_identifier_msgs for goal id

* up doc

* fix regression on Windows

* remove obsolete comment

* try to fix Windows warning

* remove obsolete constant

* targeting Dashing

* removed comment

* moved template calls

* remove obsolete todo

* removed commented code

* fix initialization of u16string

* fix u16string len

* avoid double initialization

* moved template calls

* comment in test

* fix has_bounded_size trait

* readd explicit dependency on absolute paths of idl files

* reduce logic with all action related types being in a single file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants