23 #include "gazsim_timesource_thread.h" 32 GazsimTimesourceThread::GazsimTimesourceThread()
33 :
Thread(
"GazsimTimesourceThread",
Thread::OPMODE_WAITFORWAKEUP),
38 GazsimTimesourceThread::~GazsimTimesourceThread()
45 logger->
log_info(name(),
"GazsimTimesource initializing");
48 time_sync_sub_ = gazebo_world_node->Subscribe(config->
get_string(
"/gazsim/topics/time"), &GazsimTimesourceThread::on_time_sync_msg,
this);
71 void GazsimTimesourceThread::on_time_sync_msg(ConstSimTimePtr &msg)
76 time_source_->on_time_sync_msg(msg);
GazsimTimesource(Clock *clock)
Constructor.
Fawkes library namespace.
Thread class encapsulation of pthreads.
Thread aspect to use blocked timing.
virtual void init()
Initialize the thread.
virtual void loop()
Code to execute in the thread.
void register_ext_timesource(TimeSource *ts, bool make_default=false)
Register an external time source.
virtual void log_info(const char *component, const char *format,...)
Log informational message.
virtual void finalize()
Finalize the thread.
virtual std::string get_string(const char *path)=0
Get value from configuration which is of type string.
void remove_ext_timesource(TimeSource *ts=0)
Remove external time source.