Robotics StackExchange | Archived questions

How can i open Rviz as ubuntu startup application

Hello,

How can i open Rviz as ubuntu startup application?

Thanks, best regards.

Asked by alixxx on 2021-02-16 16:28:15 UTC

Comments

Answers

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.

    ~/.config/autostart/rviz.desktop

  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

Asked by Jaehyun Shim on 2021-02-16 20:56:10 UTC

Comments

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.

Asked by alixxx on 2021-02-17 04:10:10 UTC

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

Asked by Jaehyun Shim on 2021-02-17 19:56:32 UTC

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

Asked by alixxx on 2021-02-18 03:29:52 UTC

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.

Asked by Jaehyun Shim on 2021-02-18 03:36:22 UTC

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.

Asked by alixxx on 2021-02-18 03:58:03 UTC

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.

Asked by James NT on 2021-06-28 21:14:13 UTC

Comments