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 parameters component #305

Merged
merged 60 commits into from
Oct 26, 2022
Merged

Conversation

ivanpauno
Copy link
Contributor

@ivanpauno ivanpauno commented Apr 8, 2022

🎉 New feature

Replaces gazebosim/gz-sim#1280.
Same as #304 but rebased to target ignition-transport11.

Connected to:

Summary

Adds an implementation of a parameter registry, which allows through services to:

  • Declare a parameter.
  • Get the value of a parameter.
  • Set the value of a parameter.
  • List all parameters.

The same operations can be done directly locally, using the parameters registry API.
There's also a parameters client implementation, which is just a wrapper on top of sending requests to the services.

Parameter types are defined as protobuf messages.
This PR also adds a ign param cli command, which allows to easily interact with parameters.

TODO:

  • Add tests!!!
  • Open PR in ignition gazebo using this!!!

Test it

TODO

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

@ivanpauno ivanpauno requested a review from caguero as a code owner April 8, 2022 18:01
@ivanpauno ivanpauno changed the title Ivanpauno/parameters component11 Add parameters component Apr 8, 2022
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Apr 8, 2022
@chapulina chapulina added the needs upstream release Blocked by a release of an upstream library label Apr 11, 2022
parameters/include/ignition/transport/parameters/Client.hh Outdated Show resolved Hide resolved
parameters/include/ignition/transport/parameters/Client.hh Outdated Show resolved Hide resolved
parameters/src/Client.cc Show resolved Hide resolved
parameters/include/ignition/transport/parameters/Client.hh Outdated Show resolved Hide resolved
parameters/src/cmd/ParamCommandAPI.hh Outdated Show resolved Hide resolved
Copy link
Collaborator

@caguero caguero left a comment

Choose a reason for hiding this comment

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

See also the style errors reported by CI.

@ivanpauno ivanpauno requested a review from caguero April 26, 2022 17:56
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
* Document ParametersClient.

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
@ivanpauno
Copy link
Contributor Author

It looks good to me! My only concern is about the use of exceptions. I know that they have their advantages but the convention that we follow is to avoid them as much as possible and not to terminate the execution. Is there any chance we could avoid exceptions? Maybe return an error structure with extra information as opposed to a boolean for not loosing information?

Done, please take a look to the last few commits.

@scpeters
Copy link
Member

it looks like there are several test failures

@ivanpauno
Copy link
Contributor Author

it looks like there are several test failures

Yes sorry, I'm figuring those out locally.

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
@scpeters
Copy link
Member

I think the ABI checker is a false positive, and the windows CI problems are from pre-existing protobuf compiler warnings

@caguero have all your concerns been addressed?

@scpeters scpeters requested a review from caguero October 25, 2022 18:16
Copy link
Collaborator

@caguero caguero left a comment

Choose a reason for hiding this comment

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

Looking good!

@scpeters scpeters merged commit 2d0d1d0 into ign-transport11 Oct 26, 2022
@scpeters scpeters deleted the ivanpauno/parameters-component11 branch October 26, 2022 17:21
scpeters pushed a commit to gazebosim/gz-sim that referenced this pull request Dec 21, 2022
This adds the ISystemConfigureParameters interface, which
allows systems to declare parameters. This uses a
transport::parameters::ParametersRegistry and creates
services for listing, getting, and setting parameters.

Based on gazebosim/gz-transport#305.

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 🏯 fortress Ignition Fortress needs upstream release Blocked by a release of an upstream library
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants