This structure is able to publish a Robot's state to ROS. More...
#include </home/runner/work/mc_rtc/mc_rtc/plugins/ROS/include/mc_rtc_ros/ros.h>
Public Member Functions | |
RobotPublisher (const std::string &prefix, double rate, double dt) | |
~RobotPublisher () | |
Destructor. More... | |
void | init (const mc_rbdyn::Robot &robot, bool use_real=false) |
Initialize the publisher. More... | |
void | update (double dt, const mc_rbdyn::Robot &robot) |
Update the publisher. More... | |
void | set_rate (double rate) |
Reset the publishing rate. More... | |
This structure is able to publish a Robot's state to ROS.
When writing a controller inside mc_rtc controller framework, one is not expect to use this class. However, this is useful to have when building tools around the framework.
mc_rtc::RobotPublisher::RobotPublisher | ( | const std::string & | prefix, |
double | rate, | ||
double | dt | ||
) |
Constructor
If ROSBridge::get_node_handle returns a nullptr then this object does nothing.
prefix | TF prefix |
rate | Publishing rate |
dt | Control rate |
mc_rtc::RobotPublisher::~RobotPublisher | ( | ) |
Destructor.
void mc_rtc::RobotPublisher::init | ( | const mc_rbdyn::Robot & | robot, |
bool | use_real = false |
||
) |
Initialize the publisher.
void mc_rtc::RobotPublisher::set_rate | ( | double | rate | ) |
Reset the publishing rate.
void mc_rtc::RobotPublisher::update | ( | double | dt, |
const mc_rbdyn::Robot & | robot | ||
) |
Update the publisher.