Go2Real

Inherits from: Robot

Go2Real

Go2Real(network_interface_name, obstacle_avoidance, low_level_control: bool)
Arguments
network_interface_name (optional, str)
required

name of the network interface, defaults to “wlo1”

obstacle_avoidance (optional, bool)
required

whether to enable obstacle avoidance, defaults to False

low_level_control (optional, bool)
required

whether to use low level control. If False, high level control is used. Defaults to False

getImage

Go2Real.getImage(camera_name: str, image_type: str)

Return the image of camera. Go2 only has one camera so the args are not used.

Arguments
camera_name (optional, str)
required

unused, go2 only has one camera

image_type (optional, str)
required

unused, go2 only has rgb images

Returns

Image

requested image

getLidarData

Go2Real.getLidarData()

Get the current LiDAR point cloud data

Returns

Point cloud data containing 3D points

getHeightMap

Go2Real.getHeightMap()

Get the current height map data from LiDAR

Returns

HeightMap

Height map data with resolution and origin information

getPosition

Go2Real.getPosition(name: str)

Get the current position of the unitree go2 agent with respect to the world coordinate.

Arguments
name (optional, str)
required

unused

Returns

Position

unitree go2 agent’s current position (x,y,z) with respect to the world coordinate

getOrientation

Go2Real.getOrientation(name: str)

return the current orientation of the unitree go2 agent in radians

Arguments
name (optional, str)
required

unused

Returns

Orientation

current orientation of the unitree go2 agent in radians

setYaw

Go2Real.setYaw(yaw: float, speed)

Set the yaw (in radians) of the unitree agent to the specified radians. Yaw measures the rotation of the drone around the z-axis (downwards)

Arguments
yaw (float)
required

the target yaw (radians) for the drone

moveByVelocity

Go2Real.moveByVelocity(linear_velocity: Velocity, angular_velocity: Velocity, duration: Union[float, None], name: str)

Move the agent by velocity (velocity vector is respect to world coordinates) for the specified duration of seconds.

Arguments
linear_velocity (Velocity)
required

Velocity

contains x velocity (x_vel), y velocity (y_vel), z_vel is discarded

angular_velocity (Velocity)
required

Velocity

contains yaw to turn by (z_vel), x_vel and y_vel are discarded

duration (optional, Union[float, None])
required

number of seconds that the Go2 should move before stopping

name (optional, str)
required

unused

Returns

getVelocity

Go2Real.getVelocity()

Get the velocity of the unitree go2 agent

Returns

Velocity

velocity of the unitree go2 agent

setJointPositions

Go2Real.setJointPositions(joint_position: dict)

Set the position of the robot’s joints.

Arguments
joint_position (dict)
required

Dictionary mapping joint names to target positions

Returns

setJointVelocities

Go2Real.setJointVelocities(joint_velocity: dict)

Set the velocity of the robot’s joints.

Arguments
joint_velocity (dict)
required

Dictionary mapping joint names to target velocities

Returns

setJointTorques

Go2Real.setJointTorques(joint_torque: dict)

Set the torque of the robot’s joints.

Arguments
joint_torque (dict)
required

Dictionary mapping joint names to target torques

Returns

getMotorState

Go2Real.getMotorState()

Get the current state of all motors.

getIMU

Go2Real.getIMU()

Get the current IMU state.

getBatteryState

Go2Real.getBatteryState()

Get the current battery state.

getFootForce

Go2Real.getFootForce()

Get the current foot force readings.

getLowLevelState

Go2Real.getLowLevelState()

Get the complete low level state.

Was this page helpful?