Description

This handler is responsible for publishing a robot model to be visualized in RViz RViz expects a string containing the robot model.

We don't really need to publish this at a high rate, so the update rate is set implicitly to a very large value. This effectively means it will only be published once. This is okay since we'll also set the QoS to be local transient, meaning late joiners will still receive the message even if it's already been published.

#include <ChROSRobotModelHandler.h>

Inheritance diagram for chrono::ros::ChROSRobotModelHandler:
Collaboration diagram for chrono::ros::ChROSRobotModelHandler:

Public Member Functions

 ChROSRobotModelHandler (const std::string &robot_model, const std::string &topic_name="/robot_description")
 Constructor. More...
 
virtual bool Initialize (std::shared_ptr< ChROSInterface > interface) override
 Initializes the handler. This creates the publisher for the robot model 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
 Publishes the robot model string. More...
 
- Protected Member Functions inherited from chrono::ros::ChROSHandler
 ChROSHandler (double update_rate)
 Constructor for the ChROSHandler. More...
 

Constructor & Destructor Documentation

◆ ChROSRobotModelHandler()

chrono::ros::ChROSRobotModelHandler::ChROSRobotModelHandler ( const std::string &  robot_model,
const std::string &  topic_name = "/robot_description" 
)

Constructor.

The topic name defaults to "/robot_description".

Member Function Documentation

◆ Tick()

void chrono::ros::ChROSRobotModelHandler::Tick ( double  time)
overrideprotectedvirtual

Publishes the robot model string.

Should be called infrequently (i.e. set update_rate to some really high value).

Implements chrono::ros::ChROSHandler.


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