-
Notifications
You must be signed in to change notification settings - Fork 685
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 type enforcement of parameters #720
Comments
cc @jacobperron @wjwwood @jubeira @hidmic @clalancette @tfoote. Although my original proposal was the third member of the list, I suggest going on with the last option (which does not break api). |
I'd propose to discuss this in our next meeting.
In other words, if a slight change in the meaning of
If that change of meaning for |
This option makes the most sense to me. We keep the same (or similar) intention of |
@wjwwood Friendly ping. |
I see this as the simplest and most effective way for enforcing the parameter type. One of the concerns for this release was that it breaks APIs. In any case, regardless of the chosen option, it should be also added a new API for declaring parameters:
This allows to declare a parameter and to specify its description (with the type), while still keeping it UNSET |
@ivanpauno Now that we are enforcing types, can we close this one out? |
I'm pretty sure we can close this. |
All right, will do. Feel free to reopen if there is further work we need for this feature. |
Feature request
Feature description
Meta ticket for discussing how to add type enforcement of parameters both in rclcpp and rclpy.
See discussion in range enforcement PR.
Summary of the previous discussion
Currently, the parameter descriptor message has a
type
field, which is updated each time the parameter is set. To add type enforcement, some different proposals have been discussed:allowed_types
. Thetype
field will continue working as before, andallowed_types
shall be a vector with the admitted types. (api compatible but breaking abi)allowed_type
. Only one type can be specified. (api compatible but breaking abi)type
field meaning. It won't be updated anymore when a parameter is set, and it would be used for type enforcing. When the specifiedtype
isPARAMETER_NO_TYPE
, type enforcement is not applied (this could be applied in the other options). (breaks abi and api)type
field in that case. Stop updating it with declared parameters, and use it for type enforcement. (breaks api)is_type_enforced
field to the parameter descriptor (default to false). When it isfalse
, type enforcement is not applied, andtype
field is updated as before. When it istrue
, it's used for type enforcement (no need to update it, as the type is enforced). (api compatible, but breaking abi)Implementation considerations
Any of the options should be easy to implement both in
rclcpp
andrclpy
.The text was updated successfully, but these errors were encountered: