Gazebo | Ignition | Community
Ask Your Question

gz log does not work, causes segmentation fault

asked 2020-10-29 14:51:06 -0600

waffle_pi gravatar image

I launched an empty world with a waffle_pi, using the urdf from turtlebot3_description

Then in another terminal I run gz log -d 1 -e, I got

<?xml version='1.0'?>
<log_start>0 0</log_start>
<log_end>0 0</log_end>

Segmentation fault

If I run gz log -d 1 without the -e, the terminal that is running the world shows

Error [] Unable to call parseURDF on robot model
Error [] parse as old deprecated model file failed.

This happens on both gazebo 7.16.1 with ROS Kinetic and 9.13.2 with ROS Melodic

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-10-29 17:38:23 -0600

You are not supposed to use -d with -e. -d is for starting/stopping recording, and -e is for printing the contents of a file. A possible workflow could be:

  • gz log -d 1 to start recording
  • gz log -d 0 to stop recording
  • gz log -e -f <path-to>/state.log to view the contents of the log

You can ignore the parseUrdf error.

edit flag offensive delete link more


Thanks! A follow up question: I see that gz log -d 1 actually makes gazebo publish a message to ~/log/control, do you think I can write a ROS node, listen to a topic and do the same when received a message? Basically I want to programmatically start/stop recording

waffle_pi gravatar imagewaffle_pi ( 2020-10-29 21:59:10 -0600 )edit

Probably. If you don't want to look into the details, you can also do a system call to gz log ....

nlamprian gravatar imagenlamprian ( 2020-10-30 04:26:08 -0600 )edit

turns out it only works when you publish the message to gazebo/default/log/control but not ~/log/control

waffle_pi gravatar imagewaffle_pi ( 2020-10-30 16:32:41 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-10-29 14:51:06 -0600

Seen: 56 times

Last updated: Oct 29 '20