db1d565b64
Integration Tests / melodic (push) Has been cancelled
Integration Tests / noetic (push) Has been cancelled
Integration Tests / humble (push) Has been cancelled
Integration Tests / jazzy (push) Has been cancelled
Ruff Lint & Format / ruff (push) Has been cancelled
Sync main to develop / Check if sync is needed (push) Has been cancelled
Sync main to develop / Sync main to develop (push) Has been cancelled
114 lines
5.9 KiB
YAML
114 lines
5.9 KiB
YAML
name: unitree_go2
|
|
alias: go2
|
|
type: real
|
|
prompts: |
|
|
The Unitree Go2 is a quadruped robot equipped with advanced sensors and mobility, designed for agile movement and versatile research or industrial applications.
|
|
The Unitree Go2 robot uses many custom messages. Therefore, you don't need to use functions to check the topics.
|
|
|
|
Unitree Go2 Robot High-Level Control Information (RECOMMENDED):
|
|
The `go2_ws` workspace exposes robot actions as ROS 2 services. These are PREFERRED over manual topic publishing because they handle the control loop and logic automatically.
|
|
|
|
Available Services:
|
|
1. Posture Control (Type: `go2_interfaces/srv/Trigger`):
|
|
- `/go2/stand_up`: Stand up to default height.
|
|
- `/go2/stand_down`: Lie down.
|
|
- `/go2/sit`: Sit down.
|
|
- `/go2/recovery`: Recover from fall or unknown state.
|
|
- `/go2/balance`: Enter balance stand mode.
|
|
|
|
2. Movement Control (Type: `go2_interfaces/srv/Move`):
|
|
- Service: `/go2/move`
|
|
- Fields: `{vx: float, vy: float, vyaw: float, distance: float}`
|
|
- `vx`: Forward/backward velocity (m/s).
|
|
- `vy`: Left/right strafe velocity (m/s).
|
|
- `vyaw`: Rotation velocity (rad/s).
|
|
- `distance`: Target distance (for linear move) or angle (for rotation).
|
|
- Note: The robot will automatically walk for the calculated duration and then stop.
|
|
|
|
3. Tricks/Special Actions (Type: `go2_interfaces/srv/Trigger`):
|
|
- `/go2/dance1`, `/go2/dance2`
|
|
- `/go2/hello`, `/go2/stretch`
|
|
- `/go2/front_flip`, `/go2/back_flip`
|
|
|
|
- Example Service Calls:
|
|
call_service(service='/go2/stand_up', type='go2_interfaces/srv/Trigger')
|
|
call_service(service='/go2/sit', type='go2_interfaces/srv/Trigger')
|
|
call_service(service='/go2/move', type='go2_interfaces/srv/Move', request={'vx': 0.5, 'vy': 0.0, 'vyaw': 0.0, 'distance': 2.0})
|
|
|
|
Unitree Go2 Robot Basic Control Information (Low-Level):
|
|
The Unitree Go2 robot is controlled via the /wirelesscontroller topic with the following parameters:
|
|
* ly: controls forward/backward movement, forward is positive, backward is negative (range: -1.0 to 1.0)
|
|
* lx: controls left/right movement, left is negative, right is positive (range: -1.0 to 1.0)
|
|
* rx: controls left/right rotation, left is negative, right is positive (range: -1.0 to 1.0)
|
|
* ry: controls forward/backward tilting, forward is positive, backward is negative (range: -1.0 to 1.0)
|
|
# keys: used for special actions (default is 0)
|
|
|
|
Important: All movement commands max speed is 1.0 (full speed) equlals 1.0 m/s.
|
|
|
|
If the Unitree Go2 moves using publish_for_durations, always set the last message to all zeros to stop the robot.
|
|
-Example:
|
|
publish_for_durations(
|
|
topic='/wirelesscontroller',
|
|
msg_type='unitree_msgs/msg/WirelessController',
|
|
messages=[{
|
|
'lx': 0.0,
|
|
'ly': 0.5, # Move forward at half speed
|
|
'rx': 0.0,
|
|
'ry': 0.0,
|
|
'keys': 0
|
|
},
|
|
{
|
|
'lx': 0.0,
|
|
'ly': 0.0,
|
|
'rx': 0.0,
|
|
'ry': 0.0,
|
|
'keys': 0
|
|
}],
|
|
durations=[2.0, 1.0] # Move for 2 seconds, then stop for 1 second
|
|
)
|
|
|
|
Unitree Go2 Robot Special Actions Information:
|
|
For special actions, use the keys field in the /wirelesscontroller topic:
|
|
CRITICAL RULE: ALL special actions MUST be sent as a pair using publish_for_durations with keys=1056 first, followed by the special action code.
|
|
Important: Always send keys=1056 first before attempting any special action.
|
|
* keys=1056: prerequisite command that MUST be sent once before any special action not just movement
|
|
* keys=257 : `jump_forward`
|
|
* keys=258 : `greet`
|
|
* keys=528 : `shake_hands`
|
|
* keys=1025 : `pounce`
|
|
* keys=513 : `sit_down`
|
|
* keys=514 : `dance`
|
|
|
|
- Example:
|
|
publish_for_durations(
|
|
topic='/wirelesscontroller',
|
|
msg_type='unitree_msgs/msg/WirelessController',
|
|
messages=[{
|
|
'ly': 0.0,
|
|
'lx': 0.0,
|
|
'rx': 0.0,
|
|
'ry': 0.0,
|
|
'keys': 1056 # Must send this first every time before any special action
|
|
},
|
|
{
|
|
'ly': 0.0,
|
|
'lx': 0.0,
|
|
'rx': 0.0,
|
|
'ry': 0.0,
|
|
'keys': 257 # Then send the special action command
|
|
}],
|
|
durations=[1.0, 1.0]
|
|
)
|
|
|
|
Safety Guidelines:
|
|
- Always validate robot state before sending commands
|
|
- Use reasonable duration values (typically 0.1-2.0 seconds)
|
|
- Monitor for obstacles using sensor data when available
|
|
- If connection is lost, assume robot needs to be stopped
|
|
|
|
Unitree Go2 Robot Sensor Information:
|
|
The Unitree Go2 robot provides various sensor data. Here are some key topics:
|
|
* /utlidar/cloud: Lidar point cloud data
|
|
* /camera/rgb/image_raw: RGB camera images
|
|
Using these sensors, the robot can measure the distance to objects and perceive its environment.
|