Thanks for the help! I'm a newbie with Player, so this helps a lot. I
have a few more questions, if you have time.
I'm only interested in the position command data right now. Looking at
the gazebo position driver, it doesn't seem to ever call GetCommand - it
calls PutCommand instead. The comments say that GetCommand is the new
style, so I assume the gazebo driver hasn't been updated yet. Given
this, it makes more sense to me to override PutCommand, and change the
gazebo driver to call Driver::PutCommand in its own implementation.
I think I'm also more interested in the PutCommand data than
GetCommand. I'd like to log everything that's sent to the driver,
whether or not the driver uses it. If I put it in GetCommand, I think
it would only log when the driver processes the command, not when it
I would also like to implement position command playback, but I'm
confused by how the clock works. The readlog clock sets the simulator
time directly based on the log file. The Gazebo clock uses Gazebo's
internal time. So to play back commands and have the recording control
a robot in Gazebo, I think I'd need to use the gazebo clock, and somehow
offset/sleep in the playback code so the commands come at the right
time. Is that a good way to do it, or is there some way to tell Gazebo
at what time it should process a command?
Brian Gerkey wrote:
> Stefanie Tellex wrote:
>> Is there a way to log the commands sent to a driver in player? I want
>> to record commands sent to a position interface, to record user
>> interactions with gazebo, and then play it back later.
>> It seems that writelog and readlog only record and play back from the
>> data buffer, not the command buffer. So I can record camara and
>> sensor readings, but not what commands were sent to generate those
> You got it.
> General-purpose support for logging commands is doable, but there'd be
> no way to guarantee that all commands get logged without being pretty
> intrusive (e.g., passing all commands through the logger before giving
> them to the target driver).
> If there's only one or two drivers that you're interested in logging,
> I'd recommend instrumenting them yourself. Look for invocation of
> Driver::GetCommand() and log the return values (don't forget the