Skip to main content

JointAngleClient

Inherits from: ZenohClient 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. Attributes: joint_names (list): Names of the joints joint_positions (numpy.ndarray): Current joint positions (angles) joint_velocities (numpy.ndarray): Current joint velocities joint_efforts (numpy.ndarray): Current joint efforts/torques

Inherited methods

  • From ZenohClient: getLatestMessage, msg_cb, run, publish, stop

init

JointAngleClient.__init__(client_dict, agent_dict = None, shared_session = None)
Initialize the joint angle client.
Arguments
client_dict (dict)
dict
required
Configuration dictionary for the client
agent_dict (dict, optional)
dict, optional
Dictionary of agent parameters. Defaults to None.
shared_session
Optional shared Zenoh session. Defaults to None.

publish_joint_state

JointAngleClient.publish_joint_state(joint_names: List[str], joint_positions: List[float], joint_velocities: Optional[List[float]] = None, joint_efforts: Optional[List[float]] = None)
Publish a joint state message.
Arguments
joint_names (List[str])
List[str]
required
Names of the joints
joint_positions (List[float])
List[float]
required
Joint positions/angles
joint_velocities (Optional[List[float]])
Optional[List[float]]
Joint velocities. Defaults to None.
joint_efforts (Optional[List[float]])
Optional[List[float]]
Joint efforts/torques. Defaults to None.

get_joint_state

JointAngleClient.get_joint_state() -> Optional[tuple]
Get the latest joint state message.
Returns
tuple
Optional[tuple]
(joint_names, joint_positions, joint_velocities, joint_efforts) or None

process_latest_msg

JointAngleClient.process_latest_msg()
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.

get_joint_names

JointAngleClient.get_joint_names()
Get the current joint names.
Returns
list
Current joint names

get_joint_positions

JointAngleClient.get_joint_positions()
Get the current joint positions.
Returns
numpy.ndarray
Current joint positions/angles

get_joint_velocities

JointAngleClient.get_joint_velocities()
Get the current joint velocities.
Returns
numpy.ndarray
Current joint velocities

get_joint_efforts

JointAngleClient.get_joint_efforts()
Get the current joint efforts.
Returns
numpy.ndarray
Current joint efforts/torques

publish_agent_joint_state

JointAngleClient.publish_agent_joint_state()
Publish the current joint state of the connected agent.