Skip to main content

Arm

Inherits from: Robot Abstract base class defining the interface for robotic arms. This class extends the base Robot class with additional methods specific to robotic arm manipulation and control including joint control and gripper operations.

Inherited methods

  • From Robot: addSensor, getImage, getState, getPosition, getOrientation, moveByVelocity, stop, cleanup

init

Arm.__init__(server_port: int = 4774, enable_websocket: bool = True, client_timeout: float = 30.0) -> None
Initialize robotic arm.
Arguments
server_port (int)
int
Port for WebSocket server (default 4774)
enable_websocket (bool)
bool
Whether to start the WebSocket server (default True)
client_timeout (float)
float
Client timeout in seconds (default 30.0)
Returns
returns
None

getJointAngles

Arm.getJointAngles() -> list[float]
Get current joint angles in radians.
Returns
list[float]
list[float]
Current joint angles in radians, ordered by joint index
Raises
NotImplementedError
Must be implemented by subclasses

setJointAngles

Arm.setJointAngles(angles: list, blocking: bool = True, moving_time: Optional[float] = None, accel_time: Optional[float] = None) -> None
Set joint angles in radians. Commands the arm to move joints to the specified target angles. Can be blocking or non-blocking depending on the blocking parameter.
Arguments
angles (list)
list
required
List of target joint angles in radians
blocking (bool)
bool
Wait for movement to complete (default True)
moving_time (Optional[float])
Optional[float]
Time to complete the movement in seconds
accel_time (Optional[float])
Optional[float]
Time to accelerate/decelerate in seconds
Returns
returns
None
Raises
NotImplementedError
Must be implemented by subclasses

grasp

Arm.grasp() -> None
Close the gripper to grasp an object. Closes the gripper to securely hold an object. The gripper will apply appropriate force based on the object detected.
Returns
returns
None
Raises
NotImplementedError
Must be implemented by subclasses

release

Arm.release() -> None
Open the gripper to release an object. Opens the gripper to release any held object. The gripper will return to its fully open position.
Returns
returns
None
Raises
NotImplementedError
Must be implemented by subclasses

setNamedPose

Arm.setNamedPose(pose_name: str, joint_angles: list[float]) -> None
Define a pose_name:joint_angles pair in the dictionary of named poses (overriding any existing pair).
Arguments
pose_name (str)
str
required
Name of the pose to define
joint_angles (list[float])
list[float]
required
List of joint angles in radians
Returns
returns
None
Raises
ValueError
If the length of joint_angles list does match the length of other named poses

removeNamedPose

Arm.removeNamedPose(pose_name: str) -> Optional[list[float]]
Remove a named pose from the dictionary of pose_name:joint_angles pairs.
Arguments
pose_name (str)
str
required
Name of the pose to remove (case-insensitive)
Returns
list
Optional[list[float]]
Joint angles (radians) of the named pose that was removed, or None if the named pose did not exist

getNamedPose

Arm.getNamedPose(pose_name: str) -> Optional[list[float]]
Get the list of joint angles corresponding to a named pose.
Arguments
pose_name (str)
str
required
Name of the pose to get (case-insensitive)
Returns
list
Optional[list[float]]
Joint angles (radians) of the named pose, or None if the named pose does not exist