# Working with ROS2 ## CLI ### Node #### Passing arguments ```bash ros2 run --ros-args -r := -r := ``` for example: ```bash ros2 run demo_nodes_cpp talker --ros-args -r __ns:=/demo -r __node:=my_talker -r chatter:=my_topic ``` will start `talker` node with name `my_talker` publishing on the topic named `my_topic` instead of the default of `chatter`. The namespace, which must start with a forward slash, is set to `/demo`, which means that topics are created in that namespace (`/demo/my_topic`), as opposed to globally (`/my_topic`). ### Launch #### Get available launch arguments ```bash ros2 launch --show-args ``` #### Passing launch arguments ```bash ros2 launch := ``` for example: ```bash ros2 launch turtlebot4_navigation slam.launch.py namespace:="/turtleX" ```