  * ` Topic ` : Selects the image topic to visualize from the list of available images in the combo box
  * ` Depth ` : The depth of the incoming message queue
  * ` History policy ` : Set the QoS history policy. ` Keep Last ` is suggested for performance and compatibility
  * ` Reliability Policy ` : Set the QoS reliability policy. ` Best Effort ` is suggested for performances, ` Reliable ` is used for compatibility
  * ` Durability Policy ` : Set the QoS durability policy. ` Volatile ` is suggested for compatibility


     try:
                keys = og.Controller.Keys
                (self._clock_graph, _, _, _) = og.Controller.edit(
                    {
                        "graph_path": "/ROS_Clock",
                        "evaluator_name": "push",
                        "pipeline_stage": og.GraphPipelineStage.GRAPH_PIPELINE_STAGE_ONDEMAND,
                    },
                    {
                        keys.CREATE_NODES: [
                            ("OnTick", "omni.graph.action.OnTick"),
                            ("readSimTime", "omni.isaac.core_nodes.IsaacReadSimulationTime"),
                            ("publishClock", "omni.isaac.ros_bridge.ROS1PublishClock"),
                        ],
                        keys.CONNECT: [
                            ("OnTick.outputs:tick", "publishClock.inputs:execIn"),
                            ("readSimTime.outputs:simulationTime", "publishClock.inputs:timeStamp"),
                        ],
                    },
                )
            except Exception as e:
                print(e)
                simulation_app.close()
                exit()


