Parameters
Each node has parameters. Parameters are ways for external processes or people to tweak the node. In MC-ONE, parameters are typically managed by the robot engineer using the Monitor.
Parameters can be accessed in various ways:
- through the command line, using
ros2 param ... - by passing them to the node executable as
--ros-args - using
RQt - using the Monitor
Command-line Interface
Access to parameters via the command-line interface works as follows:
- List All Parameters:
ros2 param list - List All Parameter of a Node:
ros2 param list <node> - Describe a Parameter:
ros2 param describe <node> <parameter> - Get a Parameter Value:
ros2 param get <node> <parameter> - Set a Parameter Value:
ros2 param set <node> <parameter> <value> - Dump All Parameters of a Node:
ros2 param dump <node>
A detailed description of the command-line interface can be found at https://docs.ros.org/en/jazzy/How-To-Guides/Using-ros2-param.html.
Note: With the MC-ONE Stack it's not possible to create or delete parameters on the fly.
Passing Parameters via --ros-args
When starting a node, you can pass parameters using the command-line interface:
ros2 run <package> <node> --ros-args -p <parameter>:=<value>
Or load a YAML-file with several parameters:
ros2 run <package> <node> --ros-args --params-file <file>.yaml
Note that system persistence via the Monitor overwrites parameter values specified by using --ros-args or --params-file.
A more detailed description can be found at https://docs.ros.org/en/jazzy/How-To-Guides/Node-arguments.html.
Using RQt
RQt is a UI framework with a bunch of plugins to view and edit almost anything in a running ROS2 system. One of the components is a parameter editor you can use to interact with the parameters of a node.
A more detailed description can be found at https://wiki.ros.org/rqt.
Using the Monitor
All parameters in the system are presented on the Monitor parameter page as well. They can be edited there, and are persistent.