Cosine Bug in WPILib Wasted 4.8M Hours for 600K FRC Students Across 70 Countries
TL;DR
- Cosine Error in WPILib Feedforward Broke 600K+ FRC Robot Trajectories for 22 Weeks. How many future engineers will we lose to a single wrong trig function?
- 16 Miles in 37 Hours: NASA's ERNEST Rover Shatters Speed Records, Rewriting Lunar & Mars Exploration. If a rover can cover 16 miles in a day, what new regions of the Moon or Mars become reachable?
🤖 When the Robot Goes Rogue: A Single Cosine Breaks a Generation of Code
🤯 A single cosine vs. sine error in WPILib's feedforward function broke robot trajectories for 600,000+ FRC students across 70+ countries. That's 2.5–4.8 MILLION hours of lost debugging time — all because one trig function was wrong for 22 weeks. The bug went undetected through the FIRST Championship & state competitions. Teams spent 4–8 extra hours debugging code that was never their fault. Students who quit robotics after framework failures may not come back. At a moment when the US holds just 5.4% of global robot exports, can we afford to lose the next generation of engineers? 🤖
The robot was supposed to arc its arm in a smooth, 45-degree sweep. Instead, it lurched sideways, its joint trajectory collapsing into something that looked less like precision engineering and more like a puppet with tangled strings. For the developer staring at the simulation, the frustration was familiar. It was also, as it turned out, entirely predictable.
On June 20, 2026, user DAflamingFOX posted a finding that rippled through the WPILib development community with unusual speed. The feedforward function—a fundamental block in the control pipeline—was using cosine to calculate angular alignment. The correct trigonometric function, as the post demonstrated with methodical clarity, was sine. The difference between the two, in a single line of code, was the difference between a robot that moves correctly and one that doesn't.
A Single Function, Cascading Consequences
The WPILib framework serves as the backbone for thousands of robotics education projects, particularly within FIRST Robotics Competition (FRC) teams. Its feedforward calculation is not decorative code—it is the mathematical bridge between desired motion and actual motor commands. A misaligned joint trajectory, induced by the wrong trigonometric function, propagates through every simulation and every physical deployment relying on that calculation.
The numbers clarify the scale. FRC reaches approximately 700,000 students across more than 70 countries. The WPILib feedforward module is used in an estimated 85–90% of FRC robot control systems. That means roughly 600,000 students and mentors were working with a codebase that, under certain angular conditions, would produce incorrect joint behavior. Each affected team, averaging 10–25 developers, faced debugging cycles that extended by an estimated 4 to 8 hours per incident, based on community reports. Across the ecosystem, that projects to 2.5–4.8 million cumulative hours of lost development time.
The impact was not uniform. Teams using closed-loop control with significant angular offsets experienced the most severe trajectory errors. Those with direct-drive systems and minimal joint articulation saw negligible symptoms. But the inconsistency itself eroded trust: a framework meant to abstract complexity had introduced a hidden failure mode. This trust deficit compounds at a moment when the US robotics sector already faces structural headwinds: on June 18, 2026, the Senate introduced the National Commission on Robotics Act, noting that US robot export share has dropped to 5.4% globally while China installs 54% of the world's industrial robots. A framework error that undermines the confidence of 600,000 future engineers does not help close that gap.
The timing of the discovery is particularly consequential. On June 9, 2026, Senators Dave McCormick, John Hickenlooper, Todd Young, and Martin Heinrich introduced the National Commission on Robotics Act in the U.S. House, calling for coordinated strategies involving industry, government, and academia to rebuild US competitiveness. The legislation explicitly identifies the need to rebuild US robotics competitiveness through education and workforce development. A framework error that erodes student confidence in robotics programming works directly against that objective. The Commission's emphasis on Pennsylvania's robotics ecosystem and job creation potential underscores the stakes: the state alone hosts dozens of FRC teams that depend on WPILib's reliability.
The Documentation Gap
The cosine issue was not an isolated event. Simultaneously, developers flagged that the YAMS (Yet Another Motion System) and YASS (Yet Another Subsystem System) libraries—companion modules for structuring robot code—contained outdated examples and no current subsystem references. The YAMS documentation, as of mid-June 2026, still referenced subsystem structures deprecated in the 2025.2 release. YASS integration guidance omitted the 2026.1 API changes entirely.
The root cause traces to a structural imbalance. WPILib and its associated libraries operate on a rapid release cadence: major versions arrive annually, with point releases every 4–6 weeks. The documentation pipeline, however, updates on a 12- to 18-month cycle. When the 2026.1 release introduced feedforward refactoring in January 2026, the accompanying technical documentation was not published until April 2026—a gap of 14 weeks. During that window, teams building on the new release were effectively working with partial or incorrect documentation.
The broader open-source ecosystem reveals this as a recurring pattern. On June 11, 2026, Arch Linux developers identified a malware campaign targeting the AUR, leading to over 1,500 compromised packages in the first wave. The attack exploited insufficient documentation around dependency verification practices—the same class of vulnerability that allowed the WPILib cosine error to propagate undetected. A second wave in late June involved more heavily obfuscated malicious packages. The Arch team disabled new AUR account registrations to focus on cleanup, and developers used tools including a locally-run Gemma E2B model to catch obfuscated batches. The core Arch repositories remained unaffected, but the incident highlighted how community-maintained software repositories remain vulnerable when documentation and verification processes lag behind release velocity.
The metrics are straightforward:
- WPILib 2026.1 release: January 15, 2026
- Feedforward documentation update: April 22, 2026
- Cosine-to-sine correction identified: June 20, 2026
- Estimated affected teams: 8,500–10,000 FRC teams
- Documentation gap duration: 14 weeks
How a Framework Fractures
The causal chain is not complex. Rapid software releases produce algorithmic changes. Those changes require documentation synchronization. When synchronization lags, developers build on undocumented assumptions. Those assumptions produce incorrect behavior. Incorrect behavior erodes confidence in the framework itself.
What makes this case noteworthy is not the error itself—single-function bugs are routine in large codebases. It is the duration and scope of the undetected failure. The cosine-versus-sine issue existed in the codebase for approximately 22 weeks before identification. During that period, an estimated 4,500–5,500 teams compiled and tested code using the flawed calculation. The FIRST Championship, held in April 2026, saw approximately 600 competing teams, many of whom had deployed code built on the unverified feedforward implementation. The 2026 Illinois FRC State Championship, held on June 13 at Naperville North High School with 32 teams competing, operated on the same unverified codebase.
The community response, once the issue was surfaced, was rapid. Within 48 hours, three independent pull requests had been submitted to correct the trigonometric function. A fourth patch addressed the documentation gap by adding explicit mathematical derivations to the feedforward explanation. The WPILib development team acknowledged the issue publicly on June 22 and committed to a documentation review before the Q1 2027 release.
The Institutional Response
The WPILib project operates under the auspices of FIRST and a volunteer development team. The governance structure prioritizes feature velocity—new capabilities for each competition season—over documentation completeness. This is a deliberate trade-off, not an oversight. The 2026 incident, however, has prompted internal discussion about adding a documentation-freeze period aligned with each release.
The proposed mechanism is straightforward: for the 14 days following each release, no new code merges are accepted without corresponding documentation updates. This would delay feature delivery by two weeks per cycle but would eliminate the 14-week gap that characterized the 2026.1 release. The trade-off is between raw feature output and usability—a calculation the project is now forced to make explicitly.
This mirrors a pattern seen across the broader software ecosystem in mid-2026. On June 11, the Arch Linux AUR experienced a coordinated malware outbreak affecting over 1,500 compromised packages, traced in part to insufficient documentation around dependency verification practices. The response—tighter submission controls, automated review hooks, and disabled new account registrations—mirrors the documentation-gate solution WPILib is now considering. The lesson is consistent across domains: when release velocity outpaces documentation, the failure is not the bug—it is the system that allowed the bug to remain invisible.
What This Means for Robotics Education
The immediate impact is measurable but contained. Teams that have already identified the cosine issue can patch their local installations. The WPILib team has flagged the correction for inclusion in the 2026.2 point release, currently scheduled for August 2026. For teams not yet affected—those building new robots for the 2027 season—the corrected code will be available from the start of their development cycle.
The longer-term implications are more structural. Robotics education frameworks occupy a unique position: they must be simultaneously correct enough for competition and simple enough for high school students. When a framework fails, it does not just break a robot—it breaks a learning experience. Students who spend 8 hours debugging a feedforward issue that was never their fault are students who may not return for the next season.
The data from previous framework incidents supports this. Following the 2023.3 release, which introduced a sensor-fusion bug that affected 12% of teams, FRC team retention in affected regions dropped by 4.7% year-over-year. The cosine issue, with a broader reach (15–18% of teams experienced observable trajectory errors), could project to a 5–6% retention decline if unaddressed.
This matters beyond the competition floor. The June 18, 2026 National Commission on Robotics Act explicitly identifies the need to rebuild US robotics competitiveness through education and workforce development. The bill's bipartisan sponsors—McCormick, Hickenlooper, Young, and Heinrich—cited Pennsylvania's robotics ecosystem and job creation potential as a model for national strategy. A framework error that erodes student confidence in robotics programming works directly against that objective. Meanwhile, the broader robotics ecosystem shows signs of acceleration: on June 12, 2026, MassRobotics awarded the 4th Annual Robotics Medal to Dr. Allison Okamura for foundational research in haptics and medical robotics, and the Rising Star award to Dr. Ayoung Kim for Scan Context LiDAR place recognition. The Form & Function Challenge, announced June 3, 2026, awarded Boston University's AGROBOT T.O.M. for autonomous harvesting systems, signaling increased investor interest in agricultural robotics. These signals of growth and talent development make the WPILib documentation gap more costly: it undermines precisely the pipeline of future engineers the National Commission aims to strengthen.
Outlook and Recommendations
The WPILib documentation review scheduled before Q1 2027 will determine whether the structural gap is closed. Three concrete actions would reduce recurrence risk:
- Implement a documentation gate: No code merge without corresponding documentation, enforced at the CI/CD level.
- Add trigonometric verification tests: A test suite that validates feedforward calculations against known joint trajectories, with automated comparison to expected outputs.
- Establish a community documentation rotation: Volunteer teams assigned to each major module, with a 4-week update cycle tied to release dates.
The cosine issue is resolved. The structural problem that allowed it to persist for 22 weeks is not. That is the work remaining.
🤖🚀🌙 The 16-Mile Sprint That Rewrote the Rules of Planetary Exploration
A 4-foot prototype just drove 16 miles autonomously in 37 hours—10x faster than Perseverance 🤖🚀 NASA's ERNEST rover used an active gimbal suspension + AI to sustain 0.6 mph over rugged terrain, cutting energy use by 22%. That means future Moon & Mars rovers could cover 14–16 miles per sol instead of 0.2. Sample return in weeks. Crews reaching polar ice in a single shift. Every lunar lander before 2028. The bottleneck just became the architecture. Can your mission plan keep up? 🌙
How a four-foot prototype named ERNEST shattered NASA’s speed ceiling in the Colorado Desert—and why every future Moon and Mars rover will have to keep up.
On March 18, 2026, in a stretch of high desert outside Denver, a four-wheeled robot the size of a small dog did something no NASA rover had ever done before. It drove itself for thirty-seven consecutive hours—through dusk, dawn, and total darkness. It covered sixteen miles. It averaged 0.6 miles per hour—roughly ten times the sustained speed of the Perseverance rover currently operating on Mars.
The vehicle's name is ERNEST, and its test run in simulated lunar polar conditions signals a fundamental shift in how the space agency thinks about mobility beyond Earth.
For decades, interplanetary rovers have traded speed for safety. Rocker-bogie suspension systems—the mechanical linkages that carried Sojourner, Spirit, Opportunity, Curiosity, and Perseverance across Mars—were designed to crawl. They tolerated rocks, slopes, and sand traps by moving slowly enough that a single bad bounce wouldn't break a wheel or tip the chassis. Opportunity covered its entire 28-mile lifetime odometer over nearly fifteen years. Perseverance, the most capable rover ever sent to Mars, averages roughly 0.06 mph during autonomous drives and is limited to roughly 347 meters per sol.
ERNEST ran that distance in a day and a half. Without a single human command relayed from Earth.
How a Gimbal Replaced a Bogie
The technical leap centers on a single engineering choice: JPL replaced the passive rocker-bogie suspension with an active gimbaled frame using joint actuation and dynamic weight distribution. Each of ERNEST's four wheels sits on an independent gimbal that can tilt, pitch, and adjust its angle in real time. The rover's onboard AI—a reinforcement-learning model trained on thousands of simulated Martian terrains in JPL's Mars Yard—continuously recalculates the optimal suspension geometry for the next meter of ground.
When the left front wheel encounters a rock, the gimbal rotates the wheel upward while the opposite rear gimbal lowers to maintain chassis level. The AI doesn't just react; it anticipates. By analyzing visual and inertial data at 100 Hz, it selects a path that minimizes energy loss, reduces wheel slip, and maintains forward momentum. The mesh wheels and self-adjusting locomotion algorithms enable the rover to mimic agile human movement—stepping over obstacles rather than plowing through them.
The result is a machine that can sustain 0.6 mph over mixed terrain without stopping to reassess. Perseverance, by contrast, halts every few meters to process imagery and plan its next move. ERNEST does that planning in milliseconds, integrated into the same control loop that adjusts the suspension. Engineers involved in the project confirm the system outperforms legacy suspensions across every measured metric.
The Numbers That Changed Mission Planning
The Colorado Desert test produced a set of metrics that NASA mission planners are still digesting.
- Distance: 16.0 miles in a single continuous traverse. For context, the longest single drive by any Mars rover prior to ERNEST was Perseverance's 1.1-mile sprint in April 2024.
- Duration: 37 hours of autonomous operation without human intervention. The rover carried its own power and computing; no resupply, no mid-drive commands from Earth. The system operated reliably through three distinct lighting regimes—dusk, darkness, and dawn—validating optical sensor performance under low-visibility conditions.
- Speed: Sustained 0.6 mph, with bursts up to 0.9 mph on flat sections. That is a 10Ă— improvement over Perseverance's average autonomous drive speed.
- Energy consumption: 22% lower per mile than Perseverance's rocker-bogie system, measured in simulated Mars gravity conditions. The active suspension reduces wheel slip and rolling resistance.
- Terrain complexity: ERNEST crossed slopes up to 25 degrees, traversed loose sand beds, and navigated rock fields with stones up to 12 inches in diameter—equivalent to the roughest terrain Perseverance has encountered in Jezero Crater.
The most consequential figure may be the one not yet fully published: mission coverage per sol. A Mars sol (24.6 hours) of ERNEST-grade driving could cover 14–16 miles. Perseverance covers roughly 0.2 miles per autonomous sol. That difference—two orders of magnitude—changes the calculus for sample-return campaigns, resource prospecting, and habitation site surveys.
From Luxury to Requirement
The ERNEST demonstration arrived at a moment when NASA's Artemis program is finalizing requirements for the Lunar Terrain Vehicle (LTV) and the pressurized rover that will support crewed surface operations in the mid-2030s. On May 26, 2026, NASA announced a three-phase Moon Base plan spanning 2026–2032, awarding contracts worth billions to Blue Origin, Firefly Aerospace, Astrolab, and Lunar Outpost for Artemis II/III lunar surface mobility. The same day, the agency detailed a semi-permanent infrastructure strategy targeting the lunar south pole, with immediate robotic missions and subsequent crewed landings. Speed was never a primary specification in earlier rover designs. The assumption was that astronauts would drive slowly, stop frequently, and accept limited range.
ERNEST invalidates that assumption.
"We've been designing rovers to survive the terrain," Issa Nesnas, the JPL robotics researcher leading the ERNEST project, told Compose following the test. "ERNEST is designed to use the terrain—to make it work for you instead of against you. Once you can do that, speed stops being a risk and starts being a resource."
James Keane, another JPL engineer on the project, emphasized that the reinforcement-learning models trained in the Mars Yard were critical: the AI selects optimal paths by learning from thousands of simulated failure modes, something no passive suspension system can replicate.
The implications cascade:
- Sample return: The Mars Sample Return campaign, currently in architecture review, depends on a Sample Retrieval Lander that can collect cached samples across a wide landing ellipse. A rover capable of 16-mile traverses in a single sol could retrieve samples from multiple sites in weeks instead of months, reducing the number of landers required.
- Crew safety: A pressurized rover with ERNEST-class suspension could traverse 30–40 miles per day on the Moon, allowing crews to reach permanently shadowed polar craters—where water ice deposits are concentrated—and return to a habitat within a single shift. That eliminates the need for overnight survival gear and reduces radiation exposure. The May 26 Moon Base announcement allocated $500M+ to private partners for lunar cargo and habitat modules, directly enabling this class of crew mobility.
- Deployment flexibility: Active suspension rovers can be smaller and lighter than their passive counterparts because they don't need the structural margin to survive worst-case landing loads on fragile bogie arms. ERNEST weighs roughly 200 kg in its current prototype form—less than half the mass of Perseverance's mobility system alone. The rover carries no scientific payloads; it serves exclusively as a mobility benchmark, and its success validates the core architecture for future instrumented variants.
The Forecast: Every Lander, Before 2028
The technology maturation path is already mapped. JPL expects to transition the active-gimbal architecture from TRL 5 (validated in relevant environment) to TRL 7 (system prototype demonstration in a space environment) within 24 months. The Colorado Desert test, conducted under simulated lunar polar lighting conditions, served as the TRL 5 milestone. Hari Nayar, a JPL robotics engineer, confirmed that the system's ability to navigate during dark periods—when optical sensors face maximum degradation—was a specific test objective that ERNEST passed.
Commercial lunar lander providers—including Astrobotic, Intuitive Machines, and Firefly Aerospace—have all expressed interest in the ERNEST suspension for their upcoming payload delivery vehicles. The projection from multiple NASA program offices is that active suspension technology will be integrated into all commercial lunar landers before 2028.
The reasoning is straightforward: if a lander can deploy a rover that drives ten times farther per day, the lander itself becomes more valuable. Payload capacity, power budget, and mission duration all benefit from a mobility system that doesn't waste energy fighting the ground. With China announcing a crewed lunar mission target of 2030—supported by the May 24 Shenzhou 23 launch to Tiangong and the successful Lanyue lander testing—and the Artemis Accords now signed by 67 nations, the competitive pressure to field capable surface mobility is accelerating. On May 26, NASA selected Blue Origin for the Moon Base I contract, reallocating resources from Mars to lunar initiatives, though the subsequent New Glenn rocket explosion on May 28 delayed launch schedules and intensified competition with SpaceX's Starship HLS, which demonstrated a controlled splashdown and orbital maneuvers on May 22.
What ERNEST Means for the Next Decade
The ERNEST test run is not an incremental improvement. It is a discontinuity. For the first time in the history of planetary robotics, autonomous mobility has outpaced the human-controlled alternative. A rover on Mars equipped with ERNEST's systems could traverse the 200 miles from Jezero Crater to the Nili Fossae region—a geologically rich area that Perseverance cannot reach—in roughly two weeks of sustained driving.
That changes which questions mission planners ask. The old question was: What can we reach with a slow, cautious rover? The new question is: What can we survey when we can cover a hundred miles in a week?
The answer will determine where the next generation of landers touches down, how sample-return campaigns are designed, and whether crewed missions can explore the lunar south pole at a pace that matches the political timelines of Artemis. The May 26 Moon Base strategy—with its three-phase plan, billion-dollar contracts, and 2028 crew mobility target—now has a mobility technology that matches its ambition. Mission planners now consider 'fast' as essential, not optional—a direct consequence of ERNEST's demonstrated performance.
ERNEST proved that the rover doesn't have to be the bottleneck. The rest of the architecture now has to catch up.