Go2Real
Inherits from: Robot
Go2Real
Go2Real(network_interface_name, obstacle_avoidance, low_level_control: bool)
network_interface_name (optional, str)
name of the network interface, defaults to “wlo1”
obstacle_avoidance (optional, bool)
whether to enable obstacle avoidance, defaults to False
low_level_control (optional, bool)
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.
camera_name (optional, str)
unused, go2 only has one camera
image_type (optional, str)
unused, go2 only has rgb images
getLidarData
Get the current LiDAR point cloud data
Point cloud data containing 3D points
getHeightMap
Get the current height map data from LiDAR
HeightMapHeight 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.
Positionunitree 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
Orientationcurrent 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)
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.
linear_velocity (Velocity)
Velocitycontains x velocity (x_vel), y velocity (y_vel), z_vel is discarded angular_velocity (Velocity)
Velocitycontains yaw to turn by (z_vel), x_vel and y_vel are discarded duration (optional, Union[float, None])
number of seconds that the Go2 should move before stopping
getVelocity
Get the velocity of the unitree go2 agent
Velocityvelocity of the unitree go2 agent
setJointPositions
Go2Real.setJointPositions(joint_position: dict)
Set the position of the robot’s joints.
Dictionary mapping joint names to target positions
setJointVelocities
Go2Real.setJointVelocities(joint_velocity: dict)
Set the velocity of the robot’s joints.
Dictionary mapping joint names to target velocities
setJointTorques
Go2Real.setJointTorques(joint_torque: dict)
Set the torque of the robot’s joints.
Dictionary mapping joint names to target torques
getMotorState
Get the current state of all motors.
getIMU
Get the current IMU state.
getBatteryState
Go2Real.getBatteryState()
Get the current battery state.
Get the current foot force readings.
getLowLevelState
Go2Real.getLowLevelState()
Get the complete low level state.