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

Permission denied when trying to run PX4 roslaunch file

asked 2019-12-03 07:59:44 -0500

kris_1313 gravatar image

updated 2022-01-22 16:10:11 -0500

Evgeny gravatar image

When I'm trying to run PX4 multi_uav_mavros_sitl.launch file it throws permission denial errors and kills the processes like this:

[rospack] Unable to create temporary cache file /home/kris/.ros/.rospack_cache.nJAzB8: Permission denied
[uav0/sitl_0-3] process has died [pid 5203, exit code 255, cmd /home/kris/Pobrane/src/Firmware/build/px4_sitl_default/bin/px4 /home/kris/Pobrane/src/Firmware/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -i 0 -w sitl_iris_0 -d __name:=sitl_0 __log:=/home/kris/.ROS_log/4da30ac2-15d2-11ea-bd56-080027229f95/uav0-sitl_0-3.log].
log file: /home/kris/.ROS_log/4da30ac2-15d2-11ea-bd56-080027229f95/uav0-sitl_0-3*.log

my system:

  • ROS Melodic (supplied with PX4 stack)
  • Ubuntu 18.04 LTS x64 (kernel: 5.0.0-36-generic)

ROS enviroment variables:

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-12-03 11:36:50 -0500

gvdhoorn gravatar image

updated 2019-12-04 08:37:20 -0500

Please show us the output of ls -al $HOME/.ros.

It's (very) likely that you've run roslaunch with sudo at some point in the past, which causes problems with access permissions for the $HOME/.ros directory.


drwxr-xr-x  3 root root 4096 lis 23 19:43 .

as you can see from this, your $HOME/.ros is owned by root. That is why you receive permissions errors.

This should fix it:

sudo chown $USER: -R $HOME/.ros

This is one of the reasons never to run roslaunch (or rosrun) with sudo or as the root user.

edit flag offensive delete link more


Here it is:

razem 12
drwxr-xr-x  3 root root 4096 lis 23 19:43 .
drwxr-xr-x 27 kris kris 4096 gru  4 15:33 ..
drwxr-xr-x  4 root root 4096 lis 23 19:43 rosdep

edit: it worked like damn charm :)

kris_1313 gravatar image kris_1313  ( 2019-12-04 08:34:52 -0500 )edit

Question Tools

1 follower


Asked: 2019-12-03 07:59:44 -0500

Seen: 1,154 times

Last updated: Dec 04 '19