ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to launch rviz with config outside ros package?

asked 2020-10-19 08:22:10 -0500

Ge Li gravatar image


I want to write a launch file to launch rviz, given a config file from a certain path. This is a similar question to link , but the config file is not in a ROS package. Instead I want to achieve something like:

    <node type="rviz" name="rviz" pkg="rviz" args="-d ~/config.rviz" />

But the config file cannot be read correctly. However, if I call rviz -d ~/config.rviz, it works as expected. I am quite confused regarding the functionalities of roslaunch...

The reason of writing this launch file is that I want to include this launch file from other launch files...

I will appreciate any help of yours,

Thank you!

Best, Bruce.

edit retag flag offensive close merge delete



But the config file cannot be read correctly.

that's because you expect ~ to be resolved to $HOME, and eventually to the absolute path to your home directory.

However, ~ only means something to Bash. It's the responsibility of Bash to replace ~ with an actual path, not roslaunch. So roslaunch will not do that, and RViz is then passed a path it cannot find.

gvdhoorn gravatar image gvdhoorn  ( 2020-10-20 03:16:41 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-10-20 03:11:23 -0500

GeorgNo gravatar image

Try it with absolute path e.g. args="-d /home/<user_name>/config.rviz"

edit flag offensive delete link more

Question Tools


Asked: 2020-10-19 08:22:10 -0500

Seen: 688 times

Last updated: Oct 20 '20