Detect and Navigate Example
Learn how to make a robot detect objects and navigate towards them
This guide demonstrates how to create a robot that can detect specific objects using computer vision and navigate towards them. The example works with both simulated and real robots.
Overview
The detect and navigate example combines:
- Object detection using OWLv2 model
- Robot movement control
- Real-time camera feed processing
- Velocity-based navigation
Core Components
Detection Model
We use the OWLv2 model for object detection:
Navigation Functions
Box Center Calculation
This function calculates the center point of detected objects and checks if they’re too close:
Velocity Calculation
This function determines how the robot should move based on the target’s position:
Main Control Loop
The main loop continuously:
- Captures images from the robot’s camera
- Detects the target object
- Calculates required movement
- Controls the robot’s motion
Robot Setup
Simulated Robot (Isaac Quadruped)
For simulation environments, use the Isaac Quadruped configuration:
Real Robot (Go2)
For physical robot deployment, use the Go2 configuration:
Running the Example
-
First, ensure you have GRID installed and set up properly.
-
Choose your robot type:
- Define your target object:
- Run the main loop:
The robot will start searching for the specified object, and once detected, it will navigate towards it while maintaining a safe distance.
Remember to stop the robot if it gets too close to the target object or if you need to interrupt the operation.