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

Changing where logging occurs from within roslaunch

asked 2012-02-23 05:45:54 -0500

Joe gravatar image

Hello,

I currently have a robot that, when it powers on, runs a .launch file that launches all of my nodes. It also logs any errors or warnings that occur through rosout, as it likely should. Unfortunately, if an error does occur, or the robot has to shutdown, it is difficult to find the log files pertaining to those errors. My question is twofold:

1. Is it possible to change the logging directory from within roslaunch. I have tried changing the environment variable as so:

< launch>

< env name="ROS_LOG_DIR" value="$(find OryxManager)/logs" />

....NODES HERE....

< /launch>

But it still logs them to .ros/log. Any suggestions?

2. Is it possible to change which sub-folder the logs are stored in? Currently, it is based off of the run_id. Unfortunately, the run_id is a random string, and it is difficult to tell what the previous run_id if robot powered off. Would it be possible to either change the run_id, or change the logging folder name, to be something else. Bonus points if there is a way to name it based off of something more intuitive like the system time.

If there isn't any way to do this, we may have to write our own method of logging. This would be possible, but not ideal. I would greatly appreciate any advice you can provide.

Thank you,

-Joe

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-02-23 05:49:41 -0500

kwc gravatar image

roslaunch starts logging before it interprets the launch file, so setting ROS_LOG_DIR in the file won't do anything. You have to set the variable prior to launching. If you want to change how the folders are organized, simply write a wrapper script that sets ROS_LOG_DIR to your preferred organizational scheme prior to invoking roslaunch.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-02-23 05:45:54 -0500

Seen: 2,459 times

Last updated: Feb 23 '12