|
Fabric 0.2.0
|
The BondClient class manages the lifecycle of a bond between the Fabric node and the capabilities server. Bonds are used to monitor the connection and ensure both sides are alive and responsive during plan execution.
| Method | Purpose |
|---|---|
BondClient(node, bond_id) | Constructor. Initializes the bond client with the node and bond ID. Retrieves the bond topic from parameters. |
start() | Starts the bond, sets heartbeat period and timeout, and logs the event. |
stop() | Stops and cleans up the bond, logging the event. |
~BondClient() | Destructor. Ensures the bond is stopped and cleaned up. |
on_formed(): Called when the bond is successfully established. Logs the event.on_broken(): Called when the bond is broken (e.g., server disconnects or crashes). Logs the event.BondClient for each new plan, starts the bond, and monitors its state.capability_client.bond_topic: The ROS parameter specifying the bond topic (default: /capabilities/bond).start() creates a bond::Bond, sets a 0.10 s heartbeat period, sets a 10.0 s timeout, and starts the heartbeat.stop() destroys the bond client instance if one exists.BondClient is constructed with the node and bond ID.start() is called to begin the bond heartbeat.on_formed() and on_broken() callbacks.stop() is called when the plan is done or the client is destroyed.The BondClient ensures robust monitoring of the connection between Fabric and the capabilities server, enabling reliable plan execution and graceful handling of disconnections or failures.