Project Chrono: chrono::ros::ChROSBodyHandler Class Reference

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

## Description

This handler is responsible for publishing state information about a ChBody.

This handler creates three publishers for the pose, twist (linear/angular velocity), and accel (linear/angular acceleration) topics.

`#include <ChROSBodyHandler.h>`

Inheritance diagram for chrono::ros::ChROSBodyHandler:
[legend]
Collaboration diagram for chrono::ros::ChROSBodyHandler:
[legend]

## Public Member Functions
| ChROSBodyHandler (double update_rate, std::shared_ptr< ChBody > body, const std::string &topic="~/")
| Constructor.
virtual bool | Initialize (std::shared_ptr< ChROSInterface > interface) override
| Initializes the handler. This creates the three publishers for the pose, twist, and accel topics.
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
| Simply calls PublishPose, PublishTwist, and PublishAccel.
Protected Member Functions inherited from chrono::ros::ChROSHandler
| ChROSHandler (double update_rate)
| Constructor for the ChROSHandler.

## Constructor & Destructor Documentation

## ◆ ChROSBodyHandler()

chrono::ros::ChROSBodyHandler::ChROSBodyHandler | ( | double | update_rate,
|  | std::shared_ptr< ChBody > | body,
|  | const std::string & | topic = "~/" )

Constructor.

The based topic is concatenated before the individual topic names. This handler will publish to the topics: <topic>/pose <topic>/twist <topic>/accel where <topic> is the passed in topic argument. If the no topic is passed, the topics will be: ~/pose ~/twist ~/accel

## Member Function Documentation

## ◆ Initialize()

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

Initializes the handler. This creates the three publishers for the pose, twist, and accel topics.

Implements chrono::ros::ChROSHandler.

## ◆ Tick()

void chrono::ros::ChROSBodyHandler::Tick | ( | double | time | ) |
| overrideprotectedvirtual

Simply calls PublishPose, PublishTwist, and PublishAccel.

Parameters

  time | The time at which the current state of the simulation is.

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/ChROSBodyHandler.h
- D:/W/B/src/chrono-9.0.1/src/chrono_ros/handlers/ChROSBodyHandler.cpp