Sensor-driven navigation for FIRST Tech Challenge robots
Autonomous routines are where FIRST Tech Challenge robots earn or lose matches. A driver can shove a robot up to a goal, but a machine that finds the goal on its own, squares up to it and deposits a game piece keeps scoring while the driver plans the next task. That behaviour comes down to sensors: the components that let a robot know where it is, what sits in front of it and when to stop.
The competition floor is small and unforgiving. Robot dimensions are capped at 45.7 cm on a side and roughly 13.6 kg, so every gram of sensor and cable has to justify itself. The floor is a grid of tiles that shift under load, the goals are bright and reflective, and other robots will bump into yours. Add motor electrical noise, overhead venue lighting and the glare of an afternoon sun through a high window in Perth, and sensor work becomes most of the debugging.
This guide walks through the sensing hardware that matters for autonomous navigation, shows how to combine readings in code, and explains how to test and demonstrate the result. It suits a first-year crew in Brisbane as much as a veteran team preparing for a championship trip, because the same rule applies to both: build a sensor suite that fails gracefully, then tune it where the robot actually competes.
What autonomous navigation really demands
A self-driving robot needs three answers, continuously: where am I, which way am I facing, and what is in front of me. The FTC field is roughly 3.6 by 4.1 metres, laid with 610 mm tiles and punctuated by bright goals, so there is plenty of room to get lost and little time to recover. Odometry answers the first question, the gyro the second, distance sensors the third.
The trap is treating every reading as a fact rather than a hint. Cables shake loose, connectors collect dust, a robot gets bumped mid-routine. Solid autonomous code assumes failure. It cross-checks two sensors when it can, times out rather than hanging, and drops into a safe state instead of charging into another machine. Teams in Melbourne, Sydney, Brisbane, Perth and Adelaide usually settle on four or five working sensors instead of ten gadgets, which is healthier design anyway.
Budgeting for hardware adds an Australian wrinkle. Most parts ship from suppliers such as Rev Robotics in the United States, and every order clears through Australian Customs and Border Force, with GST and brokerage on top. Lithium batteries for the robot's power pack travel under strict air-freight rules, which affects how many spare packs a team can carry. Ordering early, consolidating shipments and buying consumables locally — cable ties, heat-shrink, silicone wire — keeps the parts budget predictable across a season.
Encoders and odometry: knowing how far you have travelled
Encoders count motor shaft revolutions, and revolutions become distance once you calibrate them. FTC drive motors such as the brushless NEO have integrated encoders, so the hardware is already on the robot; the work is converting counts into millimetres. Push the robot a measured two metres against a wall, count the ticks, divide, and store that number in code.
Two encoders give you a rough position, but wheel slip makes that position drift. A tile seam, a hair or a scuffed floor patch is enough to throw a skid-steer robot a centimetre off, and the error compounds. Tracking four wheels helps, but the honest fix is a correction from another sensor: colour landmarks or the gyro close the loop and reset the drift before it ruins a scoring attempt.
In code, keep odometry in its own class that the autonomous routine never touches directly. The class maintains a pose (x, y, heading) in tile units, updated in the main loop, with a method to reset the pose and another to read it. Everything else asks the odometry where it is; nothing else writes to it.
Colour and light sensors for field position
The Rev colour sensor reads red, green, blue and white reflectance, and it is the cheapest way to confirm that the robot is where it thinks it is. Common uses include spotting the darker field border, identifying a game element by colour, and checking the robot is lined up against a coloured goal face before a deposit.
Light is the hard part. The colour sensor's readings shift under different venue lighting, and thresholds tuned in a suburban garage can fail completely under the exhibition hall lights at the Melbourne Exhibition Centre, Sydney's International Convention Centre at Olympic Park, or the Adelaide Convention Centre. Work in HSV space rather than raw RGB, keep the sensor's built-in white LED on for consistent illumination, and recalibrate thresholds at the venue rather than the night before.
Treat colour as a landmark system, not a treasure hunt. Choose one or two features that appear in a predictable place on the field, count tiles between them, and use the colour match to confirm or correct the count. Trying to detect a colour that appears in half a dozen positions on the field gives you constant false positives and a robot that keeps changing its mind.
Distance sensors for obstacle awareness
The multi-model distance sensor used in FTC can work in ultrasonic or time-of-flight mode, and the choice matters. Ultrasonic reads further but spreads a wide beam, needs a reasonably angled surface to bounce off, and returns an occasional spurious echo. Time-of-flight is narrower and more accurate at close range, which makes it the better choice for lining up with a goal face, but it has a short minimum distance and reports nothing if a surface sits too close.
Placement beats specifications. A sensor mounted low or behind the robot's frame often detects the robot itself, so tilt and angle it outward and downward where the chassis cannot reflect the beam. Distance readings are also the fastest way to notice another robot that has rolled into your path during an autonomous routine, which is a better safety net than any line on the floor.
Filter and time out. Take the median of several readings instead of the average, so one bad echo does not steer the robot, and give every distance query a deadline. If nothing comes back within a few hundred milliseconds, treat the obstacle as unknown and abort the routine cleanly. Switching a sensor between ultrasonic and time-of-flight modes requires stopping and reconfiguring it in code, so decide a mode for each sensor and note it in the build documentation.
Gyroscopes, accelerometers and tilt detection
The nine-axis IMU connects over I2C to the Control Hub and delivers the heading the gyro provides, plus acceleration data that tells you whether the robot is on a ramp, tilted against a wall, or being picked up by a referee. Heading correction is its main value: an encoder-based estimate of direction degrades fast, while the IMU's fused heading stays usable through a whole autonomous period.
Drift and vibration are the enemies. The gyro drifts slowly, so recalibrate at the start of every autonomous and use the sensor's fused heading output rather than integrating raw rotation rates yourself. Mount it rigidly on the robot rather than on a flexible 3D-printed bracket, because drivetrain vibration is the single largest source of bad heading data.
Electrical noise arrives through the wiring. Run sensor leads twisted, keep them away from motor and servo cables, and add ferrite chokes where a sensor cable runs near the drivetrain. A quick bench test with the motors at full power and the robot on blocks will reveal a noisy analogue reading long before it becomes a mysterious failure on the field.
Fusing sensors into one dependable loop
The finished behaviour comes from combining sources rather than stacking them. Odometry provides the base estimate, the gyro corrects the heading, colour confirms position at a landmark, and the distance sensor acts as a safety check just before the robot commits to a path. Each sensor covers a weakness of the others, so the robot keeps working when one of them degrades.
Write the fusion as a small manager with a single update call, and make it non-blocking. In the FTC SDK, a Java or Kotlin OpMode with a short loop delay, or a Python implementation through RobotPy, can call that update in the background of the autonomous routine so a colour check never stalls the drivetrain. Add hysteresis to threshold tests, so a reading that flickers across the boundary does not make the robot twitch back and forth.
Logging turns guesswork into data. Publishing sensor values to the Driver Hub during practice tells a mentor exactly which reading failed first. The same instinct drives civic tech connecting communities, the kind of work that maps local services so people can find help close to home; inside a robotics club, a live view of sensor health is what tells a stuck crew where the drift began and which spare part to replace.
Testing, tuning and sharing what you built
Test each sensor alone before you test the robot. Cover the colour sensor to check that it reports a change, tilt the robot to confirm the accelerometer reacts, and lift a wheel to check the encoder counts. Then test combinations on the field, and run the full autonomous routine repeatedly, recording what failed each time. Ten consecutive successful runs reveal far more than one good lap.
Bring spares and a checklist to every event. A spare sensor, a spare set of cables, a known-good distance sensor and a printed threshold sheet will save a match that a broken wire would otherwise end. Recalibrate colour thresholds in the venue lighting during practice, confirm the gyro recalibrates cleanly, and run the routine once with the robot on the field so the battery and the pose reset are proven.
Showing the work helps the team grow. A demonstration event lets a crew show its sensors to younger students and to adults who might become mentors or sponsors, and FIRST's own guide to running a robotics open house covers the practical side of that. A sensor rig on a table, with a live readout on a laptop, makes engineering concrete for school audiences and aligns neatly with the digital and design technologies content in the Australian Curriculum.
Here is how the main sensing options compare for autonomous work:
| Sensor | What it measures | Typical FTC hardware | Strengths | Watch-outs |
|---|---|---|---|---|
| Rotary encoder | Motor shaft rotation | Brushless NEO motors with integrated encoders | Cheap, precise, always readable | Counts wheels, not distance; slips on tiles |
| IMU | Heading, tilt, acceleration | Nine-axis IMU on the Control Hub | Immediate heading, detects tilt | Drifts; sensitive to drivetrain vibration |
| Colour sensor | Red, green, blue, white reflectance | Rev colour sensor | Cheap landmark detection | Readings shift with venue lighting |
| Ultrasonic distance | Range to a surface | Multi-model distance sensor | Longer range, inexpensive | Wide beam, blind spot, occasional echo |
| Time-of-flight distance | Short-range distance | Multi-model distance sensor in ToF mode | Narrow beam, precise alignment | Short minimum range, mode switching in code |
| Limit switch | Contact | Mechanical or optical switch | Simple and instant | Reports only that something is touching |
Autonomy is not a feature you bolt on at the end of the build season; it is the result of small, tested decisions made all year. Pick one routine this season, wire an encoder to both drive motors, and log the counts for a week. Then add the gyro, correct the pose with a colour landmark, and keep the distance sensor as a safety check. Bring the spare parts, the calibration sheet and the data to your next practice session, and share the rig with your school community as well. Teams that document their sensor behaviour and mentor new crews tend to go further in the following season than teams that simply chase the biggest score.
Maryland FIRST Robotics