0
$\begingroup$

Gazebo Answers logo

Hello,

I am logging state.log from gazebo-9. But however it insists logging under .gazebo/log.

Is there any way I can set the log dir to a different directory, similar to ROS_LOG_DIR in ros?

Best regards, C.


Originally posted by altineller on Gazebo Answers with karma: 9 on 2020-05-03

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

If you're logging from the command line, you can pass the --record-path flag.

If you're doing it through the C++ API, you can pass the path to LogRecord::Start.

If you're triggering it through a message, you can use the base_path field.

If you're using ROS 1, pass extra_gazebo_args:="--record-path <path>" to empty_world.launch.

If you're using ROS 2, pass record_path to gzserver.launch.py.


Originally posted by chapulina with karma: 7504 on 2020-05-03

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by altineller on 2020-05-04:
Hello @chapulina I am launching gazebo trough a launch file, in ros. and the ros gazebo arguments do not include record-path. is there a way I can still use ros, and give this command line argument?

best

Comment by chapulina on 2020-05-04:
I updated the answer to include ROS

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.