VISCORE
← All works

Robotics & EmbeddedAwarded in the 2025 season; iterated Sep 2026Completed

ROS Rover Target Shooting

Target Shooting event: a ROS mecanum rover drives its waypoints on its own and shoots a static ring target, a rotating numbered target and a moving numbered target in turn.

Vision, navigation and firing code developed independentlyTwo-person team entry

Merit Award, National Finals · Second Prize, Sichuan Division (2025)

  • ROS1
  • Ubuntu
  • C++
  • Python
  • ar_track_alvar
  • OpenCV
  • IMU
  • Lidar
  • Serial
Lidar scan and camera view with target IDs in RViz

Background

This is the Target Shooting event of the China Robot and Artificial Intelligence Competition. The rover leaves the start and reaches three firing points on its own: P1 is a static ring target, P2 a numbered target moving round a circle (about 52 seconds per lap), and P3 a numbered target sliding along a rail. The numbers for the rotating and moving targets have to be read from images along the way. Each point has a time limit (P1 15 s, P2 70 s, P3 55 s); on timeout the rover gives up that point and moves on.

What the system does

IMU ready→initial strafe and turn→read rotating-target / moving-target numbers→10-step waypoint navigation→P1 ring target→P2 rotating target→P3 moving target→fire over serial
  • A hand-written waypoint executor drives the 10 steps from a configuration file
  • AR markers identify targets 1–8; a lost marker is filled in from its neighbours
  • Ring detection: colour threshold, edges and ellipse fitting
  • Rotating target: fit the circular path, estimate angular velocity, compute the lead, then fire
  • Moving target: estimate projectile flight time from distance, compute the lead, then fire
  • Every point has a timeout; when the image result is invalid the rover stops and retries

My work

  • Navigation: did not use move_base. I wrote my own waypoint executor node that subscribes to the lidar and the calibrated IMU and publishes velocity commands; the 10 waypoint steps live in YAML, so a new field only needs a configuration change.
  • Turning control: closed-loop turning on the IMU with stepped gains and a speed limit; a turn counts as complete within 1.5° of error. Added a turn timeout and an anti-stall boost so the rover cannot get stuck in place.
  • Target identification: ar_track_alvar reads 9 cm AR markers, keeping only numbers 1–8; when a marker is blocked or missed, its position is filled in from neighbouring markers.
  • Ring detection: HSV thresholding, Canny edges, contour extraction and ellipse fitting find the ring centre, which is then projected using the camera intrinsics and distortion parameters.
  • Rotating-target prediction: collect marker positions over a period, get initial centre and radius with the Kasa algebraic fit, then refine with Gauss-Newton iterations; unwrap the phase of the angle series and estimate angular velocity by linear regression, then combine it with projectile speed to get the lead.
  • Moving-target prediction: estimate flight time from target distance (distance / projectile speed + a fixed delay) and add the lead to the aiming position.
  • Firing: a Python node sends a fire frame to the microcontroller over serial, followed by a reset frame.
  • Start-up and debugging: the start script first checks that source and build output match and that the key safety steps are present, and refuses to start otherwise; the main node has a keyboard debug mode for testing turning, identification and firing separately.

Problems and fixes

Chasing the rotating target is always one step late. Aiming at the current position means the target has moved by the time the rover has turned. The fix is to fit the path, estimate angular velocity, predict when the target will pass the firing position, and aim there in advance.

Unstable identification can wreck a whole run. If the rover carries on after a blocked marker or an invalid result, every later point is off. There are three layers of fallback: a lost marker is filled in from its neighbours; an invalid image result means stop and retry; and every point has a timeout, with navigation timeouts counted and summarised at the end so problems can be located after the run.

Results

  • Target Shooting event, 2025 China Robot and Artificial Intelligence Competition: Merit Award, National Finals, and Second Prize, Sichuan Division (two-person team).
  • This page describes the code as iterated in September 2026.

Retrospective

  • The rover has no hit sensor, so the program can only confirm that the fire command was sent, and the code keeps no record of hit rate or run time on the real vehicle. The next step is to log the firing time, target number and result of every run.

Project images

AR markers on the rotating target, each with its ID
Three targets, IDs 6, 7 and 8
Technical notes
  • Waypoints: 10 steps, 3 firing points; time limits P1 15 s, P2 70 s, P3 55 s.
  • Turn-complete criterion: angle error within 1.5°.
  • AR markers: 9 cm side, numbers 1–8 kept.
  • Firing serial port: 9600, 8N1; an 8-byte fire frame, then a reset frame 0.1 s later.