-
Notifications
You must be signed in to change notification settings - Fork 181
[Draft]Add structured parameter support #1254
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
base: rolling
Are you sure you want to change the base?
[Draft]Add structured parameter support #1254
Conversation
…te it into the YAML parser Signed-off-by: Rahul K.A <[email protected]>
Signed-off-by: Rahul K.A <[email protected]>
Signed-off-by: Rahul K.A <[email protected]>
…o_string` Signed-off-by: Rahul K.A <[email protected]>
…ODOs) Signed-off-by: Rahul K.A <[email protected]>
…l_variant_t` Signed-off-by: Rahul K.A <[email protected]>
Signed-off-by: Rahul K.A <[email protected]>
Signed-off-by: Rahul K.A <[email protected]>
Signed-off-by: Rahul K.A <[email protected]>
Signed-off-by: Rahul K.A <[email protected]>
Signed-off-by: Rahul K.A <[email protected]>
Signed-off-by: Rahul K.A <[email protected]>
Signed-off-by: Rahul K.A <[email protected]>
Signed-off-by: Rahul K.A <[email protected]>
Signed-off-by: Rahul K.A <[email protected]>
Signed-off-by: Rahul K.A <[email protected]>
Signed-off-by: Rahul K.A <[email protected]>
|
Tagging this as a draft, because Im yet to add in tests/ apply linter. Once done,will remove the draft tag. Maintainers are welcome to start reviewing it in the meantime |
Signed-off-by: Rahul K.A <[email protected]>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rough first pass, need to look at the code in more detail
| int64_t * integer_value; ///< If integer, gets stored here | ||
| double * double_value; ///< If double, gets stored here | ||
| char * string_value; ///< If string, gets stored here | ||
| char * yaml_value; ///< If structured YAML, gets stored here -> Is this right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| char * yaml_value; ///< If structured YAML, gets stored here -> Is this right? | |
| char * yaml_value; ///< If structured YAML, gets stored here |
| } | ||
|
|
||
| // rahul-k-a: TODO Combine this with the parameter allocation part of | ||
| // `write_structured_parameter_to_string` and put everything in a seperate functiong |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this todo solved or still relevant ?
| // make sure that the parameter index of the yaml parameter is not overwritten | ||
| // By default, if a namespace is detected, then the parameter entry in the param | ||
| // table is replaced by its immediate chile | ||
| // This is done for optimization (?) - Rahul-K-A |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // This is done for optimization (?) - Rahul-K-A | |
| // This is done for optimization |
| RCUTILS_SET_ERROR_MSG("Could not initialize the emitter"); | ||
| } | ||
|
|
||
| size_t max_string_length = 100000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| size_t max_string_length = 100000; | |
| const size_t max_string_length = 100000; |
|
|
||
| size_t max_string_length = 100000; | ||
| size_t written_size = 0; | ||
| unsigned char nested_param_string_allocator[100000]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| unsigned char nested_param_string_allocator[100000]; | |
| unsigned char nested_param_string_allocator[max_string_length]; |
Or is this a cpp feature and does not work for C code ?
| yaml_parser_delete(&parser); | ||
| }); | ||
|
|
||
| size_t max_string_length = 100000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| size_t max_string_length = 100000; | |
| const size_t max_string_length = 100000; |
|
|
||
|
|
||
| size_t written_size = 0; | ||
| char nested_param_string_allocator[100000]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| char nested_param_string_allocator[100000]; | |
| char nested_param_string_allocator[max_string_length]; |
might not work in C
Description
Adds support for YAML structures as a parameter type. Original GSOC proposal here. Essentially with a YAML file such as
The user will now able to access
minandmaxas individual parameters. These parameters will be available inrclcppas aYAML::Nodeor as adict()in Python. Therclspecific changes primarily include modifications torclparser that:rcl_variant_tas a C string (char *)map_depth) to determine when to stop writing to the YAML structureSupport for namespaced existing namespaced parameters is not affected. If required users will still be able to access individual parameters such as
passenger_size.min.x,passenger_size.max.x, etc.Fixes # (issue)
Is this user-facing behavior change?
Somewhat(?). The new changes will allow the user to define use new parameter types. Old methods of getting parameters still work
Did you use Generative AI?
No.
Additional Information
rclcppPR: [Draft]Add structured parameter support rclcpp#2944rclpyPR: [Draft]Add structured parameter support rclpy#1494rcl_interfacesPR: Add structured parameter support rcl_interfaces#183