Skip to main content

Humanoid

Inherits from: Robot Abstract base class defining the interface for humanoid robots. This class extends the base Robot class with additional methods specific to humanoid locomotion and control.

Inherited methods

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

init

Humanoid.__init__(server_port: int = 4774, enable_websocket: bool = True, client_timeout: float = 30.0) -> None
Initialize humanoid robot.
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

Humanoid.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

Humanoid.setJointAngles(angles: list, blocking: bool = True, moving_time: Optional[float] = None, accel_time: Optional[float] = None) -> None
Set joint angles in radians. Commands the humanoid 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

stop

Humanoid.stop() -> None
Soft e-stop for the robot. Should stop the robot from moving gracefully while maintaining balance. The humanoid should remain standing in a stable pose.
Returns
returns
None
Raises
NotImplementedError
Must be implemented by subclasses

setDefaultJointAngles

Humanoid.setDefaultJointAngles(joint_pos: list) -> None
Set the default joint position for the robot.
Arguments
joint_pos (list)
list
required
value of the joint position
Returns
returns
None

setDefaultJointVelocities

Humanoid.setDefaultJointVelocities(joint_vel: list) -> None
Set the default joint velocity for the robot.
Arguments
joint_vel (list)
list
required
value of the joint velocity
Returns
returns
None