Available Now
Book a demo and get early access. Free trial!
In ROS 2, a parameter is a named piece of configuration data associated with a specific node. Unlike variables, which are internal to a program, parameters are part of a node’s public interface — meaning they can be declared, read, or updated even while the system is running. This makes them especially useful in simulation workflows like Isaac Sim, where you often need to tweak robot behavior, adjust sensor settings, or enable debug modes without restarting nodes or editing source code.
Parameters support several data types (e.g., integers, floats, strings, booleans) and are accessible via ROS 2 CLI tools, YAML files, or API calls in both Python (rclpy) and C++ (rclcpp). When used effectively, they let you make your nodes flexible, testable, and production-ready.
Unlike topics or services, which are about sending and receiving data between nodes, parameters are used to tune a node’s behavior at runtime without modifying code.
Think of them like adjustable knobs: Want to set the update rate for a sensor, change the robot's name, or swap out a motion planner on the fly? Use parameters.
In Isaac Sim, parameters let you simulate flexible behavior with minimal code changes. Since robot behaviors and sensor models often need tweaking (especially in iterative simulation), parameters provide an elegant way to update values mid-simulation or pre-configure nodes without hardcoding.
Let’s say you’re simulating a camera:
from rclpy.node import Node
class CameraSim(Node):
def __init__(self):
super().__init__('camera_sim')
self.declare_parameter('frame_rate', 30.0)
self.frame_rate = self.get_parameter('frame_rate').get_parameter_value().double_value
Now when you launch this node in Isaac Sim, you can tweak the frame_rate
parameter in a YAML file or even change it at runtime via CLI:
ros2 param set /camera_sim frame_rate 60.0
Book a demo and get early access. Free trial!