FTH 4 · Operating a real humanoid|INEMA.CLUB-PRO

Lesson 3 · 15 min

Read the robot: joints, IMU, battery, and temperature

Before you send any command, you need to know whether the robot is alive, upright, and cool. In this lesson you listen to the G1's state for a few seconds, measure the rate instead of memorizing it, and summarize tilt, torque, and temperature, saying "sem dado" when the simulator doesn't send a field.

Start the lesson
A monitor in a dark lab with signal charts and blurred gauges, and a robot leg joint out of focus beside it.

In this lesson you will

  1. 1The real LowState_ fields of the G1 (and the ones it doesn't have)
  2. 2You measure the rate: 200 Hz in the simulator, measured here
  3. 3Torso tilt from the IMU quaternion
  4. 4Battery and temperature: where they live and what the simulator doesn't fill in

Goal: measure the G1's state rate and summarize tilt, torque, and temperature, without making up what the simulator doesn't send.

01What comes in a state message

Click each block. Exact names from the unitree_hg IDL (SDK 814556d).

Click each block in the diagram to see what it does.

Topic: rt/lowstate. In ROS 2 (lesson 6) the same topic shows up as /lowstate.

02Three things to watch when reading

Click each one.

1. Rate

In the simulator, the state goes out every 5 ms step (SIMULATE_DT in config.py): 200 Hz, and the monitor measures that.

The real robot's rate is not in the SDK code. Measure it with the monitor or with ros2 topic hz (lesson 6) instead of copying a number from a table.

03Listen for 5 seconds

The simulator runs for 10 s with the G1 suspended; the monitor listens for 5 s and exits with code 0 if the rate is in range.

Terminal · simulator + monitor
F=${FTH:-$HOME/fth}; cd $F/operar && . $F/.venv/bin/activate
python3 kit/sim.py --s 10 --suspenso &
python3 kit/monitor.py --s 5; echo "saída: $?"
wait
Excerpt · kit/monitor.py
    for i in range(op.N):
        tau[i] = max(tau[i], abs(s.motor_state[i].tau_est))
        temp = max(temp, max(s.motor_state[i].temperature))
Example from the repository
simulador: G1 29 motores · DDS domínio 1 em lo · 10 s · suspenso: sim
amostras em 5 s: ≈ 1000 · taxa ≈ 200 Hz
taxa dentro de 150–250 Hz: sim
inclinação máx. do tronco: 6°
maior torque estimado: 0 N·m (sem comando: motores soltos)
temperatura máx. dos motores: sem dado (o simulador manda 0)
saída: 0
simulador: fim em t = 10.0 s · robô suspenso (pés fora do chão)

Robot suspended and with no command: torso almost upright, zero torque (motors loose) and temperature with no data.

04Practice

Measure, don't memorize.

E1 · 5 s monitor

5 min

Run the block and write down the rate and the maximum tilt.

Done when: python3 kit/monitor.py --s 5; echo "saída: $?" → taxa dentro de 150–250 Hz: sim, temperatura máx. dos motores: sem dado (o simulador manda 0) and saída: 0.

E2 · Find the "no data" in the code

5 min

Open kit/monitor.py and find the line that swaps the zero for "sem dado". In one line, write what you would do on the real robot to get the number.

Done when: grep -c "sem dado (o simulador manda 0)" kit/monitor.py → 1, and your line cites the manufacturer's manual as the source of the threshold.

05Lesson quiz

The explanation appears after your answer.

Question 1 of 4

Where is the G1's battery in the SDK messages?skill

06In three sentences

Fieldsrt/lowstate carries the IMU and 35 motors; the battery is BmsState_.
Rate200 Hz in the simulator, measured; the real robot's rate is measured on the real robot.
Missing dataA field that is not filled in is "sem dado", never zero.

Going further

Previous lessonNext lesson