Skip to content

Message support for ROS2 #10432

Open
Open
@hierophect

Description

@hierophect

rclcpy is a new and very barebones implementation of the Robot Operating System (ROS) client library for Circuitpython. One of the more pressing features it is missing is message support - parts of a ROS network talk to each other using messages that have a specific type, from basic types such as strings and different sizes of int, to complex robot types like quaternions and pointclouds. rclcpy only supports one hardcoded type at present, the Int32, and will need more to become practically useful.

Various things are tricky about this addition.

  • Message types should at minimum be accessible through a submodule, say, rclcpy.msgs, but could also be rclcpy.std_msgs or rclcpy.trajectory_msgs etc to be more organized with extended messages.
  • ROS2 systems usually build the message types automatically out of .msg files. Those aren't included in the library circuitpython uses, but we do have about ~100 or so message definitions as .h files. I'm not sure how many of these are practical to include, given Circuitpython's memory limits.
  • Since there's no string-based lookup for message types with Micro-ROS, a type registry will be needed to translate python types to C equivalents.
  • Message objects similar to rclpy should also be added in a frozen module.
  • All of this could potentially be autogenerated at some point, with a tools script, possibly starting from .msg files.

I think the best way to start is a hardcoded registry of simple messages, with more complicated types or autogeneration being added later based on need.

Metadata

Metadata

Assignees

No one assigned

    Labels

    rclcpyMicro-ROS client module

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions