Class RosGzBridge

Inheritance Relationships

Base Type

  • public rclcpp::Node

Class Documentation

class RosGzBridge : public rclcpp::Node

Component container for the ROS-GZ Bridge.

Public Functions

explicit RosGzBridge(const rclcpp::NodeOptions &options = rclcpp::NodeOptions())

Constructor.

Parameters:

options[in] options control creation of the ROS 2 node

void add_bridge(const BridgeConfig &config)

Add a new ROS-GZ bridge to the node.

Parameters:

config[in] Parameters to control creation of a new bridge

void add_service_bridge(const std::string &ros_type_name, const std::string &gz_req_type_name, const std::string &gz_rep_type_name, const std::string &service_name)

Create a new ROS-GZ bridge for a service.

Parameters:
  • ros_type_name[in] Name of the ROS service (eg ros_bz_interfaces/srv/ControlWorld)

  • gz_req_type_name[in] Gazebo service request type

  • gz_req_type_name[in] Gazebo service response type

  • service_name[in] Address of the service to be bridged

Protected Functions

void spin()

Periodic callback to check connectivity and liveliness.

Protected Attributes

std::shared_ptr<gz::transport::Node> gz_node_

Pointer to Gazebo node used to create publishers/subscribers.

std::vector<std::shared_ptr<ros_gz_bridge::BridgeHandle>> handles_

List of bridge handles.

std::vector<rclcpp::ServiceBase::SharedPtr> services_

List of bridged ROS services.

rclcpp::TimerBase::SharedPtr heartbeat_timer_

Timer to control periodic callback.