Skip to main content
A Zenoh client for handling joint state messages. This class inherits from ZenohClient and provides functionality for publishing and receiving joint state messages over Zenoh topics using sensor_msgs/JointState.

Fields

list
Names of the joints
numpy.ndarray
Current joint positions (angles)
numpy.ndarray
Current joint velocities
numpy.ndarray
Current joint efforts/torques

Constructor

Signature
Initialize the joint angle 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_joint_efforts()

Signature
Get the current joint efforts. Returns: numpy.ndarray: Current joint efforts/torques

get_joint_names()

Signature
Get the current joint names. Returns: list: Current joint names

get_joint_positions()

Signature
Get the current joint positions. Returns: numpy.ndarray: Current joint positions/angles

get_joint_state()

Signature
Get the latest joint state message. Returns: tuple: (joint_names, joint_positions, joint_velocities, joint_efforts) or None

get_joint_velocities()

Signature
Get the current joint velocities. Returns: numpy.ndarray: Current joint velocities

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 joint state message. Gets the latest message and updates the stored joint states. If an agent is connected, calls setJointAngles with the new positions. Returns: None

publish()

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

publish_agent_joint_state()

Signature
Publish the current joint state of the connected agent.

publish_joint_state()

Signature
Publish a joint state message.
list
required
Names of the joints
array-like
required
Joint positions/angles
array-like, optional
Joint velocities. Defaults to None.
array-like, optional
Joint efforts/torques. Defaults to None.

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.