class PublisherBinding(NamedBinding):
A ROS2 topic published from a Skill on the declaring Component.
Publishing is an activity: a /cmd_vel stream runs while someone is driving, a map push happens once. The declaration becomes a Skill whose Parameters are the message fields, and Start is the only thing that publishes, so a client writes every field in any order and commits once. There is no debouncing or dirty tracking.
The direction is UA to ROS2 only. The echo of a published topic is always our own message, so a
readback would confirm the last value published, not the last delivered. To watch the topic, declare
a MonitoringBinding on it.
This kind is never required: it carries neither required nor startup_timeout, because the
publisher is this server itself. To wait for the other end, declare a required
MonitoringBinding on the topic that answers.
The continuity is declared, not inferred from rate, so omitting rate by accident cannot silently give a one-shot. A continuous Skill never reaches Completed and a finite one has no Halt to close a stream. A second push on a finite Skill is Reset, write, Start.
| Method | __post |
Refuse a contradictory declaration. |
| Class Variable | kind |
Undocumented |
| Instance Variable | continuous |
Whether the Skill streams the current snapshot of its Parameters on every tick until Halt, or publishes once and reaches Completed. No default. |
| Instance Variable | depth |
The ROS2 queue depth for subscribers that have not taken messages yet. |
| Instance Variable | exclude |
Field patterns removing fields, after include has narrowed. A selection that leaves the message unbuildable is refused at init instead of filled from a default. |
| Instance Variable | halt |
The message a stream publishes once when it ends, whatever ended it, or None to just stop publishing. A table of ROS2 field names (not browse names; the selection and rename do not apply), nested for a nested message: ... |
| Instance Variable | include |
Field patterns narrowing the message; empty means every field. |
| Instance Variable | message |
Builds the message from the Parameters, or None for the default. Python-only. |
| Instance Variable | message |
The ROS2 type, package/Name or package/kind/Name. Required, since the Parameters exist before anything is on the graph. A type whose package is not installed is fatal at init. |
| Instance Variable | name |
The Binding's name, also the Skill's name. Its variables are named for the field path alone. |
| Instance Variable | path |
The ROS2 topic. |
| Instance Variable | qos |
The QoS profile to offer, or None for the middleware's reliable, volatile default. Never discovered or adapted, because this declaration is how a publisher comes to exist. |
| Instance Variable | rate |
Publishes per second of a continuous Skill. Required there and fatal on a finite Binding. It is the initial value of a client-writable rate Parameter bounded by ~opensmi.ros2.server.publisher.MINIMUM_RATE... |
| Instance Variable | rename |
New browse names by field path, as on MonitoringBinding. |
| Instance Variable | skill |
A subclass of ~opensmi.ros2.server.publisher.ROS2ContinuousPublisherSkill or ~opensmi.ros2.server.publisher.ROS2FinitePublisherSkill matching continuous, or None for the stock one. Python-only; refused when the Binding is constructed if it is not a subclass. |
| Instance Variable | stale |
Seconds a running stream may go without a client write to any of its Parameters before it halts itself with SETPOINT_STALE, or None for never. Every write starts the interval again, a rewrite of the same value too, and so does ... |
| Instance Variable | tolerated |
Consecutive publish failures a continuous Skill absorbs before halting; zero halts on the first. Non-zero on a finite Skill is fatal at init. |
| Property | needs |
Return False: we are the publisher, so the shape comes from the declaration. |
| Property | selection |
Return this Binding's field selection. |
| Property | stock |
Return the stock Skill class this declaration's continuity builds. |
| Method | _refuse |
Raise a DeclarationError naming the Binding. |
| Method | _require |
Refuse a keyword that means nothing on the chosen continuity. |
Refuse a contradictory declaration.
Checks that need the message type (the reserved rate name, a Projection that cannot invert) are left to the Skill's constructor, which is still init.
| Raises | |
BindingNameError | When name is empty or not a valid browse name. |
DeclarationError | When a keyword belonging to one continuity is declared on the other, or a continuous declaration has no rate. |
ImplementationClassError | When skill_type is not a subclass of the stock class for this continuity. |
Whether the Skill streams the current snapshot of its Parameters on every tick until Halt, or publishes once and reaches Completed. No default.
Field patterns removing fields, after include has narrowed. A selection that leaves the message unbuildable is refused at init instead of filled from a default.
The message a stream publishes once when it ends, whatever ended it, or None to just stop publishing. A table of ROS2 field names (not browse names; the selection and rename do not apply), nested for a nested message: {"linear": {"x": 0.0}}. A field it does not name keeps the default the message type's generated class gives it. Checked against the message type at init. Continuous only.
The ROS2 type, package/Name or package/kind/Name. Required, since the Parameters exist before anything is on the graph. A type whose package is not installed is fatal at init.
The Binding's name, also the Skill's name. Its variables are named for the field path alone.
The QoS profile to offer, or None for the middleware's reliable, volatile default. Never discovered or adapted, because this declaration is how a publisher comes to exist.
Publishes per second of a continuous Skill. Required there and fatal on a finite
Binding. It is the initial value of a client-writable rate Parameter bounded by
~opensmi.ros2.server.publisher.MINIMUM_RATE and
~opensmi.ros2.server.publisher.MAXIMUM_RATE, and takes effect on the next tick.
A subclass of ~opensmi.ros2.server.publisher.ROS2ContinuousPublisherSkill
or ~opensmi.ros2.server.publisher.ROS2FinitePublisherSkill matching continuous, or
None for the stock one. Python-only; refused when the Binding is constructed if it is not a
subclass.
Seconds a running stream may go without a client write to any of its Parameters before it halts itself with SETPOINT_STALE, or None for never. Every write starts the interval again, a rewrite of the same value too, and so does Start. It guards against a client that died or lost its connection while its session and the Lock live on, which would leave a robot driving on the last /cmd_vel. Continuous only, and a positive, finite number.
Consecutive publish failures a continuous Skill absorbs before halting; zero halts on the first. Non-zero on a finite Skill is fatal at init.