Description

Publishes rosgraph_msgs/msg/Clock at each simulation step (by default), so that ROS nodes consuming /clock advance on simulation time rather than wall time.

#include <ChROSClockHandler.h>

Inherits chrono::ros::ChROSHandler.

Public Member Functions

 ChROSClockHandler (double update_rate=0, const std::string &topic_name="/clock")
 The update rate defaults to 0 (tick on every simulation step). More...
 
virtual bool Initialize (ChROSBridge &bridge) override
 Creates the single /clock publisher.
 

Protected Member Functions

virtual void Tick (double time) override
 Publishes the current simulation time as a Clock message.
 

Constructor & Destructor Documentation

◆ ChROSClockHandler()

chrono::ros::ChROSClockHandler::ChROSClockHandler ( double  update_rate = 0,
const std::string &  topic_name = "/clock" 
)

The update rate defaults to 0 (tick on every simulation step).

The topic defaults to "/clock", which is what ROS time sources expect.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_ros/handlers/ChROSClockHandler.h
  • /builds/uwsbel/chrono/src/chrono_ros/handlers/ChROSClockHandler.cpp