Supported ROS2 Messages

Supported ROS2 Messages#

ROS Sugar components create automatic subscribers and callbacks to all inputs and publishers to all outputs.

Tip

Access all callbacks in a BaseComponent in self.callbacks: Dict[str, GenericCallback] and get the topic incoming message using get_ouput method in the GenericCallback class

Tip

Access all publishers in a BaseComponent in self.publishers_dict: Dict[str, Publisher] and publish a new message to the topic using publish method in the Publisher class

Many supported message types in ros_sugar come with pre-defined callback and publisher classes to convert ROS2 messages to Python types. Below is a list of supported messages and the types accepted by their publishers publish method and returned by their callback get_output method:

Message

ROS2 package

Callback return type

Publisher converts from

String

std_msgs

str

str

Bool

std_msgs

bool

bool

Float32

std_msgs

float

float

Float64

std_msgs

float

float

Point

geometry_msgs

numpy.ndarray

numpy.ndarray

PointStamped

geometry_msgs

numpy.ndarray

numpy.ndarray

Pose

geometry_msgs

numpy.ndarray

numpy.ndarray

PoseStamped

geometry_msgs

numpy.ndarray

numpy.ndarray

Twist

geometry_msgs

geometry_msgs.msg.Twist

geometry_msgs.msg.Twist

Image

sensor_msgs

numpy.ndarray

numpy.ndarray

Audio

sensor_msgs

bytes

str | bytes

Odometry

nav_msgs

numpy.ndarray

nav_msgs.msg.Odometry

LaserScan

sensor_msgs

sensor_msgs.msg.LaserScan

sensor_msgs.msg.LaserScan

Path

nav_msgs

nav_msgs.msg.Path

nav_msgs.msg.Path

OccupancyGrid

nav_msgs

nav_msgs.msg.OccupancyGrid | np.ndarray | Dict

numpy.ndarray

ComponentStatus

ros_sugar_interfaces

ros_sugar_interfaces.msg.ComponentStatus

ros_sugar_interfaces.msg.ComponentStatus