ROS Node Configuration - Final Proposal #3288
Replies: 7 comments 24 replies
-
There is a related discussion: https://github.com/orgs/autowarefoundation/discussions/3281 |
Beta Was this translation helpful? Give feedback.
-
@kasperornmeck Do you mean like this by this sentence? In that case, it may be a good point of compromise. flowchart TD
ParameterDefinitionFile[Parameter definition file\n with PickNik's format]
SampleParameterFile[Sample parameter file\nin autoware.universe]
RealParameterFile[Real parameter file\nin autoware_launch]
RuntimeLibrary[Runtime parameter-loading code]
Node[Node]
ParameterDefinitionFile -->|Generate| SampleParameterFile
ParameterDefinitionFile -->|Generate| RuntimeLibrary
SampleParameterFile --> |Copy the file, and modify it if nessary| RealParameterFile
SampleParameterFile --> |Load as default| Node
RealParameterFile --> |Load if overridden| Node
RuntimeLibrary -.-> |Not used| Node
|
Beta Was this translation helpful? Give feedback.
-
@kasperornmeck With the information from @mitsudome-r in https://github.com/orgs/autowarefoundation/discussions/3288#discussioncomment-5168427, I was able to clear my misunderstanding. However, I have several concerns then.
I understood that your proposal only loads the parameters online, not validates them. It can be permissible for a while, but in the future, we need some validations to ensure system quality.
When we copy parameter files from version: '1.0' // Not used
ros__parameters:
range: {
type: int, // Not used
default_value: 90,
description: "The range of the 2D grid with respect to the origin", // Not used
validation: {
bounds<>: [MIN_VALUE, MAX_VALUE] // Not used
}
} If you write as follows, it's not so redundant but a little weird. ros__parameters:
range: {
default_value: 90,
} Therefore, we'd like to consider other alternatives as well. |
Beta Was this translation helpful? Give feedback.
-
@kasperornmeck cc @mitsudome-r @xmfcx First, I think your primary purposes are the following two.
For 1, it's enough if we put a parameter definition file aside from the existing normal parameter files. For 2, it can also be done with other solutions such as autowarefoundation/autoware.universe#2945 or using PickNik's library. Therefore, we'd like to propose another approach: start just newly placing PickNik's parameter definition files. (No need to use the generated parameter library code.) The approach has several advantages.
Of course, it's possible to generate documentation from the definition files if we develop a tool. That's the overview of our proposal. |
Beta Was this translation helpful? Give feedback.
-
Edit: accidentally put the a comment as a new reply. |
Beta Was this translation helpful? Give feedback.
-
@kasperornmeck This is our proposal. Is it clear to you? Our purposes:
TIER IV's proposal:
What we need to do for the proposal:
|
Beta Was this translation helpful? Give feedback.
-
New updated discussion #3325. |
Beta Was this translation helpful? Give feedback.
-
The Open AD Kit WG is working on improving the process of improving how to configure the ROS node parameters. Gathered from discussions and meetings the following final proposal has been made. We will discuss this in the Open AD Kit meeting on Wed March 1st, so if you cannot attend, please comment here. Thanks!
DevOps Dojo: ROS Node Configuration - Final Proposal
Background
DevOps: Ros Node Configuration addresses the topic of how ROS nodes are configured. Guidelines, documentation and changes to the parameter files and ROS nodes will be made, based on best-practices from cloud-native and software defined development methodologies.
How to configure ROS nodes is non-differentiating, and creating alignment in the AWF community will allow developers and users of Autoware to become more productive as less time will be spent on trivial tasks.
ROS parameter file
The ROS parameter file layout which will be adopted in Autoware is inspired by PickNikRobotics generate parameter library. Please note, the library as a whole will not be adopted as this is quite an invasive change. At the same time, by adopting their parameter file layout, no doors are being closed.
Each ROS node has a single-source parameter file which avoids the uncertainty of where a parameter is declared. The parameter file will:
There needs to be a 1-to-1 match between declarations and parameters. All parameters listed in ROS configuration file must be declared in the ROS node, and no parameters may be listed in the parameter file which aren't declared in the ROS node.
Naming convention and file path
Attributes
All parameters have the following attributes:
These attributes should be populated for all parameters in the parameter file.
Layout
We will use lidar_apollo_segmentation_tvm_nodes as an example and as a base for our modifications. In addition to the attributes listed in the previous section, the parameter file should be version-controlled.
To see the changes made, view the original test.param.yaml #L4. Note that only range has been moved to the new format and that the proper file name would be lidar_apollo_segmentation_tvm.param.yaml.
ROS node declare parameter
The new parameter file layout requires minor modifications to how declare_parameter(...) is used today. If declare_parameter(...) has no default_value. It throws an exception, which is desirable as it enforces the parameter file to contain the declared parameter.
We'll be using lidar_apollo_segmentation_tvm_node.cpp #L43 as the example to show the required change.
Parameter types
The parameter types handled by
declare_parameter
origin from the definitions in ParameterValue.msg. Those map as:PARAMETER_BOOL
bool
PARAMETER_INTEGER
int64_t
PARAMETER_DOUBLE
double
PARAMETER_STRING
std::string
PARAMETER_BYTE_ARRAY
std::vector<unsigned char>
PARAMETER_BOOL_ARRAY
std::vector<bool>
PARAMETER_INTEGER_ARRAY
std::vector<int64_t>
PARAMETER_DOUBLE_ARRAY
std::vector<double>
PARAMETER_STRING_ARRAY
std::vector<std::string>
Which can be used in the code with the following pattern:
For clarity, it is important to stick to using only one of those predefined types in the template. Although using a different type compiles just fine (for example,
rclcpp
correctly infers thatint32_t
should map toPARAMETER_INTEGER
, but the returned value is still anint64_t
), it is misleading and could lead developers to make assumptions that result in unexpected runtime behaviors.Notice that we need to add
.defalt_value
in thedeclare_parameter(...)
function in order to match the new YAML layout of the parameter file.Edit:
bounds
replaced withvalidation
under parameter attributes.Edit 2:
version: '1.0'
removed from the parameter file layout, as it isn't compatible with launching the node.Edit 3:
int
replaced withint64_t
in example parameter file to be comply with the allowed parameter types.Beta Was this translation helpful? Give feedback.
All reactions