Control robot locomotion — move, rotate, and stop via g1_loco_client.(控制机器人运动——通过g1_loco_client实现移动、旋转和停止操作。)
Control the robot's movement and rotation using g1_loco_client.
When moving forward, first check security status via api call
curl -LsSf http://localhost:18790/api/controller/external
and ensure the response contains "safe": true before issuing
forward movement commands.
BEFORE executing any motion-related command:
1. Run: curl -s http://localhost:18790/api/home/status | jq '.data.available | any(. == "运动")'
2. If the output is false: STOP and tell the user "Motion mode is not enabled"
4. If found: Proceed with the motion command
DO NOT skip this check. DO NOT execute motion commands without verification.
g1_loco_client --network_interface=eth0 --set_velocity="vx vy omega duration"
Parameters:
Check safety status before moving forward:
curl -LsSf http://localhost:18790/api/controller/external
If the response contains "safe": true, then it's safe to move forward.
Move forward at 0.5 m/s for 2 seconds:
g1_loco_client --network_interface=eth0 --set_velocity="0.5 0 0 2"
Move backward at 0.3 m/s for 1.5 seconds:
g1_loco_client --network_interface=eth0 --set_velocity="-0.3 0 0 1.5"
Strafe left at 0.3 m/s for 1 second:
g1_loco_client --network_interface=eth0 --set_velocity="0 0.3 0 1"
Strafe right at 0.3 m/s for 1 second:
g1_loco_client --network_interface=eth0 --set_velocity="0 -0.3 0 1"
Rotate left (counter-clockwise) at 0.5 rad/s for 2 seconds:
g1_loco_client --network_interface=eth0 --set_velocity="0 0 0.5 2"
Rotate right (clockwise) at 0.5 rad/s for 2 seconds:
g1_loco_client --network_interface=eth0 --set_velocity="0 0 -0.5 2"
Move forward while turning left:
g1_loco_client --network_interface=eth0 --set_velocity="0.4 0 0.3 3"
Stop all movement:
g1_loco_client --network_interface=eth0 --stop_move
--stop_move if the robot needs to halt immediately.