module documentation

The Component side of the declarative API: a list of Bindings, and nothing overridden.

Mixed in ahead of opensmi's BaseComponent, this turns the bindings class attribute into an address space:

class Platform(ROS2ComponentMixin, BaseComponent):
    bindings = (
        MonitoringBinding(
            name="CurrentPose",
            path="/current_pose",
            message_type="geometry_msgs/msg/PoseStamped",
            exclude=("header/stamp",),
        ),
    )

    async def _write_identification(self) -> None: ...

A constructor may compute bindings (self.bindings = [...]), and bindings_toml adds declarations from a file; the two sources union and a name collision is fatal (opensmi.ros2.server.bindings.resolve_bindings). A projections attribute lists the recipes this Component renders its types with, ahead of its Machine's.

Each kind of Binding becomes a different part of the Component: Monitoring variables for a MonitoringBinding and a KeyedBinding (opensmi.ros2.server.keyed), a Method for a MethodBinding (opensmi.ros2.server.method), a finite Skill for an ActionBinding (opensmi.ros2.server.skill), ParameterSet entries for a ROS2ParameterBinding (opensmi.ros2.server.parameters) and a SpatialObject for a TFBinding (opensmi.ros2.server.transforms). The Component also gets a Notification for the events its Bindings raise. A LifecycleBinding becomes the StartupSkill. Any declaration may be marked required: the Component then gets a StartupSkill that waits for it and halts if it is not satisfied by its deadline (opensmi.ros2.server.required). A variable that is not a message field is added the opensmi way, by overriding _init.

Class ROS2ComponentMixin What a Component declares, and what becomes of it.