class ROS2EventsMixin(NotificationMixin):
Known subclasses: ros2.server.events.ROS2ModelChangeMixin
Constructor: ROS2EventsMixin(*args, **kwargs)
Gives a machinery item the BindingEvent, on its own Notification node.
Brings opensmi's ~opensmi.server.mixins.NotificationMixin, so a Component that raises
BindingEvents has a Notification of its own. The namespace is imported and the generator built
in a lifecycle step after the Notification exists and before the item's _init.
| Method | __init__ |
Start out with no event generator, and pass every argument to opensmi. |
| Async Method | emit |
Fire one BindingEvent from this machinery item. |
| Async Method | lifecycle |
Import this project's namespace and build the BindingEvent generator on the Notification. |
| Method | note |
Add one fired BindingEvent to this Machine's ring. Called by every item on it. |
| Property | ros2 |
Return the index this server imported NAMESPACE_URI at. |
| Property | ros2 |
Return the BindingEvents the Machine and its Components fired, oldest first, at most RECENT_EVENTS. |
| Property | ros2 |
Return the Machine this item reports to, which for a Machine is itself. |
| Method | _house |
Return the node opensmi fires its own machinery-item messages on. |
| Method | _keep |
Record one fired BindingEvent on this Machine's ring, after the trigger succeeded. |
| Instance Variable | _binding |
Undocumented |
| Instance Variable | _binding |
Undocumented |
| Instance Variable | _recent |
Undocumented |
| Instance Variable | _ros2 |
Undocumented |
ros2.server.events.ROS2ModelChangeMixinStart out with no event generator, and pass every argument to opensmi.
str, path: str, code: str, severity: Severity, text: str | None = None):
¶
Fire one BindingEvent from this machinery item.
| Parameters | |
binding:str | The name of the Binding this is about. |
path:str | The ROS2 topic, service, action or node path that Binding names. |
code:str | What happened, as a stable upper-snake-case identifier a client can branch on. |
severity:Severity | One of the house bands. |
text:str | None | A human-readable detail for the event's Message, such as a node's own refusal text. Defaults to a summary of the other three and never carries the code. |
| Raises | |
DeclarationError | When this machinery item's BindingEvents were never initialised, so there is no generator to fire from. |
AsyncGenerator[ None]:
¶
Import this project's namespace and build the BindingEvent generator on the Notification.
opensmi's generator keeps the Binding, ROS2Path and Code fields in the Notification's event history.
Return the index this server imported NAMESPACE_URI at.
| Raises | |
DeclarationError | Before the item's BindingEvents are initialised, which is where the import happens. |
Return the node opensmi fires its own machinery-item messages on.
| Raises | |
DeclarationError | When this machinery item has no Notification at all. |