Closed xela-95 closed 10 months ago
Useful resource: https://github.com/robotology/gz-sim-yarp-plugins/issues/4 .
I'm gathering documentation related to this feature to understand how to perform the porting:
I've seen that the clock plugin makes use of the thrift definition for the Clock service: https://github.com/robotology/gazebo-yarp-plugins/blob/cb3521f7543a5a07e2a65a82dedd2eb2ec2cea12/thrift/clock/clock_rpc.thrift
This file gets compiled and produces a ClockServer
class, that in turn is inherited by ClockServerImpl class. This class is used as a data member of class GazeboYarpClock that implements the gazebo::SystemPlugin
base class.
I have to understand how this logic maps to the new Gazebo sim paradigm and whether it is needed to use the thrift definitions for the clock service.
CC @traversaro
I have to understand how this logic maps to the new Gazebo sim paradigm and whether it is needed to use the thrift definitions for the clock service.
If you want to implement the /clock/rpc part of the plugin, yes. However, as a first iteration you can also just concentrate on publishing the /clock
port.
I leave here some refs to useful classes and tutorials for controlling the simulation that @diegoferigo showed me:
I think this will be useful in future to control the clock rpc part.
@traversaro, up to now the clock plugin sends on the /clock
port the current simulation time at each simulation step, do you think it's useful to add a check to avoid writing a message if the current timestamp is the same of the previous sent?
This could be useful to avoid sending thousands of messages of the same timestamp when gazebo server is launched or when in general the simulation is paused, but maybe there are cases that I don't have in mind for which it is better to always send the timestamp.
@traversaro, up to now the clock plugin sends on the
/clock
port the current simulation time at each simulation step, do you think it's useful to add a check to avoid writing a message if the current timestamp is the same of the previous sent?
Yes, I think it make sense.
Clock plugin docs is https://github.com/robotology/gazebo-yarp-plugins/blob/master/plugins/clock/include/gazebo/Clock.hh#L35 .
The clock functionality are two:
/clock
/clock/rpc
) to allows control of the simulation time.This issue focus on the first functionality, i.e. publication of simulation time on yarp port /clock.