Project Chrono: chrono::ros::ChROSRobotModelHandler Class Reference

Public Member Functions | Protected Member Functions | List of all members
chrono::ros::ChROSRobotModelHandler Class Reference
ROS module » ROS Handlers » ROS Robot Handlers

## 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:
[legend]
Collaboration diagram for chrono::ros::ChROSRobotModelHandler:
[legend]

## Public Member Functions
| ChROSRobotModelHandler (const std::string &robot_model, const std::string &topic_name="/robot_description")
| Constructor.
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.
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.
Protected Member Functions inherited from chrono::ros::ChROSHandler
| ChROSHandler (double update_rate)
| Constructor for the ChROSHandler.

## 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

## ◆ Initialize()

bool chrono::ros::ChROSRobotModelHandler::Initialize | ( | std::shared_ptr< ChROSInterface > | interface | ) |
| overridevirtual

Initializes the handler. This creates the publisher for the robot model topic.

Implements chrono::ros::ChROSHandler.

## ◆ 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:

- D:/W/B/src/chrono-9.0.1/src/chrono_ros/handlers/robot/ChROSRobotModelHandler.h
- D:/W/B/src/chrono-9.0.1/src/chrono_ros/handlers/robot/ChROSRobotModelHandler.cpp