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

How can i open Rviz as ubuntu startup application

asked 2021-02-16 15:28:15 -0600

alixxx gravatar image


How can i open Rviz as ubuntu startup application?

Thanks, best regards.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2021-06-28 21:14:13 -0600

James NT gravatar image

The main issue with starting RViz on startup is that it has to have access to, and wait, until the X server is available. This ROS Answers thread describes a systemd file that accomplishes this.

edit flag offensive delete link more

answered 2021-02-16 19:56:10 -0600

updated 2021-02-16 19:58:25 -0600

It depends on what ROS version you are using. If you are using ROS2 Foxy, do as follows

  1. Create a file in the following path.


  2. Then, copy-paste the following to the file. (reference: link)

    [Desktop Entry] Type=Application Exec=/opt/ros/foxy/lib/rviz2/rviz2 Hidden=false NoDisplay=false X-GNOME-Autostart-enabled=true Name[en_US]=Rviz2 Name=/opt/ros/foxy/lib/rviz2/rviz2 Comment[en_US]= Comment=

  3. Reboot

edit flag offensive delete link more


Thank you so much for your support but did not work . I use ros-melodic and ubuntu 18.04 [Desktop Entry] Type=Application Exec=/opt/ros/melodic/lib/rviz/rviz Hidden=false NoDisplay=false X-GNOME-Autostart-enabled=true Name[en_US]=Rviz Name=/opt/ros/melodic/lib/rviz/rviz Comment[en_US]= Comment=

no change happens when i restart my computer. there is no log file, there is no information about the reason. What do you think could be the reason?

Thanks, best regards.

alixxx gravatar image alixxx  ( 2021-02-17 03:10:10 -0600 )edit

I thought it would work as it is how you run applications on startup but I tested it and it didn't work. What actually made it work was running a terminal window on startup and putting Rviz in the ~/.bashrc file. Then, Rviz was successfully started up by the terminal window.

Hope this helps, Jaehyun

Jaehyun Shim gravatar image Jaehyun Shim  ( 2021-02-17 18:56:32 -0600 )edit

Thank you so much for support. How should I write a line to put it in bashrc ?

alixxx gravatar image alixxx  ( 2021-02-18 02:29:52 -0600 )edit

Type below in the terminal window.

$ echo 'rviz' >> ~/.bashrc

If you think you need to learn some more techniques you use with ROS, check out this link and follow the provided tutorial.

Jaehyun Shim gravatar image Jaehyun Shim  ( 2021-02-18 02:36:22 -0600 )edit

Thank you, i know this but every time i open terminal it will try to open rviz. I want rviz to open one time automatically when the computer is restarted.

alixxx gravatar image alixxx  ( 2021-02-18 02:58:03 -0600 )edit

Question Tools

1 follower


Asked: 2021-02-16 15:28:15 -0600

Seen: 539 times

Last updated: Jun 28 '21