Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roslaunch fails if ROS_LOG_DIR is set and ~/.ros was not yet created #1030

Closed
TimSchneider42 opened this issue Apr 12, 2017 · 5 comments
Closed

Comments

@TimSchneider42
Copy link

TimSchneider42 commented Apr 12, 2017

Hi,

if ROS_LOG_DIR is set to something other than "~/.ros", this directory is not created. This causes the subprocess.Popen call in nodeprocess.py:298 to fail if its cwd is set to "~/.ros". That is the case for example during the automatic creation of rosmaster.

Steps to reproduce:

rm -r ~/.ros
export ROS_LOG_DIR=~/log
mkdir $ROS_LOG_DIR
roslaunch <any launchfile>

I used this launchfile to produce the error:

<launch>
  <param name="robot_description"
    value="&lt;robot&gt;&lt;/robot&gt;" />

  <node name="robot_state_publisher" pkg="robot_state_publisher"
    type="robot_state_publisher" />
</launch>

Output:

$ roslaunch test.launch
... logging to /home/*****/log/4695aafa-1f12-11e7-9ad6-64006a5db393/roslaunch-state-ub-ph-23654.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://*********/

SUMMARY
========

PARAMETERS
 * /robot_description: <robot></robot>
 * /rosdistro: kinetic
 * /rosversion: 1.12.7

NODES
  /
    robot_state_publisher (robot_state_publisher/robot_state_publisher)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
Roslaunch got a 'No such file or directory' error while attempting to run:

/opt/ros/kinetic/lib/robot_state_publisher/robot_state_publisher __name:=robot_state_publisher __log:=/home/*****/log/4695aafa-1f12-11e7-9ad6-64006a5db393/robot_state_publisher-1.log

Please make sure that all the executables in this command exist and have
executable permission. This is often caused by a bad launch-prefix.
The traceback for the exception was written to the log file
[robot_state_publisher-1] killing on exit

Homan

@dirk-thomas
Copy link
Member

dirk-thomas commented Apr 12, 2017

I don't think it is necessary to update ROS to create it on demand. The simple solution to this is to make sure the directory you are pointing to in the environment variable exists.

Please feel free to create a PR to support this or contribute to the wiki clarifying that the directory needs to exist

@dirk-thomas dirk-thomas changed the title roslaunch fails if ROS_LOG_DIR is set and ~/.ros was not yet created create custom ROS_LOG_DIR if it doesn't exist Apr 12, 2017
@dirk-thomas dirk-thomas added this to the untargeted milestone Apr 12, 2017
@TimSchneider42
Copy link
Author

Hi Dirk,

sorry if I didn't make that clear enough, but the problem is not that the directory in ROS_LOG_DIR can't be found. The problem is that the ROS home directory is only created if ROS_LOG_DIR is not set, but its existence is required by roslaunch in any case, because it is used as working directory for all ROS nodes and the ROS master. So what I am saying is that if you set ROS_LOG_DIR to a custom (existing) directory and ~/.ros does not exist, roslaunch will fail. I will clarify that in the problem description above.

Best,
Homan

@TimSchneider42 TimSchneider42 changed the title create custom ROS_LOG_DIR if it doesn't exist roslaunch fails if ROS_LOG_DIR is set and ~/.ros was not yet created Apr 12, 2017
This was referenced Apr 14, 2017
@dirk-thomas dirk-thomas removed this from the untargeted milestone Apr 14, 2017
@dirk-thomas
Copy link
Member

Thanks for clarifying. The following two PR should address the problem: ros/ros#143 #1031

@TimSchneider42
Copy link
Author

Thank you.

@arotyramel
Copy link

I had the same issue, when ROS_LOG_DIR was set.
For me the problem has resolved when I also set the ROS_HOME env variable.
e.g.

mkdir -p /tmp/roslogs
export ROS_LOG_DIR=/tmp/roslogs
export ROS_HOME=/tmp/roslogs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants