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.
Go2
Inherits from: Quadruped
Go2 quadruped robot.
Inherited methods
- From
Quadruped: setDefaultJointAngles, setDefaultJointVelocities
- From
Robot: cleanup
init
Go2.__init__(network_interface_name: str = 'eth0', low_level_control: bool = False)
Initialize the Go2 quadruped robot.
The default network interface is “eth0”, which assumes that the robot is being controller via the onboard computer.
network_interface_name (str)
name of the network interface, defaults to “eth0”
whether to use low level control. If False, high level control is used. Defaults to False
addSensor
Go2.addSensor(name: str, sensor: Sensor) -> None
Add an external sensor to the robot. By default, the built-in camera is added as go2_camera.
Unique identifier for the sensor
Sensor object to add (e.g. Camera, IMU, Lidar)
The sensor will be accessible via self.sensors[name]
getImage
Go2.getImage(camera_name: str = 'go2_camera', image_type: str = '') -> Image | None
Get an image from the specified camera. Note that by default only the rgb go2_camera is available.
If external cameras are added, they can be accessed by their name.
supported image types depend on camera, for default go2_camera only “rgb” is supported
standUp
Make the robot stand up from a lying position.
lieDown
Make the robot lie down from a standing position.
getState
Get the state (position and orientation) of the go2 as a dictionary.
Current state of the unitree go2 agent containing: - position (Position): unitree go2 agent’s current position (x,y,z) with respect to the world coordinate - orientation (Orientation): current orientation of the unitree go
getPosition
Go2.getPosition() -> Position | None
Get the current position of the unitree go2 agent with respect to the world coordinate.
unitree go2 agent’s current position (x,y,z) with respect to the world coordinate
getOrientation
Go2.getOrientation() -> Orientation | None
Get the current orientation of the unitree go2 agent in radians.
current orientation of the unitree go2 agent in radians
moveByVelocity
Go2.moveByVelocity(linear_velocity: Velocity, angular_velocity: Velocity, frame: str = 'body') -> None
Move the agent by velocity (velocity vector is respect to world coordinates).
If “always walking” mode is not set on the Go2, the robot will attempt to move to this
relative pose instead (i.e. it will move linear x forward, y left, and angular z to yaw).
Note: The velocity is only maintained for 1 second, after which the robot will stop moving unless another command is sent.
The user can always preemptively send a new command to interrupt the current movement.
linear_velocity (Velocity)
contains x velocity (x_vel), y velocity (y_vel), z_vel is discarded
angular_velocity (Velocity)
contains yaw to turn by (z_vel), x_vel and y_vel are discarded
frame of the velocity vector. Defaults to “body”. “world” is not supported.
setJointAngles
Go2.setJointAngles(joint_position: dict) -> None
Set the position of the robot’s joints when low-level control enabled.
Dictionary mapping joint names to target positions
setJointVelocities
Go2.setJointVelocities(joint_velocity: dict) -> None
Set the velocity of the robot’s joints when low-level control enabled.
Dictionary mapping joint names to target velocities
setJointTorques
Go2.setJointTorques(joint_torque: dict) -> None
Set the torque of the robot’s joints when low-level control enabled.
Dictionary mapping joint names to target torques
getMotorState
Get the current state of all motors when low-level control enabled.
//github.com/unitreerobotics/unitree_sdk2_python/blob/3af1610228977f449e22c8fba868bb8516d41ec3/unitree_sdk2py/idl/unitree_go/msg/dds_/MotorState.py
getIMU
Get the current IMU state when low-level control enabled.
getBatteryState
Get the current battery state when low-level control enabled.
Get the current foot force readings when low-level control enabled.
getLowLevelState
Get the complete low level state.
//github.com/unitreerobotics/unitree_sdk2_python/blob/3af1610228977f449e22c8fba868bb8516d41ec3/unitree_sdk2py/idl/unitree_go/msg/dds_/LowState.py#L34
getJointAngles
Go2.getJointAngles() -> list[float]
No docstring provided.
stop
Soft e-stop for the robot. Should stop the robot from moving gracefully.
i.e. a quadruped would stop moving.