[Draft]Add structured parameter support#1254
Open
Rahul-K-A wants to merge 19 commits intoros2:rollingfrom
Open
[Draft]Add structured parameter support#1254Rahul-K-A wants to merge 19 commits intoros2:rollingfrom
Rahul-K-A wants to merge 19 commits intoros2:rollingfrom
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]>
This was referenced Aug 30, 2025
Author
|
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]>
|
jmachowinski
requested changes
Sep 18, 2025
Contributor
jmachowinski
left a comment
There was a problem hiding this comment.
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? |
Contributor
There was a problem hiding this comment.
Suggested change
| 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 |
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
Suggested change
| // 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; |
Contributor
There was a problem hiding this comment.
Suggested change
| 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]; |
Contributor
There was a problem hiding this comment.
Suggested change
| 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; |
Contributor
There was a problem hiding this comment.
Suggested change
| size_t max_string_length = 100000; | |
| const size_t max_string_length = 100000; |
|
|
||
|
|
||
| size_t written_size = 0; | ||
| char nested_param_string_allocator[100000]; |
Contributor
There was a problem hiding this comment.
Suggested change
| char nested_param_string_allocator[100000]; | |
| char nested_param_string_allocator[max_string_length]; |
might not work in C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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