- #### Option 3: Build from source
  - Download the latest [Intel® RealSense™ SDK 2.0](https://github.com/IntelRealSense/librealsense/releases/tag/v2.53.1)
  - Follow the instructions under [Linux Installation](https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md)


  - Build
   ```bash
   colcon build
   ```


4. Lastly, I want to publish various sensor topic ( imu, camera, lidar ). In this case, **Can i get it at a fixed fps for each topic? ( like camera = 30 fps, IMU = 110hz )**


<details>
  <summary>
    Step 1: Install the ROS2 distribution
  </summary>

- #### Windows 10/11


* Add the wrapper:
  ```bash
  ros2 component load /ComponentManager realsense2_camera realsense2_camera::RealSenseNodeFactory -e use_intra_process_comms:=true
  ```
  Load other component nodes (consumers of the wrapper topics) in the same way.


### Example
- If user have multiple cameras (might be of the same model) and multiple robots then user can choose to launch/run his nodes on this way.
- For the first robot and first camera he will run/launch it with these parameters:
  - camera_namespace:
    - robot1
  - camera_name
    - D455_1

  - With ros2 launch (via command line or by editing these two parameters in the launch file):

  ```ros2 launch realsense2_camera rs_launch.py camera_namespace:=robot1 camera_name:=D455_1```

  - With ros2 run (using remapping mechanisim [Reference](https://docs.ros.org/en/humble/How-To-Guides/Node-arguments.html)):

  ```ros2 run realsense2_camera realsense2_camera_node --ros-args -r __node:=D455_1 -r __ns:=robot1```


These callbacks are executed when the subscriber node receives a message of
type ` sensor_msgs/Image ` that matches the subscribed topic. The parameter of
the callback is a ` std::shared_ptr ` to the received message. This means you
don’t have to worry about memory management. The callback code is very simple
and demonstrates how to access the fields in a message; in this case, the `
height ` and ` width ` of the image and the topic timestamp.


Thank you so much for reading. If anyone knows, Please reply me… !!


        // https://github.com/ros2/ros2/wiki/About-Quality-of-Service-Settings

        rclcpp::QoS video_qos(10);
        video_qos.keep_last(10);
        video_qos.best_effort();
        video_qos.durability_volatile();

        // Create right image subscriber
        auto right_sub = g_node->create_subscription<sensor_msgs::msg::Image>(
                    "right_image", video_qos, imageRightRectifiedCallback );

        // Create left image subscriber
        auto left_sub = g_node->create_subscription<sensor_msgs::msg::Image>
                ("left_image", video_qos, imageLeftRectifiedCallback );

        // Let the node run
        rclcpp::spin(g_node);

        // Shutdown when the node is stopped using Ctrl+C
        rclcpp::shutdown();

        return 0;
    }


[ @phr0201 ](/u/phr0201) Are you using isaac-sim.sh or python.sh +
SImulationApp?
There are different ways of fixing the rendering FPS based on the simulation
method.


#### Parameters that cannot be changed in runtime:
- **serial_no**:
  - will attach to the device with the given serial number (*serial_no*) number.
  - Default, attach to the first (in an inner list) RealSense device.
  - Note: serial number should be defined with "_" prefix.
    - That is a workaround until a better method will be found to ROS2's auto conversion of strings containing only digits into integers.
  - Example: serial number 831612073525 can be set in command line as `serial_no:=_831612073525`.
- **usb_port_id**:
  - will attach to the device with the given USB port (*usb_port_id*).
  - For example: `usb_port_id:=4-1` or `usb_port_id:=4-2`
  - Default, ignore USB port when choosing a device.
- **device_type**:
  - will attach to a device whose name includes the given *device_type* regular expression pattern.
  - Default, ignore device type.
  - For example:
    - `device_type:=d435` will match d435 and d435i.
    - `device_type=d435(?!i)` will match d435 but not d435i.
- **reconnect_timeout**:
  - When the driver cannot connect to the device try to reconnect after this timeout (in seconds).
  - For Example: `reconnect_timeout:=10`
- **wait_for_device_timeout**:
  - If the specified device is not found, will wait *wait_for_device_timeout* seconds before exits.
  - Defualt, *wait_for_device_timeout < 0*, will wait indefinitely.
  - For example: `wait_for_device_timeout:=60`
- **rosbag_filename**:
  - Publish topics from rosbag file. There are two ways for loading rosbag file:
   * Command line - ```ros2 run realsense2_camera realsense2_camera_node -p rosbag_filename:="/full/path/to/rosbag.bag"```
   * Launch file - set ```rosbag_filename``` parameter with rosbag full path (see ```realsense2_camera/launch/rs_launch.py``` as reference)
- **initial_reset**:
  - On occasions the device was not closed properly and due to firmware issues needs to reset.
  - If set to true, the device will reset prior to usage.
  - For example: `initial_reset:=true`
- **base_frame_id**: defines the frame_id all static transformations refers to.
- **clip_distance**:
  - Remove from the depth image all values above a given value (meters). Disable by giving negative value (default)
  - For example: `clip_distance:=1.5`
- **linear_accel_cov**, **angular_velocity_cov**: sets the variance given to the Imu readings.
- **hold_back_imu_for_frames**: Images processing takes time. Therefor there is a time gap between the moment the image arrives at the wrapper and the moment the image is published to the ROS environment. During this time, Imu messages keep on arriving and a situation is created where an image with earlier timestamp is published after Imu message with later timestamp. If that is a problem, setting *hold_back_imu_for_frames* to *true* will hold the Imu messages back while processing the images and then publish them all in a burst, thus keeping the order of publication as the order of arrival. Note that in either case, the timestamp in each message's header reflects the time of it's origin.
- **publish_tf**:
  - boolean, enable/disable publishing static and dynamic TFs


You will need to launch a component container and launch our node as a component together with other component nodes. Further details on "Composing multiple nodes in a single process" can be found [here](https://docs.ros.org/en/rolling/Tutorials/Composition.html).


If you want to Publish at an increased rate that is possible in certain
circumstances. For example to publish a simulation clock message every physics
step you can take a look at
standalone_examples/api/omni.isaac.quadruped/go1_ros1_standalone.py


Copyright © 2024 NVIDIA Corporation


* Semantic labels


* It is also helpful to have some basic understanding of [ ROS topics ](http://wiki.ros.org/ROS/Tutorials/UnderstandingTopics) and how [ publisher and subscriber ](http://wiki.ros.org/ROS/Tutorials/ExaminingPublisherSubscriber) works.


The ` main ` function is divided in two main parts:


## Post-Processing Filters


##  7.2.3.4.  Depth and other Perception Ground Truth data  


Use ` ros2  topic  echo  /<topic> ` to see the raw information that is being
passed along.


  * [ What Is Isaac Sim? ](../index.html)
  * [ Release Notes ](../release_notes.html)
  * [ Installation ](../installation/index.html)
  * [ Tips & Useful Links ](../reference_material/reference_tips.html)
  * [ Isaac Sim Conventions ](../reference_conventions.html)
  * [ Useful Shortcuts ](../shortcuts.html)
  * [ Previous Documentation ](../old_docs.html)
  * [ Isaac Sim Forums ](../isaac_sim_forums.html)


It is important that the two subscriptions use a QOS profile compatible with
the QOS profile of the publisher of the topics.


If your depth image only shows black and white sections, it is likely due to
somewhere in the field of view has “infinite” depth and skewed the contrast.
Adjust your field of view so that the depth range in the image is limited.


You may want to open additional Viewports to see multiple camera views at the
same time. To open additional Viewports: _Window - > Viewport -> Viewport 2 _
to open the viewport, and select the desired camera view from the _Cameras_
button on the upper left corner in the viewport.


An example of publishing multiple Rostopics for multiple cameras can be found
in our asset ` Isaac/Samples/ROS2/Scenario/turtlebot_tutorial.usd  ` .


* BoundingBox 2D Tight


* Node components are currently not supported on RCLPY
* Compressed images using `image_transport` will be disabled as this isn't supported with intra-process communication


  Tweaking the Disparity Parameters

You can use the ` rqt_reconfigure ` package to quickly experiment with various
parameters used by the ` disparity_node ` :

    ros2 run rqt_reconfigure rqt_reconfigure

In the example below, I changed the ` speckle_size ` parameter from ` 100 ` to
` 1000 ` . You can tweak the parameters to try and get your Disparity Map

speckle_range = 100

speckle_range = 1000

I wasn’t able to get a ` DisparityImage ` as “nice looking” as the one in [
this guide
](http://wiki.ros.org/stereo_image_proc/Tutorials/ChoosingGoodStereoParameters)
, so be patient and try a several variations of parameters. That guide does
give some information of how the Block Matching algorithm works though I
wonder if today’s cameras have more pixels and make it more difficult for the
block matching algorithm to work. As I don’t have a proper housing for my two
cameras (just some cardboard), small variations in the positions of the
cameras will have noticeable consequences in the ` DisparityImage ` and later
the Point Cloud.

Here is an example of a disparity image of my work out stand:

[ https://images-na.ssl-images-amazon.com/images/I/41fdlbMpO2L.jpg
](https://images-na.ssl-images-amazon.com/images/I/41fdlbMpO2L.jpg)


1. Open Visual Scripting: _Window > Visual Scripting > Action Graph _ .


<hr>


  ROS Wrapper for Intel(R) RealSense(TM) Cameras

  Latest release notes


[ Docs Home  ](https://www.stereolabs.com/docs/)


### Default behavior if non of these parameters are given:
  - camera_namespace:=camera
  - camera_name:=camera


And then, **What should i do if i want to get the fixed fps of camera topic
using ros2 in isaac sim?**
Now I am using the **omnigraph** for getting the ros topics ( camera, imu,
lidar etc ).
And also **when the scene is more complicated or I open multiple viewport, FPS
decreased.**


  Create a Disparity Map (DisparityImage)

Make sure to update both of your Camera nodes to use the ` --param
--camera_info_path:={left|right}-camera.ini ` .

After updating the camera info settings, run the disparity node which will
create ` DisparityImage ` on the ` /disparity ` topic. I created a yaml file
to store parameters but you can also use command line args

    ros2 run stereo_image_proc disparity_node --ros-args --params-file disparity-params.yaml

Then, check the outputs:

    $ ros2 topic list
    /disparity
    /left/camera_info
    /left/image_rect
    /parameter_events
    /right/camera_info
    /right/image_rect
    /rosout$ ros2 topic info /disparity
    Type: stereo_msgs/msg/DisparityImage
    Publisher count: 1
    Subscription count: 0

Now, you can view the ` DisparityImage ` using the ` disparity_view ` node:

    ros2 run image_view disparity_view --ros-args --remap image:=/disparity

a not-so-functional disparity image


In this tutorial, you will learn how to configure your own RVIZ2 session to
see only the video data that you require.


[
![../_images/isaac_tutorial_ros2_camera_graph.png](../_images/isaac_tutorial_ros2_camera_graph.png)
](../_images/isaac_tutorial_ros2_camera_graph.png)


Parameters:


[ How to publish the camera topic at a fixed FPS?
](https://forums.developer.nvidia.com/t/how-to-publish-the-camera-topic-at-a-
fixed-fps/231509/2)


- #### Option 1: Install librealsense2 debian package from Intel servers
  - Jetson users - use the [Jetson Installation Guide](https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_jetson.md)
  - Otherwise, install from [Linux Debian Installation Guide](https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md#installing-the-packages)
    - In this case treat yourself as a developer: make sure to follow the instructions to also install librealsense2-dev and librealsense2-dkms packages

- #### Option 2: Install librealsense2 (without graphical tools and examples) debian package from ROS servers (Foxy EOL distro is not supported by this option):
  - [Configure](http://wiki.ros.org/Installation/Ubuntu/Sources) your Ubuntu repositories
  - Install all realsense ROS packages by ```sudo apt install ros-<ROS_DISTRO>-librealsense2*```
    - For example, for Humble distro: ```sudo apt install ros-humble-librealsense2*```


The following is a brief explanation of the source code above:


[ NVIDIA Developer Forums ](/)


* Completed [ ROS & ROS 2 Installation  ](../installation/install_ros.html#isaac-sim-app-install-ros) : installed ROS2, enabled the ROS2 extension, built the provided _Isaac Sim_ ROS2 workspace, and set up the necessary environment variables .


  * [ Main Concepts ](../reference_glossary.html)
  * [ Sensor Axes Representation (LiDAR, Cameras) ](../concepts/cameras/index.html)
  * [ Motion Generation ](../concepts/motion_generation/index.html)
  * [ Python Environment ](../manual_standalone_python.html)


# ROS1 and ROS2 Legacy


[ ](https://github.com/stereolabs "GitHub") [
](https://www.linkedin.com/company/stereolabs "LinkedIn") [
](https://twitter.com/stereolabs3d "X \(Twitter\)") [
](https://www.youtube.com/Stereolabs3d "YouTube")


There are also additional options mentioned here if you want to reduce the
publishing rate by a fixed multiple.


The two ` auto ` variables ` right_sub ` and ` left_sub ` are two `
rclcpp::Subscription ` objects.


> Node
>
> |
>
> Input Field
>
> |
>
> Value
>
> ---|---|---
>
> Isaac Create Render Product
>
> |
>
> cameraPrim
>
> |
>
> /World/Camera_1
>
> enabled
>
> |
>
> True
>
> ROS2 Camera Helper
>
> |
>
> type
>
> |
>
> rgb
>
> topicName
>


If you properly followed the [ ROS 2 Examples Installation Guide
](https://github.com/stereolabs/zed-ros2-examples#build-the-package) , the
executable of this tutorial has been compiled and you can run the subscriber
node using this command:


* **ROS2 Camera Helper** : Indicating which type of data to publish, and which rostopic to publish it on.


Each of the above filters have it's own parameters, following the naming convention of `<filter_name>.<parameter_name>` including a `<filter_name>.enable` parameter to enable/disable it.


<hr>


1 Like


## Available services

- device_info : retrieve information about the device - serial_number, firmware_version etc. Type `ros2 interface show realsense2_camera_msgs/srv/DeviceInfo` for the full list. Call example: `ros2 service call /camera/camera/device_info realsense2_camera_msgs/srv/DeviceInfo`


Share

#  Background

The ROS [ image_pipeline packages ](http://wiki.ros.org/image_pipeline)
provides several tools to help with computer vision. In particular, they
provide ROS2 nodes to help get stereo vision working. This blog post will
detail how to setup this image pipeline and cover some of the issues I faced
along the way.

While you may be able to read and apply this blog post without much prior
knowledge of ROS, I would highly recommend [ the “Beginner: CLI” and
“Beginner: Client Libraries” tutorials
](https://index.ros.org/doc/ros2/Tutorials/) to learn more about how packages
work in ROS2. I understood where to look for answers to my questions and it
was worth the effort (maybe ~4 hours total).

#  Getting Started: Viewing One Camera

Using a camera seems like pretty common task. I figured the first step here is
to find the canonical usb camera library and see if I can publish the picture
to a topic. This proved to be a bit more complicated than I originally
imagined. Here are a few of the libraries I found:

  * camera from demos ( [ cam2image ](https://github.com/ros2/demos/blob/master/image_tools/src/cam2image.cpp) , OpenCV)
  * usb_cam (libav) [ https://github.com/ros-drivers/usb_cam.git ](https://github.com/ros-drivers/usb_cam.git)
  * libuvc_camera (libuvc) [ http://wiki.ros.org/libuvc_camera ](http://wiki.ros.org/libuvc_camera)
  * ros2_usb_camera (OpenCV) [ https://github.com/klintan/ros2_usb_camera ](https://github.com/klintan/ros2_usb_camera)
  * opencv_cam (OpenCV) [ https://github.com/clydemcqueen/opencv_cam ](https://github.com/clydemcqueen/opencv_cam)

My main concern was compatibility with ROS2 and I didn’t want to fuss with the
build system too much. I ended up choosing the opencv_cam project. I haven’t
faced any issues with it during the project and will likely continue using it.
If you don’t want to install a new package, you can experiment with the `
cam2image ` node though I am not sure it is compatible with the later stages
in this project.

The first step is to create a new workspace and clone the the image_pipeline
and image_common repositories:


    mkdir test_ws
    cd test_ws
    mkdir src
    cd src
    git clone <https://github.com/ros-perception/image_pipeline.git>
    git clone <https://github.com/ros-perception/image_common.git>
    git clone <https://github.com/clydemcqueen/opencv_cam.git>
    git clone https://github.com/ptrmu/ros2_shared.git

You’ll want to make sure you are using the branch specific to your ROS
distribution (though I am not sure there will be any incompatibility in
message formats if the core APIs are stable).

In the root directory of the project, you can now compile and see what is
available to run

    colcon build
    ros2 pkg executables

Next, find possible video devices:

    ls /dev/video*
    /dev/video0  /dev/video1  /dev/video2  /dev/video3  /dev/video4  /dev/video5

Note that Linux may create multiple video devices for one camera. In my case,
I have a Logitech BRIO that exposes 4 different video devices. The camera I am
using in this example will be one I bought on eBay a while back. It looks
similar to [ this one ](https://www.ebay.com/itm/5-Megapixel-USB-Camera-
Module-For-Raspberry-Pi-Windows-System-2-8mm-Lens-
Webcams/324142186249?hash=item4b78613f09%3Ag%3ANqUAAOSw5P9bAoGH) . In the
example above, ` /dev/video{4,5} ` are from this USB camera. We will use these
numbers as device ids for our camera node. You may need to try with various
index params


* Completed [ URDF Import: Turtlebot  ](tutorial_ros2_turtlebot.html#isaac-sim-app-tutorial-ros2-turtlebot) so that there is a Turtlebot ready on stage.


  **Please choose only one option from the two options below (in order to prevent multiple versions installation and workspace conflicts)**

  - Manual install from ROS2 formal documentation:
    - [ROS2 Iron](https://docs.ros.org/en/iron/Installation/Windows-Install-Binary.html)
    - [ROS2 Humble](https://docs.ros.org/en/humble/Installation/Windows-Install-Binary.html)
    - [ROS2 Foxy](https://docs.ros.org/en/foxy/Installation/Windows-Install-Binary.html)
  - Microsoft IOT binary installation:
    - https://ms-iot.github.io/ROSOnWindows/GettingStarted/SetupRos2.html
    - Pay attention that the examples of install are for Foxy distro (which is not supported anymore by RealSense ROS2 Wrapper)
	- Please replace the word "Foxy" with Humble or Iron, depends on the chosen distro.
</details>

<details>
  <summary>
    Step 2: Download RealSense™ ROS2 Wrapper and RealSense™ SDK 2.0 source code from github:
  </summary>

- Download Intel® RealSense™ ROS2 Wrapper source code from [Intel® RealSense™ ROS2 Wrapper Releases](https://github.com/IntelRealSense/realsense-ros/releases)
- Download the corrosponding supported Intel® RealSense™ SDK 2.0 source code from the **"Supported RealSense SDK" section** of the specific release you chose fronm the link above
- Place the librealsense folder inside the realsense-ros folder, to make the librealsense package set beside realsense2_camera, realsense2_camera_msgs and realsense2_description packages
</details>

<details>
  <summary>
    Step 3: Build
  </summary>

1. Before starting building of our packages, make sure you have OpenCV for Windows installed on your machine. If you choose the Microsoft IOT way to install it, it will be installed automatically. Later, when colcon build, you might need to expose this installation folder by setting CMAKE_PREFIX_PATH, PATH, or OpenCV_DIR environment variables
2. Run "x64 Native Tools Command Prompt for VS 2019" as administrator
3. Setup ROS2 Environment (Do this for every new terminal/cmd you open):
    - If you choose the Microsoft IOT Binary option for installation
      ```
	  > C:\opt\ros\humble\x64\setup.bat
	  ```

    - If you choose the ROS2 formal documentation:
      ```
	  > call C:\dev\ros2_iron\local_setup.bat
	  ```
4.  Change directory to realsense-ros folder


Make sure to source your ROS 2 installation from the terminal before running
Isaac Sim. If sourcing ROS 2 is a part of your ` bashrc  ` then Isaac Sim can
be run directly.


Thank you


We declared two subscribers: one for the left rectified image and one for the
right rectified image.


## Parameters


Where a specific graph like


    $ ros2 topic list
    /camera_info
    /image_raw
    /parameter_events
    /rosout$ ros2 topic info /camera_info
    Type: sensor_msgs/msg/CameraInfo
    Publisher count: 1
    Subscription count: 0$ ros2 topic echo  /camera_info
    header:
      stamp:
        sec: 1610066349
        nanosec: 815620490
      frame_id: camera_frame
    height: 720
    width: 1280
    distortion_model: plumb_bob
    d:
    - -0.35072
    - 0.105506
    - -0.002266
    - -0.001482
    - 0.0
    ...

#  Stereo Vision

The guide above is useful for calibrating **one** camera. The process for two
cameras is similar but will yield a slightly different ` CameraInfo ` object.
If you look closely at the description for the ` Projection/camera matrix `
part of the ` CameraInfo ` , you’ll see the fourth column which describes the
disparity between the two cameras:

> # For a stereo pair, the fourth column [Tx Ty 0]’ is related to the
>  # position of the optical center of the second camera in the first
>  # camera’s frame. We assume Tz = 0 so both cameras are in the same
>  # stereo image plane. The first camera always has Tx = Ty = 0. For
>  # the right (second) camera of a horizontal stereo pair, Ty = 0 and
>  # Tx = -fx’ * B, where B is the baseline between the cameras.

Unfortunately, I made the mistake of calibrating the cameras individually


---------------------clap_footer-----------)

\--

[
](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fvote%2Fp%2F3b18903e7329&operation=register&redirect=https%3A%2F%2Fjeffzzq.medium.com%2Fros2-image-
pipeline-
tutorial-3b18903e7329&user=Jeff+Gensler&userId=44bf324e703b&source=-----3b18903e7329
---------------------clap_footer-----------)

\--

4

[
](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fbookmark%2Fp%2F3b18903e7329&operation=register&redirect=https%3A%2F%2Fjeffzzq.medium.com%2Fros2-image-
pipeline-
tutorial-3b18903e7329&source=--------------------------bookmark_footer-----------)

[ ![Jeff
Gensler](https://miro.medium.com/v2/resize:fill:144:144/1*Irw8Ao7_8-_ON4LpwG-_0Q.png)
](/?source=post_page-----3b18903e7329--------------------------------)

Follow

[
](https://medium.com/m/signin?actionUrl=%2F_%2Fapi%2Fsubscriptions%2Fnewsletters%2F5eea7c8955da&operation=register&redirect=https%3A%2F%2Fjeffzzq.medium.com%2Fros2-image-
pipeline-
tutorial-3b18903e7329&newsletterV3=44bf324e703b&newsletterV3Id=5eea7c8955da&user=Jeff+Gensler&userId=44bf324e703b&source=-----3b18903e7329
---------------------subscribe_user-----------)

[


Along with the node source code are the ` package.xml ` and ` CMakeLists.txt `
files that complete the tutorial package.


Note


API Documentation


  * ` Topic ` : Selects the image topic to visualize from the list of available images in the combo box
  * ` Depth ` : The depth of the incoming message queue
  * ` History policy ` : Set the QoS history policy. ` Keep Last ` is suggested for performance and compatibility
  * ` Reliability Policy ` : Set the QoS reliability policy. ` Best Effort ` is suggested for performances, ` Reliable ` is used for compatibility
  * ` Durability Policy ` : Set the QoS durability policy. ` Volatile ` is suggested for compatibility


[
![Logo](https://cdn.sanity.io/images/s18ewfw4/production/3534345dbdb3bbf9ec698e5024d0c4f72eeb30f5-149x20.svg)
](https://www.stereolabs.com)


og.Controller.evaluate_sync(self._clock_graph)


* Send ground truth synthetic perception data through rostopics


The ` Image ` plugin allows you to visualize an image from a topic of type `
sensor_msgs/Image ` .


- Point Of View:
  - Imagine we are standing behind of the camera, and looking forward.
  - Always use this point of view when talking about coordinates, left vs right IRs, position of sensor, etc..


[
![../_images/isaac_tutorial_ros2_rviz_camera.png](../_images/isaac_tutorial_ros2_rviz_camera.png)
](../_images/isaac_tutorial_ros2_rviz_camera.png)


Omniverse Common


[ phr0201  ](https://forums.developer.nvidia.com/u/phr0201) October 17, 2022,
2:20pm  1


which led to the fourth column containing all zeros. While the point cloud
node will still work, all of the points will be located on ` 0,0,0 ` .
Hopefully, this guide will help you from making the same mistake.


# Usage


* Continue on to the next tutorial in our ROS2 Tutorials series, [ ROS2 Clock  ](tutorial_ros2_clock.html#isaac-sim-app-tutorial-ros2-clock) to learn to setup ROS2 Clock publishers and subscribers with Omniverse Isaac Sim.


<hr>


The default camera displayed in the Viewport is the _Perspective_ camera. You
can verify that by the _Camera_ button on the top left hand corner _inside_
the Viewport display. Click on the Camera button and you will see there are a
few other preset camera positions: Top, Front, and Right side views.


User can set the camera name and camera namespace, to distinguish between cameras and platforms, which helps identifying the right nodes and topics to work with.


## Efficient intra-process communication:

Our ROS2 Wrapper node supports zero-copy communications if loaded in the same process as a subscriber node. This can reduce copy times on image/pointcloud topics, especially with big frame resolutions and high FPS.


Follow the same calibration steps above until the “Calibrate” button is lit
up. You should be left with two ` CameraInfo ` messages (for left and right).
Take a look at the ` projection ` section and verify the right camera does not
contain all zeros:

left camera:

    projection
    856.167319 0.000000 197.679413 0.000000
    0.000000 856.167319 379.488960 0.000000
    0.000000 0.000000 1.000000 0.000000

right camera:

    projection
    856.167319 0.000000 197.679413 -178.286885
    0.000000 856.167319 379.488960 0.000000
    0.000000 0.000000 1.000000 0.000000

The value of ` -178.286885 ` shows that these two ` CameraInfo ` files can be
used together to later create Point Clouds.


```
> ros2 node list
/camera/camera


  * [ 10\. Replicator ](../replicator_tutorials/index.html)
  * [ 11\. Cortex ](../cortex_tutorials/index.html)


Careers

](https://medium.com/jobs-at-medium/work-at-
medium-959d1a85284e?source=post_page-----
3b18903e7329--------------------------------)

[

Blog

](https://blog.medium.com/?source=post_page-----
3b18903e7329--------------------------------)

[

Privacy

](https://policy.medium.com/medium-privacy-
policy-f03bf92035c9?source=post_page-----
3b18903e7329--------------------------------)

[

Terms

](https://policy.medium.com/medium-terms-of-
service-9db0094a1e0f?source=post_page-----
3b18903e7329--------------------------------)

[

Text to speech

](https://speechify.com/medium?source=post_page-----
3b18903e7329--------------------------------)

[

Teams


You should have seen some errors in the above ` opencv_cam ` node:

    [ERROR] [1610062920.136820591] [camera_calibration_parsers]: Failed to detect content in .ini file
    [ERROR] [1610062920.136830394] [opencv_cam]: cannot get camera info, will not publish

Cameras in ROS can have some “metadata” that describe the physical camera that
took the Image. This will help later when trying to make sense of the objects
inside of the camera as well as comparing the results of two different
cameras. To understand more about “camera info,” we need to take a look at the
` CameraInfo ` message ( [ melodic link
](http://docs.ros.org/en/melodic/api/sensor_msgs/html/msg/CameraInfo.html) ).
There is a lot to unpack here and I encourage you to take some time to read a
bit more about each of the fields.

To create this file for **one camera** , you’ll need to use the calibration
tools located in the ` image_pipeline ` package (we will cover how this
process changes for stereo vision later). Here is an example command that will
run the calibrator program. You can read through the source code but this ends
up using the OpenCV library ` [ cv2.CalibrateCamera()
](https://docs.opencv.org/master/d9/d0c/group__calib3d.html#ga3207604e4b1a1758aa66acb6ed5aa65d)
` . OpenCV has their own documentation on this process and you can [ read
about it more there
](https://docs.opencv.org/master/dc/dbb/tutorial_py_calibration.html) .

    ros2 run camera_calibration cameracalibrator \
      --size=8x6 \
      --square=0.063 \
      --approximate=0.3 \
      --no-service-check \
      --ros-args --remap /image:=/image_raw

monocular calibration

Basically, you’ll need some checkerboard pattern to move around the focal
area. [ Here is a link to a 6x8 grid
](https://github.com/opencv/opencv/blob/master/doc/pattern.png) . I ended up


Example:
```
ros2 launch realsense2_camera rs_launch.py enable_rgbd:=true enable_sync:=true align_depth.enable:=true enable_color:=true enable_depth:=true
```


* Point Cloud


  * **[ Code API ](http://ros.org/doc/electric/api/rosparam/html) **
  * [ Tutorials ](/rosparam/Tutorials)
  * [ FAQ ](http://answers.ros.org/questions/scope:all/sort:activity-desc/tags:rosparam/page:1/)
  * [ Change List ](/ros_comm/ChangeList)
  * [ Reviews ](/rosparam/Reviews)


###  rosparam get


#  Package Summary


    $ rosparam set /new_param_int 7
    $ rosparam set new_param_str "Another string"
    $ rosparam list | grep 'new_param'
    /new_param_int
    /new_param_str


Then it becomes easier for your nodes to get different params for different
parts of your application.


###  Setting parameters


  * [ pr2_controller_manag... ](/pr2_controller_manager?distro=hydro)
  * [ ros_comm ](/ros_comm?distro=hydro)
  * [ rosh ](/rosh?distro=hydro)
  * [ roslaunch ](/roslaunch?distro=hydro)
  * [ test_rosparam ](/test_rosparam?distro=hydro)


[ ![The Robotics Back-End](https://roboticsbackend.com/wp-
content/uploads/2020/02/favicon_white.png) ](https://roboticsbackend.com/ "The
Robotics Back-End")


As you may know, it’s quite useful to organize your nodes, params, services,
and topics with namespaces.


# COMMAND-LINE PARSING

def _rosparam_cmd_get_dump(cmd, argv):
    """
    Process command line for rosparam get/dump, e.g.::
      rosparam get param
      rosparam dump file.yaml [namespace]
    @param cmd: command ('get' or 'dump')
    @type  cmd: str
    @param argv: command-line args
    @type  argv: str

    """
    # get and dump are equivalent functionality, just different arguments
    if cmd == 'dump':
        parser = OptionParser(usage="usage: %prog dump [options] file [namespace]", prog=NAME)
    elif cmd == 'get':
        parser = OptionParser(usage="usage: %prog get [options] parameter", prog=NAME)
        parser.add_option("-p", dest="pretty", default=False,
                          action="store_true", help="pretty print. WARNING: not YAML-safe")


**Substitution** allows you to make use of roslaunch args representing all or
part of a YAML string. e.g.


* [ Login ](/action/login/roslaunch/XML/rosparam?action=login)


** Dependencies  (2) **


* **diamondback:** _Only showing information from the released package extracted on Unknown. No API documentation available. Please see[ this page ](http://wiki.ros.org/rosdistro/Tutorials/Indexing%20Your%20ROS%20Repository%20for%20Documentation%20Generation) for information on how to submit your repository to our index. _


* **lunar:** _Documentation generated on February 03, 2019 at 11:23 AM_ ( [ doc job ](http://build.ros.org/view/Ldoc/job/Ldoc__ros_comm__ubuntu_xenial_amd64) ).


* Show verbose output.


* [ <test> ](/roslaunch/XML/test)


The ` delete ` and ` dump ` commands run _before_ the ` load ` command as well
as before any other parameters are uploaded to the [ Parameter Server
](/Parameter%20Server) . ` delete ` and ` dump ` commands run in the declared
order.


  * **[ Code API ](http://docs.ros.org/hydro/api/rosparam/html) **
  * [ Tutorials ](/rosparam/Tutorials)
  * [ FAQ ](http://answers.ros.org/questions/scope:all/sort:activity-desc/tags:rosparam/page:1/)
  * [ Changelog ](http://docs.ros.org/en/hydro/changelogs/rosparam/changelog.html)
  * [ Change List ](/ros_comm/ChangeList)
  * [ Reviews ](/rosparam/Reviews)


def list_params(ns):
    """
    Get list of parameters in ns
    @param ns: namespace to match
    @type  ns: str
    """
    try:
        ns = make_global_ns(ns)
        names = _succeed(get_param_server().getParamNames(_get_caller_id()))
        names.sort()
        return [n for n in names if n.startswith(ns)]
    except socket.error:
        raise ROSParamIOException("Unable to communicate with master!")


* ` $(arg foo) ` evaluates to the value specified by an [ <arg> ](/roslaunch/XML/arg) tag. There must be a corresponding [ <arg> ](/roslaunch/XML/arg) tag _in the same launch file_ that declares the arg.


  * Maintainer status: maintained
  * Maintainer: Dirk Thomas <dthomas AT osrfoundation DOT org>
  * Author: Ken Conley
  * License: BSD
  * Source: git [ https://github.com/ros/ros_comm.git ](https://github.com/ros/ros_comm) (branch: hydro-devel)


_EOL distros:_ electric  fuerte  groovy  hydro  indigo  jade  kinetic  lunar


Continuous Integration


Released


**Package Links**


  * [ pr2_controller_manag... ](/pr2_controller_manager?distro=groovy)
  * [ ros_comm ](/ros_comm?distro=groovy)
  * [ rosh ](/rosh?distro=groovy)
  * [ roslaunch ](/roslaunch?distro=groovy)
  * [ test_rosparam ](/test_rosparam?distro=groovy)


` rosparam ` uses a 1-to-1 correspondence between [ Parameter Server
](/Parameter%20Server) types and YAML types. For example:


  * [ Distributions ](/Distributions)
  * [ ROS/Installation ](/ROS/Installation)
  * [ ROS/Tutorials ](/ROS/Tutorials)
  * [ RecentChanges ](/RecentChanges)
  * [ roslaunch/XML/rosparam ](/roslaunch/XML/rosparam)


NAME = 'rosparam'


` -v `


  * Maintainer status: maintained
  * Maintainer: Jacob Perron <jacob AT openrobotics DOT org>, Michael Carroll <michael AT openrobotics DOT org>, Shane Loretz <sloretz AT openrobotics DOT org>
  * Author: Ken Conley, Dirk Thomas <dthomas AT osrfoundation DOT org>
  * License: BSD
  * Source: git [ https://github.com/ros/ros_comm.git ](https://github.com/ros/ros_comm) (branch: kinetic-devel)


## namespace key. Use of this in a YAML document specifies the
## namespace of all the params.  NOTE: phasing out most use of this
## key. It's still useful in corner cases, but most of its
## functionality can be achieved with command-line arguments.
NS = '_ns'


rosparam contains the rosparam command-line tool for getting and setting ROS
Parameters on the [ Parameter Server
](http://www.ros.org/wiki/Parameter%20Server) using YAML-encoded files. It
also contains an experimental library for using YAML with the Parameter
Server. This library is intended for internal use only. rosparam can be
invoked within a [ roslaunch ](http://www.ros.org/wiki/roslaunch) file.


sys.stdout.write(dump)


* * *

    $ rosparam list
    /my_float
    /my_integer
    /my_string
    /rosdistro
    /roslaunch/uris/host_user_pc__41077
    /rosversion
    /run_id


####  Privacy Overview


** Dependencies  (3) **


` dump <file> <namespace> `


YAML dictionaries can occur as the argument to the ` load ` and ` set `
commands of ` rosparam ` . Dictionaries in this context are interpreted
differently from namespace dictionaries that are set as the value of a
parameter (e.g. from a C++ or Python node). Instead of _replacing_ a parameter
namespace, dictionaries _in` rosparam ` _ are unpacked into individual
parameters to be set on the Parameter Server. Thus, ` rosparam ` dictionaries
can be thought of as _adding_ new values to a parameter namespace.


  * [ catkin ](/catkin?distro=groovy)
  * [ python-yaml ](/python-yaml?distro=groovy)
  * [ rosgraph ](/rosgraph?distro=groovy)


def _rosparam_cmd_delete(argv):
    """
    Process command line for rosparam delete, e.g.::
      rosparam delete param
    @param cmd: command name
    @type  cmd: str
    @param argv: command-line args
    @type  argv: str
    """
    parser = OptionParser(usage="usage: %prog delete [options] parameter", prog=NAME)
    parser.add_option("-v", dest="verbose", default=False,
                      action="store_true", help="turn on verbose output")
    options, args = parser.parse_args(argv[2:])


Wiki: rosparam (last edited 2014-06-29 15:37:55 by  [ AshutoshNirala
](/AshutoshNirala "AshutoshNirala @ 122.169.212.128\[122.169.212.128\]") )


Analytics


Categories  [ ROS Tutorials ](https://roboticsbackend.com/category/ros/)


  * ` list `
    * list all parameter names.

                $ rosparam list


    parser.add_option("-v", dest="verbose", default=False,
                      action="store_true", help="turn on verbose output")
    options, args = _set_optparse_neg_args(parser, argv)
    if cmd == 'set':
        if options.text_file and options.bin_file:
            parser.error("you may only specify one of --textfile or --binfile")


  * Immutable Page
  * Comments
  * [ Info ](/action/info/roslaunch/XML/rosparam?action=info)
  * [ Attachments ](/action/AttachFile/roslaunch/XML/rosparam?action=AttachFile)
  * More Actions:  Raw Text  Print View  Render as Docbook  Delete Cache  \------------------------  Check Spelling  Like Pages  Local Site Map  \------------------------  Rename Page  Copy Page  Delete Page  \------------------------  My Pages  Subscribe User  \------------------------  Remove Spam  Revert to this revision  Package Pages  Sync Pages  \------------------------  CreatePdfDocument  Load  RawFile  Save  SlideShow


            ns = ns_join(default_namespace, doc.get(NS, None))
            if verbose:
                print "reading parameters into namespace [%s]"%ns
            del doc[NS]
        else:
            ns = default_namespace
        paramlist.append((doc, ns))
    return paramlist


    parser.add_option("-v", dest="verbose", default=False,
                      action="store_true", help="turn on verbose output")
    options, args = parser.parse_args(argv[2:])


rosparam contains the rosparam command-line tool for getting and setting ROS
Parameters on the [ Parameter Server
](http://www.ros.org/wiki/Parameter%20Server) using YAML-encoded files. It
also contains an experimental library for using YAML with the Parameter
Server. This library is intended for internal use only.


Except where otherwise noted, the ROS wiki is licensed under the
[ Creative Commons Attribution 3.0
](http://creativecommons.org/licenses/by/3.0/)


  * Maintainer status: maintained
  * Maintainer: Jacob Perron <jacob AT openrobotics DOT org>, Michael Carroll <michael AT openrobotics DOT org>, Shane Loretz <sloretz AT openrobotics DOT org>
  * Author: Ken Conley, Dirk Thomas <dthomas AT osrfoundation DOT org>
  * License: BSD
  * Bug / feature tracker: [ https://github.com/ros/ros_comm/issues ](https://github.com/ros/ros_comm/issues)
  * Source: git [ https://github.com/ros/ros_comm.git ](https://github.com/ros/ros_comm) (branch: melodic-devel)


  * [ catkin ](/catkin?distro=kinetic)
  * [ rosgraph ](/rosgraph?distro=kinetic)


  * **[ Code API ](http://docs.ros.org/groovy/api/rosparam/html) **
  * [ Tutorials ](/rosparam/Tutorials)
  * [ FAQ ](http://answers.ros.org/questions/scope:all/sort:activity-desc/tags:rosparam/page:1/)
  * [ Changelog ](http://docs.ros.org/en/groovy/changelogs/rosparam/changelog.html)
  * [ Change List ](/ros_comm/ChangeList)
  * [ Reviews ](/rosparam/Reviews)


* Show verbose output.


* **fuerte:** _Documentation generated on December 28, 2013 at 05:36 PM_


* e.g. ` $(find rospy)/manifest.xml ` . Specifies a _package-relative path_ . The filesystem path to the package directory will be substituted inline. Use of package-relative paths is highly encouraged as hard-coded paths inhibit the portability of the launch configuration. Forward and backwards slashes will be resolved to the local filesystem convention.


Relying on the override behavior can be brittle. There is no guarantee that an
override is specified correctly (e.g. if a parameter name is changed in an
included file). Instead, it is recommended that override behavior be done
using ` $(arg) ` / ` <arg> ` settings.


    angle1: rad(2*pi)
    angle2: deg(180)


` -p `


Functional cookies help to perform certain functionalities like sharing the
content of the website on social media platforms, collect feedbacks, and other
third-party features.


** Used by  (4) **


** Used by  (5) **


###  rosparam dump


` -v `


` rosparam ` is a stable command-line tool within the ROS core toolchain. No
major feature development is currently scheduled for this tool.


NOTE: ` get ` and ` dump ` are essentially the same command, as are ` set `
and ` load ` , with the only difference being whether or not a file is used.


**Package Links**


  *     <group if="$(arg foo)">
      <!-- stuff that will only be evaluated if foo is true -->
    </group>

    <param name="foo" value="bar" unless="$(arg foo)" />  <!-- This param won't be set when "unless" condition is met -->


#  Package Summary


rosparam contains the rosparam command-line tool for getting and setting ROS
Parameters on the [ Parameter Server
](http://www.ros.org/wiki/Parameter%20Server) using YAML-encoded files. It
also contains an experimental library for using YAML with the Parameter
Server. This library is intended for internal use only. rosparam can be
invoked within a [ roslaunch ](http://www.ros.org/wiki/roslaunch) file.


Continuous Integration


  * [ source ubuntu focal ](https://build.ros.org/view/Nsrc_uF/job/Nsrc_uF__rosparam__ubuntu_focal__source)
  * [ binary ubuntu focal amd64 ](https://build.ros.org/view/Nbin_uF64/job/Nbin_uF64__rosparam__ubuntu_focal_amd64__binary)
  * [ binary ubuntu focal armhf ](https://build.ros.org/view/Nbin_ufhf_uFhf/job/Nbin_ufhf_uFhf__rosparam__ubuntu_focal_armhf__binary)
  * [ binary ubuntu focal arm64 ](https://build.ros.org/view/Nbin_ufv8_uFv8/job/Nbin_ufv8_uFv8__rosparam__ubuntu_focal_arm64__binary)
  * [ devel ubuntu focal amd64 ](https://build.ros.org/view/Ndev/job/Ndev__ros_comm__ubuntu_focal_amd64)
  * [ doc ](https://build.ros.org/view/Ndoc/job/Ndoc__ros_comm__ubuntu_focal_amd64)


Other uncategorized cookies are those that are being analyzed and have not
been classified into a category as yet.


print '\n'.join(list_params(ns))


    * Another example:

                <node name="add_two_ints_server" pkg="beginner_tutorials" type="add_two_ints_server" />
        <node name="add_two_ints_client" pkg="beginner_tutorials" type="add_two_ints_client" args="$(arg a) $(arg b)" />


    * For example:

                <include file="$(dirname)/other.launch" />


##  Tag Reference


  * Tutorials
    * [ ROS ](https://roboticsbackend.com/category/ros/)
    * [ ROS2 ](https://roboticsbackend.com/category/ros2/)
    * [ Raspberry Pi ](https://roboticsbackend.com/category/raspberry-pi/)
    * [ Arduino ](https://roboticsbackend.com/category/arduino/)
  * [ Youtube ](https://www.youtube.com/channel/UCelRThOKlWMnpjqr5EBq6tg?sub_confirmation=1)
  * [ **Courses** ](https://roboticsbackend.com/courses/)
  * [ Contact ](https://roboticsbackend.com/contact/)


###  rosparam list


Wiki: roslaunch/XML/rosparam (last edited 2017-02-18 00:28:59 by  [ IsaacSaito
](/IsaacSaito "130s @ c-73-2-5-23.hsd1.ca.comcast.net\[73.2.5.23\]") )


  * Build history (last 5 of 13 builds):
  * [ #141  21-Nov-2023 22:20  1426 / 1427  ](https://build.ros.org//job/Ndev__ros_comm__ubuntu_focal_amd64/141/)
  * [ #140  20-Apr-2023 14:20  1423 / 1424  ](https://build.ros.org//job/Ndev__ros_comm__ubuntu_focal_amd64/140/)
  * [ #139  15-Feb-2023 14:20  1423 / 1424  ](https://build.ros.org//job/Ndev__ros_comm__ubuntu_focal_amd64/139/)
  * [ #138  25-Jan-2023 18:20  1423 / 1424  ](https://build.ros.org//job/Ndev__ros_comm__ubuntu_focal_amd64/138/)
  * [ #137  25-Jan-2023 17:20  1423 / 1424  ](https://build.ros.org//job/Ndev__ros_comm__ubuntu_focal_amd64/137/)


    rosparam set    set parameter
    rosparam get    get parameter
    rosparam load   load parameters from file
    rosparam dump   dump parameters to file
    rosparam delete delete parameter
    rosparam list   list parameter names


    <rosparam command="load" file="$(find rosparam)/example.yaml" />
    <rosparam command="delete" param="my/param" />

    <rosparam param="a_list">[1, 2, 3, 4]</rosparam>

    <rosparam>
      a: 1
      b: 2
    </rosparam>


Others


  * [ python-yaml ](/python-yaml?distro=electric)
  * [ roslib ](/roslib?distro=electric)


The ROS Wiki is for ROS 1. Are you using ROS 2 ( [ Humble
](http://docs.ros.org/en/humble/) , [ Iron ](http://docs.ros.org/en/iron/) ,
or [ Rolling ](http://docs.ros.org/en/rolling/) )?
[ Check out the ROS 2 Project Documentation ](http://docs.ros.org)
Package specific documentation can be found on [ index.ros.org
](https://index.ros.org)


rosparam contains the rosparam command-line tool for getting and setting ROS
Parameters on the [ Parameter Server ](http://wiki.ros.org/Parameter%20Server)
using YAML-encoded files. It also contains an experimental library for using
YAML with the Parameter Server. This library is intended for internal use
only. rosparam can be invoked within a [ roslaunch
](http://wiki.ros.org/roslaunch) file.


[ ![](/custom/images/brought_by_horiz.png) ](https://www.openrobotics.org/)


    * For your convenience, arguments are also implicitly resolved, i.e. the following two expressions are identical:

                "$(eval arg('foo'))"
        "$(eval foo)"


YAML is a lightweight markup language that supports all parameter types. For
more on YAML, see [ the YAML 1.2 spec ](http://yaml.org/spec/1.2/spec.html) .
For tips on entering YAML in at the command-line, please see the [ YAML
command line ](/ROS/YAMLCommandLine) guide.


* [ roslib ](/roslib?distro=diamondback)


  1. YAML Format
  2. roslaunch API
  3. rosparam command-line tool
    1. rosparam list
    2. rosparam get
    3. rosparam set
    4. rosparam delete
    5. rosparam dump
    6. rosparam load
  4. Roadmap
  5. See Also


* [ <env> ](/roslaunch/XML/env)


    $ rosparam get /this_param_doesnt_exist
    ERROR: Parameter [/this_param_doesnt_exist] is not set


With rosparam set, you can do 2 things: create a new parameter, or change the
value of an existing one.


**Important note:** If you have fetched a parameter inside a node, and you
change the parameter’s value after that, then it doesn’t change the value
inside the node! You either have to kill and restart the node, or use [
dynamic_reconfigure ](http://wiki.ros.org/dynamic_reconfigure) .


* [ Login ](/action/login/roslaunch/XML?action=login)


rosparam contains the rosparam command-line tool for getting and setting ROS
Parameters on the [ Parameter Server
](http://www.ros.org/wiki/Parameter%20Server) using YAML-encoded files. It
also contains an experimental library for using YAML with the Parameter
Server. This library is intended for internal use only. rosparam can be
invoked within a [ roslaunch ](http://www.ros.org/wiki/roslaunch) file.


Released


* [ <node> ](/roslaunch/XML/node)


` $(arg foo) `


_**[ ros_comm ](/ros_comm?distro=fuerte) ** : [ message_filters
](/message_filters?distro=fuerte) | [ perf_roscpp
](/perf_roscpp?distro=fuerte) | [ rosbag ](/rosbag?distro=fuerte) | [
rosconsole ](/rosconsole?distro=fuerte) | [ roscpp ](/roscpp?distro=fuerte) |
[ rosgraph ](/rosgraph?distro=fuerte) | [ rosgraph_msgs
](/rosgraph_msgs?distro=fuerte) | [ roslaunch ](/roslaunch?distro=fuerte) | [
roslisp ](/roslisp?distro=fuerte) | [ rosmaster ](/rosmaster?distro=fuerte) |
[ rosmsg ](/rosmsg?distro=fuerte) | [ rosnode ](/rosnode?distro=fuerte) | [
rosout ](/rosout?distro=fuerte) | rosparam | [ rospy ](/rospy?distro=fuerte) |
[ rosservice ](/rosservice?distro=fuerte) | [ rostest
](/rostest?distro=fuerte) | [ rostopic ](/rostopic?distro=fuerte) | [ roswtf
](/roswtf?distro=fuerte) | [ std_srvs ](/std_srvs?distro=fuerte) | [
topic_tools ](/topic_tools?distro=fuerte) | [ xmlrpcpp
](/xmlrpcpp?distro=fuerte) _


* **kinetic:** _Documentation generated on November 02, 2020 at 03:47 AM_ ( [ doc job ](http://build.ros.org/view/Kdoc/job/Kdoc__ros_comm__ubuntu_xenial_amd64) ).


    arg2 = None
    if len(args) == 0:
        parser.error("invalid arguments. Please specify a parameter name")
    elif len(args) == 1:
        arg = args[0]
    else:
        parser.error("too many arguments")


Contents


This website uses cookies to improve your experience while you navigate
through the website. Out of these, the cookies that are categorized as
necessary are stored on your browser as they are essential for the working of
basic functionalities of the website. We also use third-party cookies that
help us analyze and understand how you use this website. These cookies will be
stored in your browser only with your consent. You also have the option to
opt-out of these cookies. But opting out of some of these cookies may affect
your browsing experience.


###  rosparam delete


**Package Links**


  1. <rosparam> tag
    1. Attributes
    2. Examples


#  User


Necessary cookies are absolutely essential for the website to function
properly. These cookies ensure basic functionalities and security features of
the website, anonymously.  Cookie  |  Duration  |  Description
---|---|---
cookielawinfo-checkbox-analytics  |  11 months  |  This cookie is set by GDPR
Cookie Consent plugin. The cookie is used to store the user consent for the
cookies in the category "Analytics".
cookielawinfo-checkbox-functional  |  11 months  |  The cookie is set by GDPR
cookie consent to record the user consent for the cookies in the category
"Functional".
cookielawinfo-checkbox-necessary  |  11 months  |  This cookie is set by GDPR
Cookie Consent plugin. The cookies is used to store the user consent for the
cookies in the category "Necessary".
cookielawinfo-checkbox-others  |  11 months  |  This cookie is set by GDPR
Cookie Consent plugin. The cookie is used to store the user consent for the
cookies in the category "Other.
cookielawinfo-checkbox-performance  |  11 months  |  This cookie is set by
GDPR Cookie Consent plugin. The cookie is used to store the user consent for
the cookies in the category "Performance".
viewed_cookie_policy  |  11 months  |  The cookie is set by the GDPR Cookie
Consent plugin and is used to store whether or not user has consented to the
use of cookies. It does not store any personal data.

Functional


Documented


* Unless ` value ` evaluates to true (which means if ` value ` evaluates to false), include tag and its contents.


[ ![](/custom/images/brought_by_horiz.png) ](https://www.openrobotics.org/)


` roslaunch ` evaluates the XML file in a single pass. Includes are processed
in depth-first traversal order. Tags are evaluated serially and the **last
setting wins** . Thus, if there are multiple settings of a parameter, the last
value specified for the parameter will be used.


** Used by  (6) **


**Substitution args are currently resolved on the local machine.** In other
words, environment variables and ROS package paths will be set to their values
in your current environment, **even for remotely launched processes** .


_**[ ros_comm ](/ros_comm?distro=groovy) ** : [ message_filters
](/message_filters?distro=groovy) | [ ros ](/ros?distro=groovy) | [ rosbag
](/rosbag?distro=groovy) | [ rosconsole ](/rosconsole?distro=groovy) | [
roscpp ](/roscpp?distro=groovy) | [ rosgraph ](/rosgraph?distro=groovy) | [
rosgraph_msgs ](/rosgraph_msgs?distro=groovy) | [ roslaunch
](/roslaunch?distro=groovy) | [ roslisp ](/roslisp?distro=groovy) | [
rosmaster ](/rosmaster?distro=groovy) | [ rosmsg ](/rosmsg?distro=groovy) | [
rosnode ](/rosnode?distro=groovy) | [ rosout ](/rosout?distro=groovy) |
rosparam | [ rospy ](/rospy?distro=groovy) | [ rosservice
](/rosservice?distro=groovy) | [ rostest ](/rostest?distro=groovy) | [
rostopic ](/rostopic?distro=groovy) | [ roswtf ](/roswtf?distro=groovy) | [
std_srvs ](/std_srvs?distro=groovy) | [ topic_tools
](/topic_tools?distro=groovy) | [ xmlrpcpp ](/xmlrpcpp?distro=groovy) _


"""
Implementation of the rosparam as well as a library for modifying the
state of the ROS Parameter Server using YAML files.
"""


[ ![ROS For Beginners - A Step By Step Course](https://roboticsbackend.com/wp-
content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
](https://rbcknd.com/ros-for-beginners)


` unless=value ` (optional)


  * Examples:
    *           <param name="foo" value="$(optenv NUM_CPUS 1)" />
          <param name="foo" value="$(optenv CONFIG_PATH /home/marvin/ros_workspace)" />
          <param name="foo" value="$(optenv VARIABLE ros rocks)" />


In production code all your params will be either loaded from YAML files or be
started in different launch files. Then, [ you’ll get the parameters directly
inside your nodes using rospy and roscpp ](https://roboticsbackend.com/get-
set-ros-params-rospy-roscpp/) .


Performance


NOTE: if parameter value is a dictionary, this will _add_ to the currently set
values.


  * ` if=value ` (optional)
    * If ` value ` evaluates to true, include tag and its contents.


#  Page


Finally, if you can create a parameter and change its value, you can also
choose to delete it from the Parameter Server, using ` rosparam delete ` .


` ns="namespace" ` _(optional)_


The ` <rosparam> ` tag enables the use of [ rosparam ](/rosparam) YAML files
for loading and dumping parameters from the ROS [ Parameter Server
](/Parameter%20Server) . It can also be used to remove parameters. The `
<rosparam> ` tag can be put inside of a [ <node> ](/roslaunch/XML/node) tag,
in which case the parameter is treated like a [ private name ](/Names) .


** Used by  (4) **


  * ` delete <parameter-name> `
    * Delete a parameter value.

                $ rosparam delete parameter_name


Commands:
\trosparam set\tset parameter
\trosparam get\tget parameter
\trosparam load\tload parameters from file
\trosparam dump\tdump parameters to file
\trosparam delete\tdelete parameter
\trosparam list\tlist parameter names
"""
    sys.exit(0)


# DUMP/GET


  * [ catkin ](/catkin?distro=hydro)
  * [ python-yaml ](/python-yaml?distro=hydro)
  * [ rosgraph ](/rosgraph?distro=hydro)


` $(find pkg) `


**[ ROS For Beginners - A Step By Step Course ](https://rbcknd.com/ros-for-
beginners) **


** Used by  (5) **


  * Maintainer status: maintained
  * Maintainer: Michael Carroll <michael AT openrobotics DOT org>, Shane Loretz <sloretz AT openrobotics DOT org>
  * Author: Ken Conley, Dirk Thomas <dthomas AT osrfoundation DOT org>, Jacob Perron <jacob AT openrobotics DOT org>
  * License: BSD
  * Bug / feature tracker: [ https://github.com/ros/ros_comm/issues ](https://github.com/ros/ros_comm/issues)
  * Source: git [ https://github.com/ros/ros_comm.git ](https://github.com/ros/ros_comm) (branch: noetic-devel)


Documented


Quite easy, right? The type (int, double, string, …) will be automatically set
depending on the value you give.


Now that you have the list of available parameters, simply run ` rosparam get
` followed by the name of a parameter, to get its value.


The ` rosparam dump ` and ` rosparam load ` commands will help you debug your
parameters when [ using YAML files for ROS params
](https://roboticsbackend.com/ros-param-yaml-format/) <– Check out this
tutorial to know more about it.


  * ` command="load|dump|delete" ` _(optional, default=load)_
    * [ rosparam ](/rosparam) command.


####  ROS 2 Documentation


All tags support ` if ` and ` unless ` attributes, which include or exclude a
tag based on the evaluation of a value. "1" and "true" are considered true
values. "0" and "false" are considered false values. Other values will error.


[ Documentation Status ](javascript:toggleDocStatus\(\))


* Set parameter to contents of binary file. Parameter Server will store value as an XML-RPC Binary type (Base 64 encoded).


SAVE & ACCEPT


* [ <group> ](/roslaunch/XML/group)


Released


#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
#  * Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#  * Redistributions in binary form must reproduce the above
#    copyright notice, this list of conditions and the following
#    disclaimer in the documentation and/or other materials provided
#    with the distribution.
#  * Neither the name of Willow Garage, Inc. nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Revision $Id: rosparam 1641 2008-07-28 21:39:33Z sfkwc $


* **jade:** _Documentation generated on March 07, 2017 at 11:33 AM_ ( [ doc job ](http://build.ros.org/view/Jdoc/job/Jdoc__ros_comm__ubuntu_trusty_amd64) ).


  * ` set <parameter-name> [parameter-value] `
    * Set a parameter to a value. ` parameter-value ` is required unless ` --textfile ` or ` --binfile ` are specified.

                $ rosparam set parameter_name value


* **noetic:** _Documentation generated on November 23, 2023 at 11:55 AM_ ( [ doc job ](https://build.ros.org/view/Ndoc/job/Ndoc__ros_comm__ubuntu_focal_amd64) ).


` -t <text_file>, --textfile <text_file> ` New in Diamondback


def _fullusage():
    """
    Prints rosparam usage
    """
    print """rosparam is a command-line tool for getting, setting, and deleting parameters from the ROS Parameter Server.


* Allows use of [ substitution args ](/roslaunch/XML#substitution_args) in the YAML text.


` $(anon name) `


yaml.add_constructor(u'!radians', construct_angle_radians)
yaml.add_constructor(u'!degrees', construct_angle_degrees)


##  Delete a parameter (rosparam delete)


#  User


Functional


** [ Check out the course here ](https://rbcknd.com/ros-for-beginners) **


    arg2 = None
    if len(args) == 0:
        if cmd == 'load':
            parser.error("invalid arguments. Please specify a file name")
        elif cmd == 'set':
            parser.error("invalid arguments. Please specify a parameter name")
    elif len(args) == 1:
        arg = args[0]
        if cmd == 'set' and not (options.text_file or options.bin_file):
            parser.error("invalid arguments. Please specify a parameter value")
    elif len(args) == 2:
        arg = args[0]
        arg2 = args[1]
    else:
        parser.error("too many arguments")


** Dependencies  (2) **


##  Set a parameter’s value (rosparam set)


* Will assign the _my_foo_ argument to the _foo_ parameter.


**Package Links**


The [ <rosparam> ](/roslaunch/XML/rosparam) tag enables the use of the `
rosparam ` tool for loading and dumping parameters encoded in YAML files. The
[ <rosparam> ](/roslaunch/XML/rosparam) tag can be put inside of a [ <node>
](/roslaunch/XML/node) tag, in which case the parameter is treated like a [
private name ](/Names) .


_Check out **[ ROS For Beginners ](https://rbcknd.com/ros-for-beginners) **
and learn ROS step by step. _


Will generate an error that there are two <node>s with the same name.


  * [ catkin ](/catkin?distro=indigo)
  * [ rosgraph ](/rosgraph?distro=indigo)


[ ![](/custom/images/brought_by_horiz.png) ](https://www.openrobotics.org/)


def construct_angle_degrees(loader, node):
    """
    python-yaml utility for converting deg(num) into float value
    """
    value = loader.construct_scalar(node)
    exprvalue = value
    if exprvalue.startswith("deg("):
        exprvalue = exprvalue.strip()[4:-1]
    try:
        return float(exprvalue) * math.pi / 180.0
    except ValueError:
        raise ROSParamException("invalid degree value: %s"%value)


Analytics


  * **[ Code API ](http://docs.ros.org/en/melodic/api/rosparam/html) **
  * [ Tutorials ](/rosparam/Tutorials)
  * [ FAQ ](http://answers.ros.org/questions/scope:all/sort:activity-desc/tags:rosparam/page:1/)
  * [ Changelog ](http://docs.ros.org/en/melodic/changelogs/rosparam/changelog.html)
  * [ Change List ](/ros_comm/ChangeList)
  * [ Reviews ](/rosparam/Reviews)


** Jenkins jobs  (6) **


** Used by  (3) **


Documented


**Master ROS Concepts
**


##  Roadmap


###  Example


  * [ catkin ](/catkin?distro=melodic)
  * [ rosgraph ](/rosgraph?distro=melodic)


#  Package Summary


The ROS Wiki is for ROS 1. Are you using ROS 2 ( [ Humble
](http://docs.ros.org/en/humble/) , [ Iron ](http://docs.ros.org/en/iron/) ,
or [ Rolling ](http://docs.ros.org/en/rolling/) )?
[ Check out the ROS 2 Project Documentation ](http://docs.ros.org)
Package specific documentation can be found on [ index.ros.org
](https://index.ros.org)


This tutorial is a practical guide on how to use rosparam command line tool to
debug [ ROS Params ](https://roboticsbackend.com/what-is-a-ros-parameter/) .


If the parameter you are looking for doesn’t exist, you’ll get this error:


####  ROS 2 Documentation


` subst_value=true|false ` _(optional)_


Manage consent


    * list all parameters in a particular namespace.

                $ rosparam list /namespace


Again, if you delete a param that was previously used by a node in its setup
phase, then the value inside the node stays the same. Only new nodes trying to
fetch the parameter won’t be able to get it.


  * Build history (last 5 of 69 builds):
  * [ #69  17-Oct-2020 03:32  1400 / 1401  ](http://build.ros.org//job/Mdev__ros_comm__ubuntu_bionic_amd64/69/)
  * [ #68  17-Oct-2020 00:15  1398 / 1401  ](http://build.ros.org//job/Mdev__ros_comm__ubuntu_bionic_amd64/68/)
  * [ #67  20-Aug-2020 20:15  1394 / 1395  ](http://build.ros.org//job/Mdev__ros_comm__ubuntu_bionic_amd64/67/)
  * [ #66  12-Aug-2020 16:15  1394 / 1395  ](http://build.ros.org//job/Mdev__ros_comm__ubuntu_bionic_amd64/66/)
  * [ #65  07-Aug-2020 17:15  1394 / 1395  ](http://build.ros.org//job/Mdev__ros_comm__ubuntu_bionic_amd64/65/)


Will launch both the server and client from the [ <add_two_ints>
](/ROS/Tutorials/WritingServiceClient%28c%2B%2B%29) example, passing as
parameters the value _a_ and _b_ . The resulting launch project can be called
as follows:


    *
_Examples_ :


` $(dirname) ` New in Lunar


##  Find all the params (rosparam list)


* [ <param> ](/roslaunch/XML/param)


_**[ ros_comm ](/ros_comm?distro=melodic) ** : [ message_filters
](/message_filters?distro=melodic) | [ ros ](/ros?distro=melodic) | [ rosbag
](/rosbag?distro=melodic) | [ rosconsole ](/rosconsole?distro=melodic) | [
roscpp ](/roscpp?distro=melodic) | [ rosgraph ](/rosgraph?distro=melodic) | [
rosgraph_msgs ](/rosgraph_msgs?distro=melodic) | [ roslaunch
](/roslaunch?distro=melodic) | [ roslisp ](/roslisp?distro=melodic) | [
rosmaster ](/rosmaster?distro=melodic) | [ rosmsg ](/rosmsg?distro=melodic) |
[ rosnode ](/rosnode?distro=melodic) | [ rosout ](/rosout?distro=melodic) |
rosparam | [ rospy ](/rospy?distro=melodic) | [ rosservice
](/rosservice?distro=melodic) | [ rostest ](/rostest?distro=melodic) | [
rostopic ](/rostopic?distro=melodic) | [ roswtf ](/roswtf?distro=melodic) | [
std_srvs ](/std_srvs?distro=melodic) | [ topic_tools
](/topic_tools?distro=melodic) | [ xmlrpcpp ](/xmlrpcpp?distro=melodic) _


_**[ ros_comm ](/ros_comm?distro=indigo) ** : [ message_filters
](/message_filters?distro=indigo) | [ ros ](/ros?distro=indigo) | [ rosbag
](/rosbag?distro=indigo) | [ rosconsole ](/rosconsole?distro=indigo) | [
roscpp ](/roscpp?distro=indigo) | [ rosgraph ](/rosgraph?distro=indigo) | [
rosgraph_msgs ](/rosgraph_msgs?distro=indigo) | [ roslaunch
](/roslaunch?distro=indigo) | [ roslisp ](/roslisp?distro=indigo) | [
rosmaster ](/rosmaster?distro=indigo) | [ rosmsg ](/rosmsg?distro=indigo) | [
rosnode ](/rosnode?distro=indigo) | [ rosout ](/rosout?distro=indigo) |
rosparam | [ rospy ](/rospy?distro=indigo) | [ rosservice
](/rosservice?distro=indigo) | [ rostest ](/rostest?distro=indigo) | [
rostopic ](/rostopic?distro=indigo) | [ roswtf ](/roswtf?distro=indigo) | [
std_srvs ](/std_srvs?distro=indigo) | [ topic_tools
](/topic_tools?distro=indigo) | [ xmlrpcpp ](/xmlrpcpp?distro=indigo) _


Let’s create a few new parameters. Note: each param’s name will start with a
leading slash “/”, whether you manually add it or not, which means they are
located in the “global” namespace.


Released


The parameter “/my_float” has now a new value.


When you use no namespace, all parameters are set in the global namespace. If
you want to use a specific namespace (or multiple ones), then you just need to
add the namespaces in front of the parameter, each namespace separated by a
slash “/”.


* Name of rosparam file.


    <launch>
      <param name="somestring1" value="bar" />
      <!-- force to string instead of integer -->
      <param name="somestring2" value="10" type="str" />

      <param name="someinteger1" value="1" type="int" />
      <param name="someinteger2" value="2" />

      <param name="somefloat1" value="3.14159" type="double" />
      <param name="somefloat2" value="3.0" />

      <!-- you can set parameters in child namespaces -->
      <param name="wg/childparam" value="a child namespace parameter" />

      <!-- upload the contents of a file to the server -->
      <param name="configfile" textfile="$(find roslaunch)/example.xml" />
      <!-- upload the contents of a file as base64 binary to the server -->
      <param name="binaryfile" binfile="$(find roslaunch)/example.xml" />

    </launch>


The ` <rosparam> ` tag can either reference a YAML file or contain raw YAML
text. If the YAML text defines a dictionary, the ` param ` attribute may be
omitted.


_**[ ros_comm ](/ros_comm?distro=lunar) ** : [ message_filters
](/message_filters?distro=lunar) | [ ros ](/ros?distro=lunar) | [ rosbag
](/rosbag?distro=lunar) | [ rosconsole ](/rosconsole?distro=lunar) | [ roscpp
](/roscpp?distro=lunar) | [ rosgraph ](/rosgraph?distro=lunar) | [
rosgraph_msgs ](/rosgraph_msgs?distro=lunar) | [ roslaunch
](/roslaunch?distro=lunar) | [ roslisp ](/roslisp?distro=lunar) | [ rosmaster
](/rosmaster?distro=lunar) | [ rosmsg ](/rosmsg?distro=lunar) | [ rosnode
](/rosnode?distro=lunar) | [ rosout ](/rosout?distro=lunar) | rosparam | [
rospy ](/rospy?distro=lunar) | [ rosservice ](/rosservice?distro=lunar) | [
rostest ](/rostest?distro=lunar) | [ rostopic ](/rostopic?distro=lunar) | [
roswtf ](/roswtf?distro=lunar) | [ std_srvs ](/std_srvs?distro=lunar) | [
topic_tools ](/topic_tools?distro=lunar) | [ xmlrpcpp
](/xmlrpcpp?distro=lunar) _


The ` rosparam ` tool enables command-line setting and getting of parameters
as well as loading and dumping [ Parameter Server ](/Parameter%20Server) state
to a file. The currently supported commands are:


# pyyaml customizations for binary and angle data


    @param param: parameter name to retrieve from parameter
        server. If param is a parameter namespace, entire parameter
        subtree will be downloaded.
    @type  param: str
    """
    try:
        return _succeed(get_param_server().getParam(_get_caller_id(), param))
    except socket.error:
        raise ROSParamIOException("Unable to communicate with master!")

# #698
def _pretty_print(value, indent=''):
    """
    Pretty print get value
    @param value: value to print
    @param indent: indent level, used for recursive calls
    @type  indent: str
    """
    keys = value.keys()
    keys.sort()
    for k in keys:
        v = value[k]
        if type(v) == dict:
            print "%s%s:"%(indent, k)
            _pretty_print(v, indent+'  ')
        elif type(v) == str:
            if '\n' in v:
                print indent+'%s: |'%k
                for l in v.split('\n'):
                    print indent+'  '+l
            else:
                print "%s%s: %s"%(indent, k, v)
        else:
            dump = yaml.dump(v)
            # #1617
            # newer versions of python-yaml append the '...' document end
            # syntax.  as YAML functions fine w/o it, and as it is
            # confusing to users who are just getting a single scalar, we
            # strip it
            if dump.endswith('\n...\n'):


You can also set parameters on the [ Parameter Server ](/Parameter%20Server) .
These parameters will be stored on the Parameter Server before any nodes are
launched.


  * Immutable Page
  * Comments
  * [ Info ](/action/info/rosparam?action=info)
  * [ Attachments ](/action/AttachFile/rosparam?action=AttachFile)
  * More Actions:  Raw Text  Print View  Render as Docbook  Delete Cache  \------------------------  Check Spelling  Like Pages  Local Site Map  \------------------------  Rename Page  Copy Page  Delete Page  \------------------------  My Pages  Subscribe User  \------------------------  Remove Spam  Revert to this revision  Package Pages  Sync Pages  \------------------------  CreatePdfDocument  Load  RawFile  Save  SlideShow


  * **[ Code API ](http://docs.ros.org/jade/api/rosparam/html) **
  * [ Tutorials ](/rosparam/Tutorials)
  * [ FAQ ](http://answers.ros.org/questions/scope:all/sort:activity-desc/tags:rosparam/page:1/)
  * [ Changelog ](http://docs.ros.org/en/jade/changelogs/rosparam/changelog.html)
  * [ Change List ](/ros_comm/ChangeList)
  * [ Reviews ](/rosparam/Reviews)


def construct_yaml_binary(loader, node):
    """
    Overrides pyaml's constructor for binary data. Wraps binary data in
    xmlrpclib.Binary container instead of straight string
    representation.
    """
    return xmlrpclib.Binary(loader.construct_yaml_binary(node))

# register the (de)serializers with pyyaml
yaml.add_representer(xmlrpclib.Binary,represent_xml_binary)
yaml.add_constructor(u'tag:yaml.org,2002:binary', construct_yaml_binary)


Advertisement


NOTE: by convention, the roslaunch XML files are named with the extension `
.launch ` , e.g. ` example.launch ` .


def set_param(param, value, verbose=False):
    """
    Set param on the ROS parameter server using a YAML value.

    @param param: parameter name
    @type  param: str
    @param value: yaml-encoded value
    @type  value: str
    """
    set_param_raw(param, yaml.load(value), verbose=verbose)


    arg = None
    ns = ''

    if len(args) == 0:
        if cmd == 'dump':
            parser.error("invalid arguments. Please specify a file name")
        elif cmd == 'get':
            parser.error("invalid arguments. Please specify a parameter name")
    elif len(args) == 1:
        arg = args[0]
    elif len(args) == 2 and cmd == 'dump':
        arg = args[0]
        ns = args[1]
    else:
        parser.error("too many arguments")


Contents


Documented


[ See rosparam on index.ros.org for more info including aything ROS 2 related.
](https://index.ros.org/p/rosparam)


    * Verbose output. e.g.:

                $ rosparam dump -v gains.yaml /gains
        dumping namespace [/gains] to file [gains.yaml]
        /gains/i=1.0
        /gains/p=1.0
        /gains/d=1.0


  * [ catkin ](/catkin?distro=jade)
  * [ rosgraph ](/rosgraph?distro=jade)


In either case, the angle value is converted to radians (float).


    * e.g. ` $(anon rviz-1) ` . Generates an anonymous id based on ` name ` . ` name ` itself is a unique identifier: multiple uses of ` $(anon foo) ` will create the same "anonymized" [ name ](/Names) . This is used for <node> ` name ` attributes in order to create [ nodes ](/Nodes) with anonymous [ names ](/Names) , as ROS requires nodes to have unique names. For example:

                  <node name="$(anon foo)" pkg="rospy_tutorials" type="talker.py" />
          <node name="$(anon foo)" pkg="rospy_tutorials" type="talker.py" />


def represent_xml_binary(loader, data):
    """
    Adds a pyyaml serializer to handle xmlrpclib.Binary objects
    """
    data = base64.b64encode(data.data)
    return loader.represent_scalar(u'tag:yaml.org,2002:binary', data, style='|')


_**[ ros_comm ](/ros_comm?distro=diamondback) ** : [ cpp_common
](/cpp_common?distro=diamondback) | [ message_filters
](/message_filters?distro=diamondback) | [ perf_roscpp
](/perf_roscpp?distro=diamondback) | [ rosbag ](/rosbag?distro=diamondback) |
[ rosbagmigration ](/rosbagmigration?distro=diamondback) | [ rosconsole
](/rosconsole?distro=diamondback) | [ roscore_migration_rules
](/roscore_migration_rules?distro=diamondback) | [ roscpp
](/roscpp?distro=diamondback) | [ roscpp_serialization
](/roscpp_serialization?distro=diamondback) | [ roscpp_traits
](/roscpp_traits?distro=diamondback) | [ rosgraph
](/rosgraph?distro=diamondback) | [ rosgraph_msgs
](/rosgraph_msgs?distro=diamondback) | [ roslaunch
](/roslaunch?distro=diamondback) | [ roslisp ](/roslisp?distro=diamondback) |
[ rosmaster ](/rosmaster?distro=diamondback) | [ rosmsg
](/rosmsg?distro=diamondback) | [ rosnode ](/rosnode?distro=diamondback) | [
rosout ](/rosout?distro=diamondback) | rosparam | [ rospy
](/rospy?distro=diamondback) | [ rosrecord ](/rosrecord?distro=diamondback) |
[ rosservice ](/rosservice?distro=diamondback) | [ rostest
](/rostest?distro=diamondback) | [ rostime ](/rostime?distro=diamondback) | [
rostopic ](/rostopic?distro=diamondback) | [ roswtf
](/roswtf?distro=diamondback) | [ std_msgs ](/std_msgs?distro=diamondback) | [
std_srvs ](/std_srvs?distro=diamondback) | [ topic_tools
](/topic_tools?distro=diamondback) | [ xmlrpcpp
](/xmlrpcpp?distro=diamondback) _


    ns = GLOBALNS
    if len(args) == 1:
        ns = script_resolve_name(NAME, args[0])
    elif len(args) == 2:
        parser.error("too many arguments")


#  Wiki


# LIST


[ ![The Robotics Back-End](https://roboticsbackend.com/wp-
content/uploads/2020/02/cropped-favicon_white-1.png)
](https://roboticsbackend.com/ "The Robotics Back-End")


* [ <launch> ](/roslaunch/XML/launch)


from roslib.names import ns_join, get_ros_namespace, make_caller_id, make_global_ns, GLOBALNS
from roslib.scriptutil import get_param_server, script_resolve_name


* **groovy:** _Documentation generated on October 06, 2014 at 11:47 AM_


import base64
import math
import os
import re
import sys
import socket
import traceback
import xmlrpclib


** Jenkins jobs  (6) **


_**[ ros_comm ](/ros_comm?distro=kinetic) ** : [ message_filters
](/message_filters?distro=kinetic) | [ ros ](/ros?distro=kinetic) | [ rosbag
](/rosbag?distro=kinetic) | [ rosconsole ](/rosconsole?distro=kinetic) | [
roscpp ](/roscpp?distro=kinetic) | [ rosgraph ](/rosgraph?distro=kinetic) | [
rosgraph_msgs ](/rosgraph_msgs?distro=kinetic) | [ roslaunch
](/roslaunch?distro=kinetic) | [ roslisp ](/roslisp?distro=kinetic) | [
rosmaster ](/rosmaster?distro=kinetic) | [ rosmsg ](/rosmsg?distro=kinetic) |
[ rosnode ](/rosnode?distro=kinetic) | [ rosout ](/rosout?distro=kinetic) |
rosparam | [ rospy ](/rospy?distro=kinetic) | [ rosservice
](/rosservice?distro=kinetic) | [ rostest ](/rostest?distro=kinetic) | [
rostopic ](/rostopic?distro=kinetic) | [ roswtf ](/roswtf?distro=kinetic) | [
std_srvs ](/std_srvs?distro=kinetic) | [ topic_tools
](/topic_tools?distro=kinetic) | [ xmlrpcpp ](/xmlrpcpp?distro=kinetic) _


  * Maintainer status: maintained
  * Maintainer: Dirk Thomas <dthomas AT osrfoundation DOT org>
  * Author: Ken Conley
  * License: BSD
  * Source: git [ https://github.com/ros/ros_comm.git ](https://github.com/ros/ros_comm) (branch: lunar-devel)


Contents


_**[ ros_comm ](/ros_comm?distro=noetic) ** : [ message_filters
](/message_filters?distro=noetic) | [ ros ](/ros?distro=noetic) | [ rosbag
](/rosbag?distro=noetic) | [ rosconsole ](/rosconsole?distro=noetic) | [
roscpp ](/roscpp?distro=noetic) | [ rosgraph ](/rosgraph?distro=noetic) | [
rosgraph_msgs ](/rosgraph_msgs?distro=noetic) | [ roslaunch
](/roslaunch?distro=noetic) | [ roslisp ](/roslisp?distro=noetic) | [
rosmaster ](/rosmaster?distro=noetic) | [ rosmsg ](/rosmsg?distro=noetic) | [
rosnode ](/rosnode?distro=noetic) | [ rosout ](/rosout?distro=noetic) |
rosparam | [ rospy ](/rospy?distro=noetic) | [ rosservice
](/rosservice?distro=noetic) | [ rostest ](/rostest?distro=noetic) | [
rostopic ](/rostopic?distro=noetic) | [ roswtf ](/roswtf?distro=noetic) | [
std_srvs ](/std_srvs?distro=noetic) | [ topic_tools
](/topic_tools?distro=noetic) | [ xmlrpcpp ](/xmlrpcpp?distro=noetic) _


[ ![ROS For Beginners - A Step By Step Course](https://roboticsbackend.com/wp-
content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
](https://rbcknd.com/ros-for-beginners)


**Package Links**


    <launch>
        <param name="my_integer" type="int" value="7" />
        <param name="my_float" type="double" value="3.14" />
        <param name="my_string" type="str" value="hello" />
    </launch>


  * [ controller_manager ](/controller_manager?distro=melodic)
  * [ pr2_controller_manag... ](/pr2_controller_manager?distro=melodic)
  * [ ros_comm ](/ros_comm?distro=melodic)
  * [ roslaunch ](/roslaunch?distro=melodic)
  * [ sr_moveit_hand_confi... ](/sr_moveit_hand_config?distro=melodic)


#  Package Summary


* **indigo:** _Documentation generated on June 07, 2019 at 04:56 AM_ ( [ doc job ](http://build.ros.org/view/Idoc/job/Idoc__ros_comm__ubuntu_trusty_amd64) ).


def dump_params(filename, param, verbose=False):
    """
    Download a parameter tree from the Parameter Server and store in a yaml file
    @param filename: name of file to save YAML representation
    @type  filename: str
    @param param: name of parameter/namespace to dump
    @type  param: str
    @param verbose: print verbose output for debugging
    @type  verbose: bool
    """
    tree = get_param(param)
    if verbose:
        print_params(tree, param)
    f = open(filename, 'w')
    try:
        yaml.dump(tree, f)
    finally:
        f.close()


    $ rosparam list | grep '/robot1'
    /robot1/battery/milliamp
    /robot1/camera1/brightness


** Used by  (5) **


Cookie Settings  Accept All


* Pretty-print output. _WARNING: this is not YAML-safe_ .


Table of Contents


` file="$(find pkg-name)/path/foo.yaml" ` _(` load ` or ` dump ` commands) _


    if cmd == 'get':
        _rosparam_cmd_get_param(script_resolve_name(NAME, arg), pretty=options.pretty, verbose=options.verbose)
    else:
        if options.verbose:
            print "dumping namespace [%s] to file [%s]"%(ns, arg)
        dump_params(arg, script_resolve_name(NAME, ns), verbose=options.verbose)


Example:


Now, let’s modify an existing parameter.


    <arg name="whitelist" default="[3, 2]"/>
    <rosparam param="whitelist" subst_value="True">$(arg whitelist)</rosparam>


  * [ pr2_controller_manag... ](/pr2_controller_manager?distro=electric)
  * [ roslaunch ](/roslaunch?distro=electric)
  * [ test_roslaunch ](/test_roslaunch?distro=electric)
  * [ test_rosparam ](/test_rosparam?distro=electric)


Skip to content


    $ rosparam get /my_float
    3.14


def get_param(param):
    """
    Download a parameter from Parameter Server


**Example of accessing a list in[ roscpp ](/roscpp) code: **


                dump = dump[:-4]

            sys.stdout.write("%s%s: %s"%(indent, k, dump))

def _rosparam_cmd_get_param(param, pretty=False, verbose=False):
    """
    Download a parameter tree and print to screen
    @param param: parameter name to retrieve from Parameter
        Server. If param is a parameter namespace, entire parameter
        subtree will be downloaded.
    @type  param: str
    """
    # yaml.dump has a \n at the end, so use stdout.write instead of print
    if verbose:
        print "getting parameter [%s]"%param
    val = get_param(param)
    if pretty and type(val) in [dict, str]:
        if type(val) == dict:
            _pretty_print(val)
        else:
            if '\n' in val:
                print '|'
                for l in val.split('\n'):
                    print '  '+l
            else:
                print val
    else:
        dump = yaml.dump(val)
        # #1617
        # newer versions of python-yaml append the '...' document end
        # syntax.  as YAML functions fine w/o it, and as it is
        # confusing to users who are just getting a single scalar, we
        # strip it
        if dump.endswith('\n...\n'):
            dump = dump[:-5]


* **electric:** _Documentation generated on March 02, 2013 at 01:23 PM_


` param="param-name" `


Menu


def delete_param(param, verbose=False):
    """
    Delete a parameter from the Parameter Server
    @param param: parameter name
    @type  param: str
    @param verbose: print verbose output for debugging
    @type  verbose: bool
    """
    try:
        if param == GLOBALNS:
            # not allowed to delete the root of the tree as it must always
            # have a value. the equivalent command is setting the root to an
            # empty dictionary
            _succeed(get_param_server().setParam(_get_caller_id(), GLOBALNS, {}))
            if verbose:
                print "deleted ENTIRE parameter server"
        else:
            _succeed(get_param_server().deleteParam(_get_caller_id(), param))
            if verbose:
                print "deleted parameter [%s]"%param
    except socket.error:
        raise ROSParamIOException("Unable to communicate with master!")

# LOAD/SET


# allow both !degrees 180, !radians 2*pi
pattern = re.compile(r'^deg\([^\)]*\)$')
yaml.add_implicit_resolver(u'!degrees', pattern, first="deg(")
pattern = re.compile(r'^rad\([^\)]*\)$')
yaml.add_implicit_resolver(u'!radians', pattern, first="rad(")


##  See Also


  * ` get <parameter-name> `
    * Get a parameter value.

                $ rosparam get parameter_name


##  roslaunch API


Others


** Used by  (5) **


  * ` dump <file> `
    * Dump the YAML-formatted contents of the [ Parameter Server ](/Parameter%20Server) to a file.

                $ rosparam dump dump.yaml


With ` rosparam list ` you can see the entire list of all params running in
your Parameter Server.


Necessary


A ROS master has been started and all your params are loaded inside the
Parameter Server. Now let’s use rosparam to understand and do some debugging!


` -v `


rosparam contains the rosparam command-line tool for getting and setting ROS
Parameters on the [ Parameter Server
](http://www.ros.org/wiki/Parameter%20Server) using YAML-encoded files. It
also contains an experimental library for using YAML with the Parameter
Server. This library is intended for internal use only. rosparam can be
invoked within a [ roslaunch ](http://www.ros.org/wiki/roslaunch) file.


[ ![ros.org](/custom/images/ros_org.png) ](/) |  [ About
](http://www.ros.org/about-ros) | [ Support ](/Support) | [ Discussion Forum
](http://discourse.ros.org/) | [ Index ](http://index.ros.org/) | [ Service
Status ](http://status.ros.org/) | [ ros @ Robotics Stack Exchange
](https://robotics.stackexchange.com/questions/tagged/ros)
---|---
![](/custom/images/menu_left.png) [
![Documentation](/custom/images/menu_documentation.png) ](/)
![](/custom/images/menu_spacer.png) [ ![Browse
Software](/custom/images/menu_browse_software.png)
](https://index.ros.org/packages) ![](/custom/images/menu_spacer.png) [
![News](/custom/images/menu_news.png) ](https://discourse.ros.org/c/general)
![](/custom/images/menu_spacer.png) [
![Download](/custom/images/menu_download.png) ](/ROS/Installation)
![](/custom/images/menu_right.png)

  * [ roslaunch ](/roslaunch)
  * [ XML ](/roslaunch/XML)


* [ <include> ](/roslaunch/XML/include)


Run this launch file:


All in all, the ` rosparam ` command line tool is mostly used for debugging
during development.


def _get_caller_id():
    """
    @return: caller ID for rosparam ROS client calls
    @rtype: str
    """
    return make_caller_id('rosparam-%s'%os.getpid())


They are also useful for embedding ` $(find ...) ` in yaml strings and to a
lesser extent any of the other [ substitution patterns
](/roslaunch/XML#substitution_args) .


** Dependencies  (2) **


Let’s create a simple [ launch file ](https://roboticsbackend.com/what-is-a-
ros-launch-file/) which we’ll fill with 3 simple parameters. In a ROS package
(in this example: my_robot_tutorials), create a launch/ folder. Inside this
folder, create a launch file (in this example: example_rosparam.launch).


###  Examples


#  Package Summary


def upload_params(ns, values, verbose=False):
    """
    Upload params to the Parameter Server
    @param values: key/value dictionary, where keys are parameter names and values are parameter values
    @type  values: dict
    @param ns: namespace to load parameters into
    @type  ns: str
    """
    if ns == '/' and not type(values) == dict:
        raise ROSParamException("global / can only be set to a dictionary")
    if verbose:
        print_params(values, ns)
    set_param_raw(ns, values)


###  A More Complicated Example


**Package Links**


#  Wiki


Close


    * Dump only the the parameters in the specified namespace.

                $ rosparam dump dump.yaml /namespace


* [ <rosparam> ](/roslaunch/XML/rosparam)


Analytical cookies are used to understand how visitors interact with the
website. These cookies help provide information on metrics the number of
visitors, bounce rate, traffic source, etc.


Documented


Released


##  Using namespaces with rosparam


[ ![ros.org](/custom/images/ros_org.png) ](/) |  [ About
](http://www.ros.org/about-ros) | [ Support ](/Support) | [ Discussion Forum
](http://discourse.ros.org/) | [ Index ](http://index.ros.org/) | [ Service
Status ](http://status.ros.org/) | [ ros @ Robotics Stack Exchange
](https://robotics.stackexchange.com/questions/tagged/ros)
---|---
![](/custom/images/menu_left.png) [
![Documentation](/custom/images/menu_documentation.png) ](/)
![](/custom/images/menu_spacer.png) [ ![Browse
Software](/custom/images/menu_browse_software.png)
](https://index.ros.org/packages) ![](/custom/images/menu_spacer.png) [
![News](/custom/images/menu_news.png) ](https://discourse.ros.org/c/general)
![](/custom/images/menu_spacer.png) [
![Download](/custom/images/menu_download.png) ](/ROS/Installation)
![](/custom/images/menu_right.png)

  * [ rosparam ](/rosparam)


def load_file(filename, default_namespace=None, verbose=False):
    """
    Load the YAML document from the specified file

    @param filename: name of filename
    @type  filename: str
    @param default_namespace: namespace to load filename into
    @type  default_namespace: str
    @return [(dict, str)...]: list of parameter dictionary and
    corresponding namespaces for each YAML document in the file
    @raise ROSParamException: if unable to load contents of filename
    """
    if not os.path.isfile(filename):
        raise ROSParamException("file [%s] does not exist"%filename)
    if verbose:
        print "reading parameters from [%s]"%filename
    f = open(filename, 'r')
    try:
        return load_str(f.read(), filename, default_namespace=default_namespace, verbose=verbose)
    finally:
        f.close()

def load_str(str, filename, default_namespace=None, verbose=False):
    """
    Load the YAML document as a string

    @param filename: name of filename, only used for debugging
    @type  filename: str
    @param default_namespace: namespace to load filename into
    @type  default_namespace: str
    @param str: YAML text
    @type  str: str
    @return: list of parameter dictionary and
        corresponding namespaces for each YAML document in the file
    @rtype: [(dict, str)...]
    """
    paramlist = []
    default_namespace = default_namespace or get_ros_namespace()
    for doc in yaml.load_all(str):
        if NS in doc:


import yaml


** Used by  (5) **


** Dependencies  (1) **


Advertisement cookies are used to provide visitors with relevant ads and
marketing campaigns. These cookies track visitors across websites and collect
information to provide customized ads.


* [ <machine> ](/roslaunch/XML/machine)


####  ROS 2 Documentation


This page describes the XML format used for [ roslaunch ](/roslaunch) `
.launch ` files. For background on [ roslaunch ](/roslaunch) , its
functionality, and related tools, please consult the [ roslaunch ](/roslaunch)
page first.


Continuous Integration:  1400 / 1401


###  rosparam set


  * **[ Code API ](http://docs.ros.org/fuerte/api/rosparam/html) **
  * [ Tutorials ](/rosparam/Tutorials)
  * [ FAQ ](http://answers.ros.org/questions/scope:all/sort:activity-desc/tags:rosparam/page:1/)
  * [ Change List ](/ros_comm/ChangeList)
  * [ Reviews ](/rosparam/Reviews)


    angle1: !degrees 181.0
    angle2: !radians 3.14169


  * **[ Code API ](http://docs.ros.org/lunar/api/rosparam/html) **
  * [ Tutorials ](/rosparam/Tutorials)
  * [ FAQ ](http://answers.ros.org/questions/scope:all/sort:activity-desc/tags:rosparam/page:1/)
  * [ Changelog ](http://docs.ros.org/en/lunar/changelogs/rosparam/changelog.html)
  * [ Change List ](/ros_comm/ChangeList)
  * [ Reviews ](/rosparam/Reviews)


_**[ ros_comm ](/ros_comm?distro=jade) ** : [ message_filters
](/message_filters?distro=jade) | [ ros ](/ros?distro=jade) | [ rosbag
](/rosbag?distro=jade) | [ rosconsole ](/rosconsole?distro=jade) | [ roscpp
](/roscpp?distro=jade) | [ rosgraph ](/rosgraph?distro=jade) | [ rosgraph_msgs
](/rosgraph_msgs?distro=jade) | [ roslaunch ](/roslaunch?distro=jade) | [
roslisp ](/roslisp?distro=jade) | [ rosmaster ](/rosmaster?distro=jade) | [
rosmsg ](/rosmsg?distro=jade) | [ rosnode ](/rosnode?distro=jade) | [ rosout
](/rosout?distro=jade) | rosparam | [ rospy ](/rospy?distro=jade) | [
rosservice ](/rosservice?distro=jade) | [ rostest ](/rostest?distro=jade) | [
rostopic ](/rostopic?distro=jade) | [ roswtf ](/roswtf?distro=jade) | [
std_srvs ](/std_srvs?distro=jade) | [ topic_tools ](/topic_tools?distro=jade)
| [ xmlrpcpp ](/xmlrpcpp?distro=jade) _


    <launch>
      <node name="talker" pkg="rospy_tutorials" type="talker" />
    </launch>


We directly found the 3 params we previously set in the launch file!


* Scope the parameters to the specified namespace.


Performance cookies are used to understand and analyze the key performance
indexes of the website which helps in delivering a better user experience for
the visitors.


    $ rosparam set /robot1/camera1/brightness 0.5
    $ rosparam set /robot1/battery/milliamp 15000
    $ rosparam set /robot2/camera1/brightness 0.8


def _set_optparse_neg_args(parser, argv):
    # we don't use optparse to parse actual arguments, just options,
    # due to the fact that optparse doesn't handle negative numbers as
    # arguments. This parsing is complicated by the fact that we still
    # need to respect argument-bearing options like --textfile.
    args = []
    optparse_args = []
    skip = False
    for s in argv[2:]:
        if s.startswith('-'):
            if s in ['-t', '--textfile', '-b', '--binfile']:
                skip = True
                optparse_args.append(s)
            elif skip:
                parser.error("-t and --textfile options require an argument")
            elif len(s) > 1 and ord(s[1]) >= ord('0') and ord(s[1]) <= ord('9'):
                args.append(s)
            else:
                optparse_args.append(s)
        else:
            if skip:
                skip = False
                optparse_args.append(s)
            else:
                args.append(s)
    options, _ = parser.parse_args(optparse_args)
    return options, args


delete_param(script_resolve_name(NAME, arg), verbose=options.verbose)


  * [ controller_manager ](/controller_manager?distro=noetic)
  * [ pr2_controller_manag... ](/pr2_controller_manager?distro=noetic)
  * [ ros_comm ](/ros_comm?distro=noetic)
  * [ roslaunch ](/roslaunch?distro=noetic)


# utilities


  * Tutorials
    * [ ROS ](https://roboticsbackend.com/category/ros/)
    * [ ROS2 ](https://roboticsbackend.com/category/ros2/)
    * [ Raspberry Pi ](https://roboticsbackend.com/category/raspberry-pi/)
    * [ Arduino ](https://roboticsbackend.com/category/arduino/)
  * [ Youtube ](https://www.youtube.com/channel/UCelRThOKlWMnpjqr5EBq6tg?sub_confirmation=1)
  * [ **Courses** ](https://roboticsbackend.com/courses/)
  * [ Contact ](https://roboticsbackend.com/contact/)


Continuous Integration


###  Attributes


# TODO: break this into separate routines, has gotten too ugly to multiplex
def _rosparam_cmd_set_load(cmd, argv):
    """
    Process command line for rosparam set/load, e.g.::
      rosparam load file.yaml [namespace]
      rosparam set param value
    @param cmd: command name
    @type  cmd: str
    @param argv: command-line args
    @type  argv: str
    """
    if cmd == 'load':
        parser = OptionParser(usage="usage: %prog load [options] file [namespace]", prog=NAME)
    elif cmd == 'set':
        parser = OptionParser(usage="usage: %prog set [options] parameter value", prog=NAME)
        parser.add_option("-t", "--textfile", dest="text_file", default=None,
                          metavar="TEXT_FILE", help="set parameters to contents of text file")
        parser.add_option("-b", "--binfile", dest="bin_file", default=None,
                          metavar="BINARY_FILE", help="set parameters to contents of binary file")


  * **[ Code API ](http://docs.ros.org/en/noetic/api/rosparam/html) **
  * [ Tutorials ](/rosparam/Tutorials)
  * [ FAQ ](http://answers.ros.org/questions/scope:all/sort:activity-desc/tags:rosparam/page:1/)
  * [ Changelog ](http://docs.ros.org/en/noetic/changelogs/rosparam/changelog.html)
  * [ Change List ](/ros_comm/ChangeList)
  * [ Reviews ](/rosparam/Reviews)


###  Minimal Example


class ROSParamException(Exception):
    """
    rosparam base exception type
    """
    pass
class ROSParamIOException(ROSParamException):
    """
    Exception for communication-based (i/o) errors.
    """
    pass


  * [ Distributions ](/Distributions)
  * [ ROS/Installation ](/ROS/Installation)
  * [ ROS/Tutorials ](/ROS/Tutorials)
  * [ RecentChanges ](/RecentChanges)
  * [ roslaunch/XML ](/roslaunch/XML)


#  Package Summary


  * [ hrl_ft ](/hrl_ft?distro=fuerte)
  * [ hrl_pr2_arms ](/hrl_pr2_arms?distro=fuerte)
  * [ openrave_actionlib ](/openrave_actionlib?distro=fuerte)
  * [ pr2_controller_manag... ](/pr2_controller_manager?distro=fuerte)
  * [ rosh ](/rosh?distro=fuerte)
  * [ trajectory_sampling_... ](/trajectory_sampling_gui?distro=fuerte)


** Used by  (4) **


def _rosparam_cmd_list(argv):
    """
    Process command line for rosparam set/load, e.g.::
      rosparam load file.yaml [namespace]
      rosparam set param value
    @param argv: command-line args
    @type  argv: str
    """
    parser = OptionParser(usage="usage: %prog list [namespace]", prog=NAME)
    options, args = parser.parse_args(argv[2:])


* Show verbose output.


Advertisement


* ` $(dirname) ` returns the absolute path to the directory of the launch file in which it appears. This can be used in conjunction with ` eval ` and ` if/unless ` to modify behaviour based on the installation path, or simply as a convenience for referencing ` launch ` or ` yaml ` files relative to the current file rather than relative to a package root (as with ` $(find PKG) ` ).


##  Launch file for this example


      * Setting a list with one as a string, integer, and float:

                        $ rosparam set /foo "['1', 1, 1.0]"


  * **[ Code API ](http://docs.ros.org/indigo/api/rosparam/html) **
  * [ Tutorials ](/rosparam/Tutorials)
  * [ FAQ ](http://answers.ros.org/questions/scope:all/sort:activity-desc/tags:rosparam/page:1/)
  * [ Changelog ](http://docs.ros.org/en/indigo/changelogs/rosparam/changelog.html)
  * [ Change List ](/ros_comm/ChangeList)
  * [ Reviews ](/rosparam/Reviews)


Documented


  * Author: Ken Conley/kwc@willowgarage.com
  * License: BSD
  * Repository: [ ros ](/ros)
  * Source: svn [ https://code.ros.org/svn/ros/stacks/ros_comm/tags/ros_comm-1.4.8 ](https://code.ros.org/svn/ros/stacks/ros_comm/tags/ros_comm-1.4.8)


** Dependencies  (2) **


The ` load ` command is considered _additive_ : if you declare a dictionary or
namespace of parameters, those parameters will be added to any other
parameters declared for that namespace. Similarly, ` load ` commands can
_override_ parameters previously declared.


** Used by  (3) **


* Will compute the circumference from the _radius_ argument and assign the result to an appropriate parameter.


To remedy this limitation, all substitution commands are available as
functions _within_ ` eval ` as well: