In the previous chapter, we created a parameter node with two configurable parameters:
simple_int_param → default value 23simple_string_param → default value "lavitra"In this chapter, we will interact with those parameters directly from the ROS 2 command line.
We will learn how to:

Before running our ROS 2 node, we need to source the workspace.
Open a terminal and go to your workspace:
cd bumperbot_ws
Then source the workspace:
. install/setup.bash

Now we can start the parameter node that we created in the previous chapter.
For the Python implementation, run:
ros2 run bumperbot_py_examples simple_parameter
The command follows this structure:
ros2 run <package_name> <executable>
In our case:
ros2 run │ ├── bumperbot_py_examples │ ↓ │ package name │ └── simple_parameter ↓ executable
So:
ros2 run bumperbot_py_examples simple_parameter
starts the simple_parameter node from the bumperbot_py_examples package.
Keep this terminal running. We will use another terminal to interact with the parameters.

Open a new terminal. ctrl+O
Source the workspace again:
cd bumperbot_ws. install/setup.bash
Now run:
ros2 param list
It shows the parameters available for the currently running ROS 2 nodes.

Now that we know the parameter exists, we can read its current value.
Use:
ros2 param get /simple_parameter simple_int_param
You should see that the current value is 23
ros2 param getLet’s break the command down:
ros2 param get /simple_parameter simple_int_param
ros2 param get │ ├── /simple_parameter │ ↓ │ Node │ └── simple_int_param ↓ Parameter
So the command means:
Get the value of
simple_int_paramfrom the/simple_parameternode.
The general syntax is:
ros2 param get <node_name> <parameter_name>

Press Ctrl+c to stop the running simple_parameter node.

Now start it again, but this time set simple_int_param to 30:
ros2 run bumperbot_py_examples simple_parameter --ros-args -p simple_int_param:=30
--ros-args and -pThe command contains two important parts:
--ros-args
and:
-p simple_int_param:=30
--ros-argsThis tells ROS 2 that additional ROS-specific arguments are being provided.
-pThe -p option is used to provide a parameter value.
So:
-p simple_int_param:=30
means:
Set
simple_int_paramto30when starting the node.
The complete command therefore means:
Start simple_parameter │ ▼Use ROS arguments │ ▼Set simple_int_param │ ▼30

The node is now running again, but this time:
simple_int_param = 30
We can verify it from another terminal.
Run:
ros2 param get /simple_parameter simple_int_param

We can read it using:
ros2 param get /simple_parameter simple_string_param
The command follows the same structure:
ros2 param get <node> <parameter>
One of the most useful features of ROS 2 parameters is that we do not necessarily need to restart the node to change a parameter.
We can change a parameter while the node is already running.
For example, let’s change:
simple_string_param
from:
lavitra
to:
tech_arcanist
Use:

ros2 param set /simple_parameter simple_string_param "tech_arcanist"
The general syntax is:
ros2 param set <node_name> <parameter_name> <new_value>
Therefore, the running node prints a message similar to:
[INFO] [simple_parameter]:Param simple_string_param changed!New value is tech_arcanist