How It Works
Did You Know
About Motion Control
The motion.maneuver(left_speed, right_speed, duration) command runs both wheel servos simultaneously for a specific time. Negative speeds reverse direction, allowing curved or in-place turns.
About HUSKYLENS Models
The HUSKYLENS can store up to six models on its microSD card. Each model can contain multiple learned faces, colors, or tags that can be recalled in later programs.
How It Works
This activity combines two modules—HUSKYLENS vision and cyber:bot navigation—to create an interactive behavior loop. Most setup and I2C initialization steps were introduced in earlier activities. Here, the focus is on loading and acting upon stored training data.
The switch_algorithm(“face”) command places the HUSKYLENS in face-recognition mode, and manage_model(“load”, 1) recalls the previously saved face model from the SD card. This allows the camera to recognize faces learned in an earlier session.
The code below checks for button presses so you can cycle through trained face IDs. This part adds flexibility, letting you test recognition of multiple people.
The most important new logic appears in the request_data() loop. This section fetches visual results from the HUSKYLENS, checks whether a specific ID is visible, and triggers movement accordingly. When a match is found, the cyber:bot displays a check mark, performs a left-then-right turning sequence, and restores the displayed ID. If no faces are detected, it stops and shows an idle icon.