chrono::ros::ChROSInterface Class Reference


This class handles the API interface between Chrono and ROS.

It contains a rclcpp::Node which is accessible through GetNode(). Multiple ChROSInterfaces can be created to support multiple nodes.

#include <ChROSInterface.h>

Public Member Functions

 ChROSInterface (const std::string node_name)
 Constructor for the ChROSInterface class. More...
void Initialize (rclcpp::NodeOptions options=rclcpp::NodeOptions())
 Initialize the underlying ROS 2 node. More...
void SpinSome (std::chrono::nanoseconds max_duration=std::chrono::nanoseconds(0))
 Tick once. More...
rclcpp::Node::SharedPtr GetNode ()
 Retrieve the ROS node. More...

Constructor & Destructor Documentation

◆ ChROSInterface()

chrono::ros::ChROSInterface::ChROSInterface ( const std::string  node_name)

Constructor for the ChROSInterface class.

node_namethe name to set to the created node. ROS will throw an error if the node name is identical to previously created nodes.

Member Function Documentation

◆ GetNode()

rclcpp::Node::SharedPtr chrono::ros::ChROSInterface::GetNode ( )

Retrieve the ROS node.

Use this API to create a publisher or subscriber or any other ROS component.

◆ Initialize()

void chrono::ros::ChROSInterface::Initialize ( rclcpp::NodeOptions  options = rclcpp::NodeOptions())

Initialize the underlying ROS 2 node.

A SingleThreadedExecutor will be created and the node will be added to it.

◆ SpinSome()

void chrono::ros::ChROSInterface::SpinSome ( std::chrono::nanoseconds  max_duration = std::chrono::nanoseconds(0))

Tick once.

Will basically just call rclcpp::spin_some() NOTE: This is non-blocking. Available work will be executed, but it won't wait until it's completed if max_duration is 0 or the time since the last call to SpinSome is less than max_duration.

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