This README is generated by Gemini Pro Student License.
This Android application serves as the "brain" and vision system for the HCMUT-Arctos Robot Arm. It utilizes the phone's camera to detect objects or faces and sends coordinate corrections to the robot via USB tethering.
This project is the companion software for the hardware repo: HCMUT-Arctos GitHub.
- Detection: Detects human faces in real-time.
- Movement: Controls 2 Axes (X and Y).
- Behavior: The robot rotates the base (Motor 0) and moves the elbow (Motor 2) to keep the detected face centered in the frame.
- Detection: Tracks yellow objects based on HSV color thresholding.
- Movement: Controls 3 Axes (X, Y, and Z/Depth).
- Behavior:
- X/Y: Keeps the object centered.
- Z (Depth): Automatically moves the robot Forward (Motor 1) or Backward based on the object's size (Area Percentage).
- Target Range: Maintains the object size between 6.0% and 10% of the screen area.
- Android Device with this app installed.
- USB Cable connecting the phone to the Raspberry Pi (or PC) controlling the robot.
- ADB (Android Debug Bridge) installed on the Pi/PC.
Because the robot and the phone are connected via USB (not WiFi), they need a way to talk to each other. The Android app acts as a TCP Server on port 6000. The Python script on the robot acts as a Client.
To create a "virtual bridge" so the robot can see the phone's server, you must run this command in your terminal:
adb forward tcp:6000 tcp:6000Here is the rest of the README.md content you need, starting from the "Why is this needed?" section. Markdown
Why is this needed?
- This command tells the computer: "Take any data sent to my local port 6000 and forward it instantly through the USB cable to the phone's port 6000."
- Without this, the Python script will try to connect to
127.0.0.1:6000and fail because it cannot "see" the phone inside the USB connection.