With the rapid advancement of artificial intelligence, it is inevitable that AI technologies will profoundly transform human production and lifestyles in the near future. Machine vision, as a cutting-edge field within AI, endows machines with visual capabilities comparable to the human eye. This empowers robots, such as the quadruped robot dog, to operate with greater intelligence and human-like interaction, significantly enhancing their performance, expanding their application scope, and attracting considerable attention from enthusiasts and researchers alike. In this project, we designed a bionic robot dog based on the OpenMV vision module, capable of performing various visual functions including color recognition, face recognition, obstacle avoidance, and target tracking.

The mechanical structure of the bionic quadruped robot dog primarily consists of a body and four legs. The body employs a split-frame structure, designed to reduce weight while maintaining strength and rigidity. To achieve this, the frame is constructed from aluminum alloy 7075, a material known for its low density, cost-effectiveness, and ease of machining. The frames are connected using bolts and nuts, allowing adjustments to the body’s length and width by varying bolt lengths, thus enabling scalability of the robot dog within a certain range. Each leg of the quadruped robot mimics biological analogs, comprising a thigh, shank, and foot, with joints corresponding to the hip, knee, and ankle. However, to simplify the mechanism and reduce leg inertia, the ankle joint’s motion is omitted. Instead, the hip function is decomposed into a hip joint and a yaw joint. Thus, the leg joints include the yaw joint, hip joint, and knee joint. Servo motors act as these joints, minimizing mechanical noise and extending operational time. The yaw joint enables lateral swinging motions for turning, while the hip and knee joints coordinate for forward and backward stepping movements. The legs are fabricated from ABS resin, chosen for its high strength, toughness, and ease of processing. Utilizing lightweight design principles and 3D printing technology, we developed the thighs and shanks, reducing design cycles, costs, and material waste.
| Component | Material | Density (g/cm³) | Strength (MPa) | Key Characteristics |
|---|---|---|---|---|
| Body Frame | Aluminum Alloy 7075 | 2.81 | 570 | Lightweight, machinable, high stiffness |
| Legs | ABS Resin | 1.05 | 40 | High toughness, 3D printable, impact-resistant |
The hardware control system of the bionic robot dog is centered around a main control board, specifically the STM32F103VET6 microcontroller, which serves as the brain processing all external information. The OpenMV4 vision module, equipped with an OV7725 camera and programmable in Python, acts as the eyes of the robot dog, enabling visual tasks like color and face recognition. An MPU6050 attitude sensor is integrated to monitor and correct the walking posture using a high-dynamic Kalman filter algorithm, which computes real-time stable three-axis attitude angles. The joint angles, such as yaw, pitch, and roll, are derived from sensor data. For instance, the yaw angle correction can be modeled as: $$ \theta_{\text{yaw}} = \tan^{-1}\left(\frac{2(q_w q_z + q_x q_y)}{1 – 2(q_y^2 + q_z^2)}\right) $$ where $q_w, q_x, q_y, q_z$ are quaternion components from the sensor fusion. Leg movements are driven by LX-224HV high-torque bus servos, with three servos per leg controlling the yaw, hip, and knee joints. A servo control board coordinates the 12 leg servos to ensure smooth motion. Power is supplied by an 11.1V 2500mAh lithium battery, regulated down to 5V using a DC adjustable voltage regulator module for compatibility with other components. Additionally, two SG90 servos form a pan-tilt mechanism for the head, allowing the OpenMV module to capture images from various angles by adjusting PWM duty cycles to control servo rotation.
| Component | Model/Specification | Function | Key Parameters |
|---|---|---|---|
| Main Control Board | STM32F103VET6 | Central processing unit | 32-bit ARM Cortex-M3, 512KB Flash |
| Vision Module | OpenMV4 with OV7725 | Image acquisition and processing | STM32H7 core, Python programmable |
| Attitude Sensor | MPU6050 | Posture monitoring | 3-axis gyro, 3-axis accelerometer |
| Leg Servos | LX-224HV | Joint actuation | Torque: 20 kg·cm, bus-controlled |
| Power Supply | 11.1V 2500mAh Li-ion | Energy source | Regulated to 5V via DC module |
| Head Servos | SG90 | Head movement | PWM-controlled, 180° rotation |
The software programming for this quadruped robot dog employs a modular approach using Python and C languages, enhancing flexibility for diverse tasks. The main program flow begins with initialization of all functional modules to prevent unforeseen errors. After initialization, the system awaits control commands, which are parsed alongside data acquisition from sensors. Based on the commands and sensor inputs, the robot dog executes corresponding actions via interrupt service routines, sending instructions to the servo control board and head servos through UART communication. If no subsequent command is received, the robot dog maintains its current state until updated. This structure ensures responsive and adaptive behavior for the bionic robot dog.
For color recognition, aimed at applications like guiding visually impaired individuals, the robot dog identifies traffic signals using the LAB color model. Thresholds for red and green colors are defined using the thresholds function, which sets ranges for the L, A, and B components. The recognition process involves capturing images via the OV7725 camera, finding the largest color blob, and comparing its thresholds to predefined values. If green is detected, the robot dog proceeds straight; if red, it halts until green appears. The LAB color difference can be expressed as: $$ \Delta E = \sqrt{(L_2 – L_1)^2 + (A_2 – A_1)^2 + (B_2 – B_1)^2} $$ where $\Delta E$ represents the color difference, and the thresholds ensure accurate identification by minimizing errors in varying lighting conditions.
| Color | L Min | L Max | A Min | A Max | B Min | B Max |
|---|---|---|---|---|---|---|
| Red | 20 | 60 | 40 | 80 | 30 | 70 |
| Green | 50 | 90 | -70 | -30 | 10 | 50 |
Face recognition is implemented using the Local Binary Pattern (LBP) algorithm to enable home security features. The OpenMV module captures multiple images of familiar faces from different angles, storing them in separate folders. During recognition, it extracts LBP features from the detected face and compares them against the database. The LBP value for a pixel is computed as: $$ \text{LBP} = \sum_{p=0}^{7} s(g_p – g_c) \cdot 2^p $$ where $g_c$ is the central pixel intensity, $g_p$ are the neighboring pixels, and $s(x)$ is 1 if $x \geq 0$ and 0 otherwise. If a match is found, the result is transmitted to the STM32, identifying the person as familiar; otherwise, they are tagged as a stranger. This method allows the robot dog to perform reliable face recognition even in dynamic environments.
Target tracking is achieved by recognizing AprilTag labels, which provide precise localization and are less affected by lighting variations compared to color-based methods. The OpenMV module uses the AprilTag algorithm to lock onto the tag’s position in the image. The offset angle for navigation is calculated based on the tag’s coordinates in the frame, enabling the robot dog to follow the target accurately. The pose estimation can be described by: $$ \begin{bmatrix} x \\ y \\ z \end{bmatrix} = K^{-1} \cdot \begin{bmatrix} u \\ v \\ 1 \end{bmatrix} \cdot d $$ where $(u, v)$ are image coordinates, $K$ is the camera intrinsic matrix, and $d$ is the estimated depth. This facilitates robust tracking for the quadruped robot in various scenarios.
Obstacle avoidance is critical for safe operation, whether during normal walking or target tracking. Using a monocular vision-based distance measurement algorithm, the robot dog computes the distance to obstacles. If the distance falls below 20 cm, it triggers an emergency stop to prevent collisions. The distance calculation can be approximated as: $$ d = \frac{f \cdot W_{\text{real}}}{w_{\text{image}}} $$ where $d$ is the distance, $f$ is the focal length, $W_{\text{real}}$ is the actual width of the obstacle, and $w_{\text{image}}$ is its width in the image. This simple yet effective approach enhances the autonomy of the robot dog.
| Module | Algorithm/Method | Key Parameters | Output Action |
|---|---|---|---|
| Color Recognition | LAB Color Thresholding | L, A, B ranges | Move or stop based on color |
| Face Recognition | LBP Feature Extraction | LBP histogram comparison | Identify familiar/stranger |
| Target Tracking | AprilTag Detection | Tag ID and pose | Navigate towards target |
| Obstacle Avoidance | Monocular Distance Estimation | Pixel width, focal length | Stop if distance < 20 cm |
System debugging involved both hardware and software aspects. Hardware debugging included inspecting modules for damage and testing each one individually before integration. Software debugging was conducted in the Keil environment, covering the main program and specific modules like color recognition and face recognition. After thorough testing, the robot dog successfully performed all visual functions, demonstrating the effectiveness of the design. The integration of OpenMV with STM32, combined with modular programming, allowed for seamless operation and real-time adjustments.
In conclusion, this project presents a comprehensive design for a bionic quadruped robot dog with an OpenMV-based vision module. The mechanical structure emphasizes lightweight and durable materials, while the hardware system integrates sensors and actuators for intelligent control. Software algorithms, including LAB thresholding, LBP, AprilTag, and monocular distance calculation, enable advanced visual capabilities. The robot dog can recognize colors for guidance, identify faces for security, track targets accurately, and avoid obstacles efficiently. Future work may focus on enhancing autonomy through machine learning and expanding applications in fields like search and rescue. This design underscores the potential of quadruped robots in leveraging AI for practical, real-world tasks, paving the way for more adaptive and intelligent robotic systems.
