85
(2) Type: Execution, Blocking block
(3) Example: Anti-collision warning
The robot keeps approaching the wall. When the infrared depth sensor detects that the robot is ≤50 cm away from the wall, the
chassis LEDs blink red to warn, and the default LED effect is restored when the distance exceeds 50 cm.
4. Infrared distance sensor No. (1) distance value (≥) (10) centimeters
(1) Description: Return “True” when the distance measured by the specified infrared distance sensor (No.) meets the condition;
otherwise, returns “False”.
(2) Return value: Boolean
(3) Example: I retreat as you advance
In order to maintain an appropriate distance with the palm, the robot has mastered the “I retreat as you advance, I advance as you
retreat” strategy: if the distance measured by the infrared distance sensor is ≤ 20 cm, the robot translates backward; if the distance
is ≥ 20 cm, the robot translates forward.