Description

Publishes rosgraph_msgs::msg::Clock messages at each timestep (by default) of the simulation.

This is useful if you want run the ROS at a corresponding to simulation time versus wall time.

#include <ChROSClockHandler.h>

Inheritance diagram for chrono::ros::ChROSClockHandler:
Collaboration diagram for chrono::ros::ChROSClockHandler:

Public Member Functions

 ChROSClockHandler (double update_rate=0, const std::string &topic_name="/clock")
 Constructor for the ChROSClockHandler. More...
 
virtual bool Initialize (std::shared_ptr< ChROSInterface > interface) override
 Initializes this handler. Will create a single publisher for the clock information under the "/clock" topic.
 
- Public Member Functions inherited from chrono::ros::ChROSHandler
virtual ~ChROSHandler ()=default
 Destructor for the ChROSHandler.
 
virtual void Update (double time, double step) final
 Updates the internal clock and checks if a tick should occur. More...
 
const double GetUpdateRate () const
 Get the period which this handler operates at.
 
const uint64_t GetTickCount () const
 Get the number of times Tick() has been called.
 

Protected Member Functions

virtual void Tick (double time) override
 Tick this hander. Will create the clock message and publish it. By default, Tick is called at each sim update.
 
- Protected Member Functions inherited from chrono::ros::ChROSHandler
 ChROSHandler (double update_rate)
 Constructor for the ChROSHandler. More...
 

Constructor & Destructor Documentation

◆ ChROSClockHandler()

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

Constructor for the ChROSClockHandler.

The update rate defaults to 0 (i.e. to be updated at each timestep). topic_name defaults to "/clock" which overrides the ros time update handler. The chrono time will then correspond to ros time.


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