Project 7 XGO Does Gymnastics

Ⅰ. Teaching Aims

  1. Understand the six-degree-of-freedom spatial posture of XGO (X, Y, Z translation + Pitch, Roll, Yaw rotation).

  2. Master the instructions of slide body and rotate body and their positive and negative directions.

  3. Learn to control “forward and backward displacement”, “left and right displacement” and “up and down push-ups” respectively through three independent examples.

  4. Use XGO reset pose to eliminate cumulative errors and ensure a return-to-zero position after the action.

Ⅱ. Pre-class Check

  • XGO + Foxbit + MicroBlocks IDE.

  • XGO battery power ≥ 60 %. The robot stands in the center of a flat table, with a space of no less than 20 cm around it.

  • MicroBlocks status bar shows a green dot, XGO-lite extension is loaded and the development board model is Foxbit.

  • Manually run XGO reset pose once to confirm the zero position.

Ⅲ. Key Blocks Analysis

Img

Functions

forward and backward displacement

Value range

−25 ~ +25

“+” Direction

Forward

Img

Functions

left and right displacement

Value range

−25 ~ +25

“+” Direction

Left

Img

Functions

up and down push-ups

Value range

−25 ~ +45

“+” Direction

Up

Img

Functions

Head down and head up (Pitch)

Value range

−20 ~ +20

“+” Direction

Head up

Formulas:

• slide X “+ forward − backward”

• slide Y “+ left − right”

• slide Z “+ up − down”

• rotate X “+ head up − head down”

Ⅳ. Practice (Independent Operation)

Each section includes initialization, action, waiting, and reset.

Test 1: Forward/Backward Displacement (slide body X)

Img

Online code: Click here

Test 2: Left/Right Displacement (rotate body x)

Img

Online code: Click here

Test 3: Dog Push-ups

Img

Debugging tips:

  • If the dog sinks too much in a push-up, it will slip. → Adjust 100 to 60.

  • The speed is too fast to see clearly → Change the two wait to 1000 ms.

Online code: Click here

Ⅴ. FAQ

Questions

Possible causes

Solutions

The movement is not obvious.

The parameter is too small / wait is too short

slide ≥ 6 mm,rotate ≥ 8°;wait ≥ 300 ms

The front feet are raised

The Pitch is large, but Z has not sunk

Sink synchronously by 5–10 mm to balance the center of gravity

The servo is screaming.

Maintain an extreme posture for a long time

Shorten the waiting time and reset pose immediately after the action