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

Creating a desktop shortcut for a specific roslaunch

asked 2014-03-03 04:48:56 -0500

heyfred gravatar image

updated 2016-10-24 09:02:39 -0500

ngrennan gravatar image

Is it possible to create a graphical shortcut for a specific roslaunch file that can be run by a user without any terminal knowledge by double clicking on an icon?

I've tried to create a .desktop file, a .command file and a bash file but none of these seem to run the program and leave it running. The .desktop file seems to get closest but doesn't appear to respect the environment variables specified in my .bashrc file.

Thanks for any help

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2014-03-03 05:11:22 -0500

dornhege gravatar image

"An icon" is quite unspecific as that highly depends on what Desktop you use.

The safest and portable thing for me seems to make a bash script that you call from whatever icon/launcher/etc. This should work in general by just calling roslaunch. You might need to manually source your .bashrc within the script. That should fix the problem that you observed.

edit flag offensive delete link more
1

answered 2015-01-04 08:19:28 -0500

Oded gravatar image

The problem is that the .desktop doesn’t run the .bashrc sources, so your application doesn't know what ROS is along with all of its function (rosrun, roslaunch, etc.)

One way getting around it is adding to the exec command the source of ROS.

[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
TerminalOptions=bash
Exec=bash -c "source /opt/ros/indigo/setup.bash;source ~/YOUR/CATKIN/WORKSPACE/devel/setup.bash;/path/to/script.sh"
Icon=/if/you/want/one/icon.png
Name=rosapp
edit flag offensive delete link more

Comments

1
lucasw gravatar image lucasw  ( 2017-03-03 08:52:46 -0500 )edit

Question Tools

Stats

Asked: 2014-03-03 04:48:56 -0500

Seen: 3,415 times

Last updated: Mar 03 '14