DevOps Dojo: ROS Node Configuration - Final3 Proposal #3371
Replies: 4 comments 7 replies
-
Does it mean the param.yaml files will be removed from individual packages?
I thought |
Beta Was this translation helpful? Give feedback.
-
To discuss in meeting March 30th. I forgot to take Fatih's reason why not to define the node name in the files into account, see https://github.com/orgs/autowarefoundation/discussions/3325#discussioncomment-5406333. This is a good motivation why we would keep the |
Beta Was this translation helpful? Give feedback.
-
Notes from Open AD Kit meeting on March 30thThe AWF community has one week to object to the Final3 Proposal. If there are no objections, then the proposal is officially approved and execution phase can begin. This will be discussed in the March 6th meeting. Tasks to be done in other dojos:
|
Beta Was this translation helpful? Give feedback.
-
Final3 Proposal has been approved (Open AD Kit meeting on April 6th)! |
Beta Was this translation helpful? Give feedback.
-
The Open AD Kit WG is working on improving the process of how to configure the ROS nodes. Gathered from discussions and meetings the following Final3 Proposal has been made.
DevOps Dojo: ROS Node Configuration - Final3 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.
Schema
Each ROS package/node has a schema which describes the node's parameters. The schema will:
*.param.yaml
and itself (i.e.,*.schema.json
) files as part of the CI*.param.yaml
file and all must pass the schema's requirementsThere needs to be a 1-to-1 match between the schema and the parameters. All parameters listed in the schema 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
The JSON Schema validates the parameters in the parameter file. Some attributes are required and some are optional. The optional attributes are encouraged when applicable.
Required
Optional
Layout
We will use lidar_apollo_segmentation_tvm_nodes as an example and as a base for our modifications. Below is the schema for the node, however not complete, it only has one parameter
range
.Parameter file
The schema will be used to validate the parameter file. The layout below will be used, which is very similar to the layout which is currently used, e.g., see Lidar Apollo Segmentation TVM Nodes parameter file.
Please note that the parameter file is validated by the schema and it contains all parameters'
name
and its correspondingdefault
value as required by the schema.Naming convention and file path
ROS node declare parameter function
The default_value in declare_parameter(...) should not be used. If no default_value is provided, the function 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, 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, see the table in the section below. 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.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<uint8_t>
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>
Example of schema in VSC
I created a short video with a practical example in VSC using the following extensions:
This allows a developer to easily create a new parameter configuration file. Find example video here.
Edits
Edit:
PARAMETER_BYTE_ARRAY
fromunsigned char
touint8_t
Edit2:
*.param.yaml
fileEdit3:
lidar_apollo_segmentation_tvm_nodes
with/**
Edit4:
*.schema.yaml
using JSON Schema in CIEdit5:
Beta Was this translation helpful? Give feedback.
All reactions