Skip to content

This project involves creating a ball-tracking robot that uses a camera to detect and follow a yellow ball. The system is powered by a Jetson Nano, which processes the video feed and sends control signals to an Arduino that manages the motor movements. An ultrasonic sensor is integrated to stop the robot when it gets too close to the ball.

Notifications You must be signed in to change notification settings

ihubrobotics-rd/Ball-Tracking-Robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ball Tracking Robot with Jetson Nano and Arduino

This project builds a robot that tracks a yellow ball using a camera. Let's delve into its components, functionality, and step-by-step creation process.

Hardware:

  • Computation and Processing:
    • Jetson Nano
    • MicroSD card (at least 16GB, recommended 32GB or higher for extended recording)
    • Power supply for Jetson Nano (refer to official specifications for voltage and amperage requirements)
  • Microcontroller:
    • Arduino Uno or compatible board (e.g., Nano, Mega)
    • USB cable for programming the Arduino
  • Motor Driver:
    • L298N motor driver module
  • Motors:
    • Two DC motors (voltage and RPM dependant on your robot's design and desired speed)
  • Camera:
    • USB camera or CSI camera module compatible with Jetson Nano
  • Sensors:
    • Ultrasonic sensor (e.g., HC-SR04)
  • Power Supply:
    • New: A portable power bank (with sufficient capacity) to provide power in the field for the Jetson Nano, Arduino, and motors (consider voltage and current requirements of each component)
  • Additional Components:
    • Jumper wires for connecting components
    • Breadboard (optional, for prototyping)
    • Chassis or frame to build the robot
    • Wheels appropriate for the robot's size and weight
    • Screws, nuts, and mounting hardware (depending on your chassis design)
    • New: Camera mount (depending on the camera chosen)
    • New: Zip ties or fasteners for securing wires

Software:

  • Jetson Nano Operating System (e.g., NVIDIA JetPack)
  • Arduino IDE (Integrated Development Environment) for programming the Arduino
  • OpenCV library (for computer vision on Jetson Nano)

Functionality:

  1. Video Capture and Processing:

    • The Jetson Nano captures video using the camera.
    • OpenCV library processes frames to detect the yellow ball.
    • Ball's position and size are identified.
  2. Motor Control:

    • Based on the ball's position, the Jetson sends commands to the Arduino.
    • Arduino adjusts motor speeds to ensure the robot follows the ball.
  3. Safety Stop:

    • The ultrasonic sensor continuously measures the distance to the ball.
    • If the distance falls below a safe threshold (e.g., 10 cm), the Arduino stops the motors to prevent a collision.
  4. Real-Time Visualization:

    • The processed video displays the detected ball, providing visual feedback.

Detailed Steps:

  1. Setup and Configuration:

    • Connect the camera to the Jetson Nano.
    • Connect motors, motor driver, and ultrasonic sensor to the Arduino.
    • Establish serial communication between Jetson Nano and Arduino.
  2. Jetson Nano Code:

    • Initialize the camera and video capture.
    • Use OpenCV to detect the yellow ball in each video frame.
    • Calculate the error based on the ball's position relative to the center of the frame.
    • Send motor control commands to the Arduino based on the error.
    • Display the video with the detected ball highlighted.
  3. Arduino Code:

    • Receive motor control commands from the Jetson Nano via serial communication.
    • Control motor speeds using PWM signals.
    • Continuously read the distance from the ultrasonic sensor.
    • Stop the motors if the distance to the ball is less than the predefined threshold.
  4. Testing and Calibration:

    • Calibrate the camera and ultrasonic sensor for accurate detection and distance measurement.
    • Test the robot's responsiveness to the ball's movement.
    • Adjust the PID controller parameters for smooth and accurate tracking.

Applications:

  • Education: Learn robotics, computer vision, and sensor integration.
  • Entertainment: Interactive toy that follows a ball.
  • Prototyping: Base platform for developing more advanced robots.

Challenges and Considerations:

  • Lighting Conditions: Ball detection may vary with lighting. Proper setup is crucial.
  • Power Management: A stable power supply ensures consistent performance.
  • Real-Time Processing: Efficient video processing is needed for real-time responsiveness.

This project offers hands-on experience with integrating various technologies, creating a practical and engaging application of these concepts.

About

This project involves creating a ball-tracking robot that uses a camera to detect and follow a yellow ball. The system is powered by a Jetson Nano, which processes the video feed and sends control signals to an Arduino that manages the motor movements. An ultrasonic sensor is integrated to stop the robot when it gets too close to the ball.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published