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

Need to specify NodeOption explicitly to allow declaration. #389

Conversation

fujitatomoya
Copy link
Collaborator

@fujitatomoya fujitatomoya commented Sep 13, 2019

for EvenParameterNode sample, NodeOption should be specified explicitly to allow declaration the parameters from the other nodes.

Client(ros2 param cli to set parameter)

root@6cc2c62d0dd0:~/ros2_colcon_ws# ros2 param set /even_parameters_node foo 2
Setting parameter failed: parameter 'foo' cannot be set because it was not declared

EvenParameterNode

root@6cc2c62d0dd0:~/ros2_colcon_ws# ros2 run demo_nodes_cpp even_parameters_node
[WARN] [rclcpp]: Failed to set parameter: parameter 'foo' cannot be set because it was not declared

with above, expected behavior is to be able to set even number for EvenParameterNode.

Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
@fujitatomoya
Copy link
Collaborator Author

@ivanpauno

could you check bb1cf59 ?

@ivanpauno
Copy link
Member

Is this example also affected by ros2/rclcpp#851?

@fujitatomoya
Copy link
Collaborator Author

Is this example also affected by ros2/rclcpp#851?

yes, i will make the one PR for both of them.

Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
@fujitatomoya
Copy link
Collaborator Author

@ivanpauno

can you help me to merge this branch into the master?

Is this example also affected by ros2/rclcpp#851?

this fix also resolve the ros2/rclcpp#851

Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for iterating

rclcpp::NodeOptions()
.allow_undeclared_parameters(true)
.automatically_declare_parameters_from_overrides(true)
))
Copy link
Member

Choose a reason for hiding this comment

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

The default value was not being used, right?
IMO, it's ok to force allow_undeclared_parameters automatically_declare_parameters_from_overrides to true, because if not the example doesn't have sense.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

these are default arguments, so not used with current implementation.

@ivanpauno ivanpauno self-assigned this Sep 20, 2019
@ivanpauno
Copy link
Member

ivanpauno commented Sep 20, 2019

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

@ivanpauno
Copy link
Member

ivanpauno commented Sep 23, 2019

@fujitatomoya Can you address the linter failures?

Lines should be <= 100 characters long  [whitespace/line_length] [2]

Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
@fujitatomoya
Copy link
Collaborator Author

@ivanpauno

sorry about that i should have realized that before,

https://ci.ros2.org/job/ci_linux/8186/testReport/(root)/projectroot/cpplint/

is fixed.

Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

Sorry, but uncrustify is still not passing.

.automatically_declare_parameters_from_overrides(true)
))
: Node("parameter_blackboard", options)
rclcpp::NodeOptions options
Copy link
Member

Choose a reason for hiding this comment

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

extra tab missing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

got it, fixed in 2dc4fb3

)
: Node("parameter_blackboard",
options.allow_undeclared_parameters(true).
automatically_declare_parameters_from_overrides(true))
Copy link
Member

Choose a reason for hiding this comment

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

The correct style is:

  : Node(
      "parameter_blackboard",
      options.allow_undeclared_parameters(true).
      automatically_declare_parameters_from_overrides(true))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

got it, fixed in 2dc4fb3

@mabelzhang mabelzhang added the enhancement New feature or request label Sep 26, 2019
Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
@fujitatomoya
Copy link
Collaborator Author

@ivanpauno

could you check once again? apologize for uncrustify messges.

thanks

@ivanpauno
Copy link
Member

ivanpauno commented Sep 30, 2019

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

Copy link
Contributor

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

LGTM pending green CI

@fujitatomoya
Copy link
Collaborator Author

is there anything i gotta do? just let me know what to do.

@ivanpauno
Copy link
Member

ivanpauno commented Oct 1, 2019

is there anything i gotta do? just let me know what to do.

Fast-RTPS builds were temporally broken, now it should be fixed.
Re-running CI:

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

@ivanpauno
Copy link
Member

@fujitatomoya there are some test failures that seem to be related with this change, can you check them?

@fujitatomoya
Copy link
Collaborator Author

@ivanpauno

could you tell me what exactly the test failure is? i do not see any failure on CI.

@ivanpauno
Copy link
Member

could you tell me what exactly the test failure is? i do not see any failure on CI.

You can see the failures in the links above, e.g. here are the linux failures.

I tested locally, and the only problem seems to be that the branch isn't rebased with master.
Running CI again with a copy of your branch rebased on master:

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

@ivanpauno ivanpauno merged commit f3d61e6 into ros2:master Oct 2, 2019
@ivanpauno
Copy link
Member

Merged! Thanks for iterating @fujitatomoya!

@fujitatomoya fujitatomoya deleted the topic-20190913-even_parameter_node_option_fix branch October 2, 2019 23:16
@fujitatomoya
Copy link
Collaborator Author

@ivanpauno

and the only problem seems to be that the branch isn't rebased with master.

sorry about that, i just did not realize cz CI tells me that it can be merged.

anyway, thanks for your time!

@nuclearsandwich nuclearsandwich added this to Needs Backport in Dashing Patch Release 5 Dec 5, 2019
@ivanpauno
Copy link
Member

Removing from the Dashing patch release board, as #375 triggered the error, and that PR is not part of the Dashing branch.

@ivanpauno ivanpauno removed this from Needs Backport in Dashing Patch Release 5 Dec 10, 2019
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.

None yet

4 participants