ROS Node Configuration - Final2 Proposal #3325
Replies: 5 comments 41 replies
-
@kasperornmeck Thank you for summarizing it. I have one small favor for you. This is because any improvement should be allowed as long as it doesn't interfere with the freedom of Open AD Kit WG and any others. I ask for your understanding of that. 🙇 |
Beta Was this translation helpful? Give feedback.
-
I also carry my suggestion using JSON Schema here under this proposal. If we use JSON Schema rather than modified Picknik format, we can also use a large set of tooling without much effort:
Those are all excellent practices for cloud-native development. Using a well-adopted format and suggesting it to the ROS community would be better for the cloud-native development of robotics, which aligns with Open AD Kit objectives. I think this is what we are interested in under this working group. |
Beta Was this translation helpful? Give feedback.
-
There are a few style details for writing schemas. Please find an example param+schema configuration for Some style choices I have made:
|
Beta Was this translation helpful? Give feedback.
-
@kenji-miyake @mitsudome-r @doganulus I've been catching up on the discussion and I thank everyone involved for their engagement! Below I've listed the scope for the parameter definition file.
I think the focus when determining the file format should be on how suitable it is in the context in which it'll be used. The ROS community uses I would like for us to move on to the execution phase and start working on other dojos, we have lots of fun tasks to get done! I hope and wish that we can come to an agreement soon. |
Beta Was this translation helpful? Give feedback.
-
New proposal found here: https://github.com/orgs/autowarefoundation/discussions/3371. |
Beta Was this translation helpful? Give feedback.
-
The Open AD Kit WG is working on improving the process of how to configure the ROS node parameters. Gathered from discussions and meetings the following Final2 Proposal has been made. Thanks!
DevOps Dojo: ROS Node Configuration - Final2 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 definition file
The ROS parameter definition 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 description file which avoids the uncertainty of where a parameter is declared. The parameter description file will:
config
folder during buildThere 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.
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>
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.
Generated parameter file
The parameter description file will be used to generate the parameter file. The layout below will be used, which is the same layout which is currently used, e.g., see Lidar Apollo Segmentation TVM Nodes Parameter File.
Please note that this parameter file is automatically generated and only contains
name
and its correspondingdefault_value
. The parameter file path is:ROS node declare parameter function
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, 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.Edit: Added link to https://github.com/PickNikRobotics/generate_parameter_library#built-in-validators for possible validators
Beta Was this translation helpful? Give feedback.
All reactions