Skip to main content
A Zenoh client for publishing and receiving wrench messages over Zenoh topics. Wrenches are commonly received from contact sensors, and published to end effectors that need to apply a force or torque.

Fields

numpy.ndarray
Current force as [x, y, z]
numpy.ndarray
Current torque as [x, y, z]
bool
Whether wrenches are relative to current position
bool
Whether wrench commands block until complete

Constructor

Signature
Initialize the wrench client.
dict
required
Configuration dictionary for the client
dict, optional
Dictionary of agent parameters. Defaults to None.
Optional shared Zenoh session. Defaults to None.

Methods

getLatestMessage()

Signature
Return the most recent message from the subscription queue. Blocks for up to one second waiting for a message. Returns: The raw payload bytes of the latest message, or None if no message was received within the timeout.

get_force()

Signature
Get the current force. Returns: numpy.ndarray: Current force as [x, y, z]

get_torque()

Signature
Get the current torque. Returns: numpy.ndarray: Current torque as [x, y, z]

get_wrench()

Signature
Get the latest wrench message. Returns: tuple: (force, torque) as numpy arrays or None

msg_cb()

Signature
Handle an incoming Zenoh sample by storing its payload in the queue.
required
The Zenoh sample received from the subscription.

process_latest_msg()

Signature
Process the latest received wrench message.

publish()

Signature
Publish data to the topic.
required
Raw bytes to publish on the configured topic.

publish_wrench()

Signature
Publish a wrench message.
array-like
required
Force as [x, y, z]
array-like
required
Torque as [x, y, z]

run()

Signature
Start the client by declaring a subscriber or publisher on the session.

stop()

Signature
Undeclare the subscriber and close the owned Zenoh session if any.