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

Run RViz with configuration file from .launch file

asked 2018-04-05 10:01:10 -0600

Hi everyone!

I was wondering if there is any way you can open rviz from a launch file while openning a custom configuration. The terminal command would be:

rosrun rviz rviz -d `rospack find package_name`/rviz/config_file.rviz

Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
24

answered 2018-04-05 10:14:30 -0600

gvdhoorn gravatar image

Yes:

<launch>
  <node type="rviz" name="rviz" pkg="rviz" args="-d $(find package_name)/rviz/config_file.rviz" />
</launch>

Note that this is the same approach you would use for any program / node that accepts command line arguments. Doing it in a launch file just allows you to use the find substitutation command.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-04-05 10:01:10 -0600

Seen: 41,676 times

Last updated: Apr 05 '18