VideoLibrary

Introduction to ROS Part 8: Using Parameters to Configure ROS 2 Nodes | DigiKey

ROS 2 Parameters are a powerful way to make your nodes flexible, reusable, and configurable without the need to rewrite or recompile your code. In this tutorial, we dive into how to declare, read, and update parameters in both Python and C++, giving you the tools to control your node behavior dynamically at runtime. The written guide for this episode can be found here: https://www.digikey.com/en/maker/tutorials/2025/intro-to-ros-part-8-using-parameters-to-configure-ros-2-nodes The GitHub repository containing the Docker image and example code for this series can be found here: https://github.com/ShawnHymel/introduction-to-ros You'll learn how to modify your publisher node to accept parameters like message and timer_period, allowing you to easily control what gets published and how frequently. This flexibility is essential for real-world robotics applications where conditions can change, and quick adjustments are needed. We start with a simple example in Python, showing you how to declare parameters and override them using command-line arguments. Then, we take it a step further by enabling dynamic updates while the node is running, which might be needed for tuning or during live deployment. Next, we translate the same logic into C++, using rclcpp to create equivalent parameter handling and callbacks. Whether you're a Python or C++ developer, this tutorial equips you with the foundational skills to write adaptable ROS 2 nodes that can be easily reused and fine-tuned across different robots or tasks. Subscribe and check out the full playlist to build your own robotic applications with confidence using ROS 2!

11/11/2025 7:17:41 PM