DD Robocon 2025/ IIT Patna/ Basketball
TeamPhoenix
Basketball, played by robots
Robocon 2025 was basketball, played by robots — two teams, two robots each. Our R1 attacks: it collects the ball, dribbles across and auto-aims from the 2- or 3-point zone with twin flywheels. R2 defends: it blocks shots, intercepts passes and recovers rebounds.
On the court
The team’s edited film first — then unedited footage from testing and the national arena.
The film · 1:58 · with soundchallenge → shooter → match day
Shot in simulation first
Before any aluminium was cut, the shooter’s CAD went into MuJoCo and took physics-simulated three-point shots. Twin flywheels on 350 W motors set ball speed and angle by RPM; a projectile model corrects for the robot’s own motion.
From thumbstick to flywheel
The manual control path. A gamepad on a laptop, ROS 2 in the middle, an ESP32 driving the omni base and the shooter.
# joy_serial_bridge → ESP32, newline-terminated 0.00,-0.82,0.00,0.15,1.00,1.00;0,0,1,0,0,0,0,0,0,0,0 # └──────── axes ─────────┘ └────── buttons ──────┘
A protocol you can read in a serial monitor. When something misbehaves at the arena, minicom shows exactly what the robot was told.
Left stick → four-wheel drive: forward, back, strafe and turn.
A button spins both flywheels; another axis moves the angle stage; servo buttons trim the shot.
Auto-aim
How R1 scores without a human lining up the shot.
- 01
Find the basket
On the robot, an IMX219 camera and an ML detector on a Jetson Nano find the basket. The repo’s detector prototype does the same with a RealSense D455, which adds range.
Detection/simple_hoop_detector.py · last.pt - 02
Set speed and angle
Ball speed and launch angle come from flywheel RPM, so aiming is a motor command, not a mechanism change.
arduino_codes/_shoot_with_auto - 03
Correct for motion
A projectile model compensates for the robot’s own velocity, so it can shoot while the omni base is still moving.
arduino_codes/Drive_with_auto
Go deeper
Four pages built straight from the committed firmware.
Run the firmware without the robot
The drive mixer, the PID alignment loop and the shooter trajectory — ported line for line, in your browser.
ArchitectureDataflow, protocol, state machines
The serial protocol, the drive ladder, every state machine and pin table.
CodeModule walkthrough
What each file does, and twelve findings from reading it closely.
FootageAnnotated clips
Match and test footage with frame-timed callouts, and the detector HUD reconstructed.
What is in the repo
ESP32 firmware
Drive and shooter sketches for both controllers, plus the autonomous variants.
joy_serial_ws/ROS 2 bridge
The joy_serial_bridge package: /joy in, the serial line out.
Detection/Hoop detection
RealSense pipeline and the trained detector weights.
ros_depthCamera/Depth in ROS 2
The RealSense D455 brought into the ROS 2 graph.
Run R1 yourself
# 1. flash arduino_codes/…ino to the ESP32 (115200 baud) # 2. build the bridge cd joy_serial_ws && colcon build --packages-select joy_serial_bridge source install/setup.bash # 3. gamepad in, serial out ros2 run joy joy_node --ros-args -p deadzone:=0.0 ros2 run joy_serial_bridge joy_to_serial --ros-args -p dev:=/dev/ttyUSB0 -p baud:=115200 # watch what the robot is told minicom -D /dev/ttyUSB0 -b 115200