Skip to main content

AirGenQuad

Inherits from: Quadruped AirGen simulation quadruped implementation. This class provides an interface to control simulated quadruped robots in AirGen using the CVMoverClient from the pyairgen library.

Inherited methods

  • From Quadruped: setDefaultJointAngles, setDefaultJointVelocities
  • From Robot: addSensor

init

AirGenQuad.__init__(ip: str = '127.0.0.1', port: int = 41481, timeout_value: int = 3600, robot_name: str = '')
Initialize a simulated AirGen quadruped client.
Arguments
ip (str)
str
IP address of the AirGen server. (default: “127.0.0.1”)
port (int)
int
Port number for the AirGen server. (default: 41481)
timeout_value (int)
int
Timeout value for the connection in seconds. (default: 3600)
robot_name (str)
str
Name of the robot in the simulation. (default: "")

standUp

AirGenQuad.standUp() -> None
Command the robot to stand up. This is typically handled automatically when the robot starts moving. For explicit gait control, use the underlying CVMoverClient methods.
Returns
returns
None

lieDown

AirGenQuad.lieDown() -> None
Command the robot to lie down. CVMoverClient doesn’t have an explicit lieDown command. Users can stop the robot and it will settle into a stable pose.
Returns
returns
None

getState

AirGenQuad.getState() -> dict
Get the current state of the quadruped.
Returns
dict
dict
Current state including position, orientation, and velocity.

getPosition

AirGenQuad.getPosition() -> Optional[Position]
Get the position of the quadruped in the world frame.
Returns
Optional[Position]
Optional[Position]
Current position of the quadruped in world coordinates.

getOrientation

AirGenQuad.getOrientation() -> Optional[Orientation]
Get the orientation of the quadruped in the world frame.
Returns
Optional[Orientation]
Optional[Orientation]
Current orientation as a quaternion (x, y, z, w).

moveByVelocity

AirGenQuad.moveByVelocity(linear_velocity: Velocity, angular_velocity: Velocity, frame: str = 'body', orient_to_movement: bool = True) -> None
Move the quadruped with a velocity command in m/s.
Arguments
linear_velocity (Velocity)
Velocity
required
Linear velocity in m/s (x, y, z).
angular_velocity (Velocity)
Velocity
required
Angular velocity in rad/s (z_vel used as direction angle).
frame (str)
str
Reference frame for velocity (“body” or “world”). (default: “body”)
orient_to_movement (bool)
bool
Whether to orient the robot into the direction of movement. (default: True)
Returns
returns
None

getJointAngles

AirGenQuad.getJointAngles() -> list[float]
Get current joint angles in radians. CVMoverClient doesn’t provide direct joint angle access in the standard API. This would require accessing lower-level state information.
Returns
list[float]
list[float]
Current joint angles in radians.

setJointAngles

AirGenQuad.setJointAngles(angles: list, blocking: bool = True, moving_time: Optional[float] = None, accel_time: Optional[float] = None) -> None
Set joint angles in radians. CVMoverClient doesn’t provide direct joint angle control in the standard API. The robot is controlled via velocity and position commands at a higher level.
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

stop

AirGenQuad.stop() -> None
Soft e-stop for the robot. Stops the robot from moving gracefully by sending zero velocity commands. The API control is toggled off and on to reset the robot’s internal controller state and ensure all movement commands are cleared.
Returns
returns
None

cleanup

AirGenQuad.cleanup() -> None
Clean up resources and disable API control.
Returns
returns
None

getImage

AirGenQuad.getImage(camera_name: str = 'front_center', image_type: str = 'rgb') -> Image
Get an image from the specified camera.
Arguments
camera_name (str)
str
Name of the camera in the AirGen scene. (default: “front_center”)
image_type (str)
str
Image type, one of (“rgb”|“depth”). (default: “rgb”)
Returns
Image
Image
Captured image wrapped in the project’s Image type.