mc_rtc  2.14.0
mc_rtc::ROSBridge Struct Reference

Allows to access ROS functionalities within mc_rtc without explicit ROS dependencies. More...

#include </tmp/build-mc-rtc/src/mc_rtc/plugins/ROS/include/mc_rtc_ros/ros.h>

Static Public Member Functions

static NodeHandlePtr get_node_handle ()
 Get a ros::NodeHandle/rclcpp::Node. More...
 
static void set_publisher_timestep (double timestep)
 
static double get_publisher_timestep ()
 
static void init_robot_publisher (const std::string &publisher, double dt, const mc_rbdyn::Robot &robot, bool use_real=false)
 
static void update_robot_publisher (const std::string &publisher, double dt, const mc_rbdyn::Robot &robot)
 
static void stop_robot_publisher (const std::string &publisher)
 
static void remove_extra_robot_publishers (const mc_rbdyn::Robots &robots)
 
static void shutdown ()
 Stop ROS. More...
 

Detailed Description

Allows to access ROS functionalities within mc_rtc without explicit ROS dependencies.

Member Function Documentation

◆ get_node_handle()

static NodeHandlePtr mc_rtc::ROSBridge::get_node_handle ( )
static

Get a ros::NodeHandle/rclcpp::Node.

This function will return a nullptr if ROS is not available

Returns
A shared_ptr to a ros::NodeHandle/rclcpp::Node

◆ get_publisher_timestep()

static double mc_rtc::ROSBridge::get_publisher_timestep ( )
static

Gets publisher timestep

Returns
Update timestep in ms

◆ init_robot_publisher()

static void mc_rtc::ROSBridge::init_robot_publisher ( const std::string &  publisher,
double  dt,
const mc_rbdyn::Robot robot,
bool  use_real = false 
)
static

Initialize a robot publisher

Note
This should only be used on robots owned by the controller. Use RobotPublisher for external robots
Parameters
publisherName of the publisher
dtController timestep
robotWhich robot to publish
use_realUse the real URDF rather than the default one

◆ remove_extra_robot_publishers()

static void mc_rtc::ROSBridge::remove_extra_robot_publishers ( const mc_rbdyn::Robots robots)
static

Remove the publisher of every removed robot

Parameters
robotsController's robots

◆ set_publisher_timestep()

static void mc_rtc::ROSBridge::set_publisher_timestep ( double  timestep)
static

Set publisher timestep

Parameters
timestepUpdate timestep in ms

◆ shutdown()

static void mc_rtc::ROSBridge::shutdown ( )
static

Stop ROS.

◆ stop_robot_publisher()

static void mc_rtc::ROSBridge::stop_robot_publisher ( const std::string &  publisher)
static

Stop the publication of a robot

Parameters
publisherName of the publisher

◆ update_robot_publisher()

static void mc_rtc::ROSBridge::update_robot_publisher ( const std::string &  publisher,
double  dt,
const mc_rbdyn::Robot robot 
)
static

Update the robot publisher state

Note
This should only be used on robots owned by the controller. Use RobotPublisher for external robots
Parameters
publisherName of the publisher
dtController timestep
robotWhich robot to publish

The documentation for this struct was generated from the following file: