> ## Documentation Index
> Fetch the complete documentation index at: https://docs.generalrobotics.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Humanoid

## Humanoid

Inherits from: [`Robot`](/robot-api/reference/base/robot/robot/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`](/robot-api/reference/base/robot/robot/Robot): `addSensor`, `getImage`, `getState`, `getPosition`, `getOrientation`, `moveByVelocity`, `cleanup`

### **init**

```python theme={null}
Humanoid.__init__(server_port: int = 4774, enable_websocket: bool = True, client_timeout: float = 30.0) -> None
```

Initialize humanoid robot.

<ResponseField name="Arguments">
  <ParamField query="server_port (int)" type="int">
    Port for WebSocket server (default 4774)
  </ParamField>

  <ParamField query="enable_websocket (bool)" type="bool">
    Whether to start the WebSocket server (default True)
  </ParamField>

  <ParamField query="client_timeout (float)" type="float">
    Client timeout in seconds (default 30.0)
  </ParamField>
</ResponseField>

<ResponseField name="Returns">
  <ResponseField name="returns" type="None" />
</ResponseField>

### getJointAngles

```python theme={null}
Humanoid.getJointAngles() -> list[float]
```

Get current joint angles in radians.

<ResponseField name="Returns">
  <ResponseField name="list[float]" type="list[float]">
    Current joint angles in radians, ordered by joint index
  </ResponseField>
</ResponseField>

<ResponseField name="Raises">
  <ParamField query="NotImplementedError" type="">
    Must be implemented by subclasses
  </ParamField>
</ResponseField>

### setJointAngles

```python theme={null}
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.

<ResponseField name="Arguments">
  <ParamField query="angles (list)" type="list" required>
    List of target joint angles in radians
  </ParamField>

  <ParamField query="blocking (bool)" type="bool">
    Wait for movement to complete (default True)
  </ParamField>

  <ParamField query="moving_time (Optional[float])" type="Optional[float]">
    Time to complete the movement in seconds
  </ParamField>

  <ParamField query="accel_time (Optional[float])" type="Optional[float]">
    Time to accelerate/decelerate in seconds
  </ParamField>
</ResponseField>

<ResponseField name="Returns">
  <ResponseField name="returns" type="None" />
</ResponseField>

<ResponseField name="Raises">
  <ParamField query="NotImplementedError" type="">
    Must be implemented by subclasses
  </ParamField>
</ResponseField>

### stop

```python theme={null}
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.

<ResponseField name="Returns">
  <ResponseField name="returns" type="None" />
</ResponseField>

<ResponseField name="Raises">
  <ParamField query="NotImplementedError" type="">
    Must be implemented by subclasses
  </ParamField>
</ResponseField>

### setDefaultJointAngles

```python theme={null}
Humanoid.setDefaultJointAngles(joint_pos: list) -> None
```

Set the default joint position for the robot.

<ResponseField name="Arguments">
  <ParamField query="joint_pos (list)" type="list" required>
    value of the joint position
  </ParamField>
</ResponseField>

<ResponseField name="Returns">
  <ResponseField name="returns" type="None" />
</ResponseField>

### setDefaultJointVelocities

```python theme={null}
Humanoid.setDefaultJointVelocities(joint_vel: list) -> None
```

Set the default joint velocity for the robot.

<ResponseField name="Arguments">
  <ParamField query="joint_vel (list)" type="list" required>
    value of the joint velocity
  </ParamField>
</ResponseField>

<ResponseField name="Returns">
  <ResponseField name="returns" type="None" />
</ResponseField>
