Overview
This tutorial will guide you through connecting to the robot, running the main menu, executing a scan operation, and performing your first pick and place operation.Prerequisites: Make sure your VEX brain is connected to
/dev/ttyACM1 and your camera is connected.Complete Workflow
Initialize the Robot
Create a The robot automatically initializes:
Robot instance and configure the connection parameters:- Serial connection manager (115200 baud rate)
- Scan result callbacks
- Placement zones for different object types
Placement Zone Configuration
Placement Zone Configuration
The robot comes pre-configured with placement zones:You can modify these zones when initializing your robot.
Connect to the Robot
Start the robot and connect to the VEX brain:This will:
- Establish a serial connection to
/dev/ttyACM1 - Start the message reading thread
- Launch the interactive main menu
Check System Status
Before operating the robot, verify all systems are operational:Press Expected output:
c to run the check service:Execute a Scan Operation
Scan the environment to detect objects:Press The scan process:
n to start scanning:- Clears previous scan results
- Sends scan command with speed parameter (20)
- Waits for the robot to complete rotation
- Captures images at each detected position
- Runs object detection on each image
- Compiles results with placement zones
Pick and Place an Object
Now select and move an object to its designated zone:Press Interactive selection:After selecting object 1 (apple):Expected output:The apple is now placed in its designated zone at 90° and 200mm distance.
p to start pick and place:Complete Script
Here’s the full script to get started:main.py
Troubleshooting
Serial Connection Failed
Serial Connection Failed
Error:
Error connecting to serial portSolutions:- Verify VEX brain is powered on
- Check USB connection
- Confirm port is
/dev/ttyACM1(may vary) - Check permissions:
sudo chmod 666 /dev/ttyACM1 - Try different USB port
Scan Timeout
Scan Timeout
Error:
scanning timeoutSolutions:- Ensure the base motor is functioning
- Check that scan speed is not too high (default: 20)
- Verify encoder feedback from VEX brain
- Increase timeout in code:
wait(timeout=120)
No Objects Detected
No Objects Detected
Message:
scanning completed without object detectionSolutions:- Check camera connection and focus
- Ensure proper lighting conditions
- Verify objects are in detection range (150-250mm)
- Lower confidence threshold in ImageProcessor
- Check if objects are in supported classes (apple, orange, bottle)
Movement Failed
Movement Failed
Error:
error in movementSolutions:- Run safety service: press
sin menu - Check joint limits and physical obstructions
- Verify motor connections
- Ensure gripper is functioning
- Check power supply to VEX brain
Next Steps
Serial Communication
Learn how to customize serial messages and callbacks
Vision & Inference
Understand the object detection pipeline
Pick and Place
Deep dive into motion planning and execution
API Reference
Explore the complete API documentation