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

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:

ROS_ETC_DIR=/opt/ros/melodic/etc/ros
ROS_ROOT=/opt/ros/melodic/share/ros
ROS_MASTER_URI=http://localhost:11311
ROS_VERSION=1
ROS_PYTHON_VERSION=2
ROS_PACKAGE_PATH=/home/kris/catkin_ws/src/mavlink:/home/kris/catkin_ws/src/mavros/libmavconn:/home/kris/catkin_ws/src/mavros/mavros_msgs:/home/kris/catkin_ws/src/mavros/mavros:/home/kris/catkin_ws/src/mavros/mavros_extras:/home/kris/catkin_ws/src/mavros/test_mavros:/opt/ros/melodic/share
ROSLISP_PACKAGE_DIRECTORIES=/home/kris/catkin_ws/devel/share/common-lisp
ROS_DISTRO=melodic
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

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.


Edit:

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

Comments

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

Stats

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

Seen: 1,240 times

Last updated: Dec 04 '19