Palm control 2DOF servo PTZ

Note: The VM and ROS-wifi image transfer module must be consistent with the microROS control board ROS_DOMAIN_ID and set the value to 20. You can check [MicroROS control board Parameter configuration] to set the microROS control board ROS_DOMAIN_ID. Check the tutorial Connecting to MicroROS Agents to see if the ids are the same.

1、synopsis

MediaPipe is an open source and data stream processing machine learning application development framework developed by Google. It is a graph-based data processing pipeline for building data sources that use many forms, such as video, audio, sensor data, and any time series data. MediaPipe is cross-platform and can run on embedded platforms (Raspberry PI, etc.), mobile devices (iOS and Android), workstations and servers, and supports GPU acceleration on mobile. MediaPipe provides cross-platform, customizable ML solutions for live and streaming media.

2、Program specification

After the program starts, after the camera captures the image, the two-dimensional head of the car will follow the movement of the palm in the picture. The moving speed of the palm movement here should not be too fast, otherwise the image processing can not keep up, which will cause a lag.

2.1、Program code reference path

3、Program initiation

3.1、Start command

Terminal input,

If the Angle of the camera is not at this Angle, please press CTRL+C to end the program and run again, this is because the network delay causes the Angle of sending the steering gear to lose packets image-202405100001

If the camera picture image appears upside down, you need to see 3. Camera picture correction (must see) document itself correction, the experiment is no longer described.

After the function is turned on, the two-dimensional head of the car will follow the palm movement.

image-20240125184857513

4、Code parsing

4.1、control_shape.py

4.2、Flow chart

image-20240201150432326