Test-Driven Agentic Framework for Reliable Robot Controller
Organizations: Department of Electrical and Computer Engineering, University of California, Riverside · Department of Computer Science, University of Colorado, Boulder · Department of Mathematics, University of California, Riverside
Abstract
In this work, we present a test-driven, agentic framework for synthesizing a deployable low-level robot controller for navigation tasks. Given a 2D map with an image of an ultrasonic sensor-based robot, or a 3D robotic simulation environment, our framework iteratively refines the generated controller code using diagnostic feedback from structured test suites to achieve task success. We propose a dual-tier repair strategy to refine the generated code that alternates between prompt-level refinement and direct code editing. We evaluate the approach across 2D navigation tasks and 3D navigation in the Webots simulator. Experimental results show that test-driven synthesis substantially improves controller reliability and robustness over one-shot controller generation, especially when the initial prompt is underspecified. The source code and demonstration videos are available at: https://shivanshutripath.github.io/robotic_controller.github.io.
Figures & tables
| Category | Test Target | Verification Objective |
| Static Contract | Compliance | Ensures required constants ( SENSOR_RANGE , etc.), imports, and main entry points are present. |
| Hygiene | Explicitly bans forbidden libraries (e.g., scipy ) and unstable code patterns (e.g., indexing pygame surfaces). | |
| Unit API | OccMap2D | Validates boundary handling, out-of-bounds indexing, and occupancy querying logic. |
| Utility | Confirms nearest_free correctly identifies navigable points for robot initialization. | |
| Planner | Verifies path format (Python int ), connectivity, and safety (no points in obstacles). | |
| End-to-End | Schema | Validates return signatures of simulation loops for data logging and metrics calculation. |
| Category | Test Target | Verification Objective |
| Static Contract | Compliance | Ensures required constants ( SENSOR_RANGE , etc.), imports, and main entry points are present. |
| Hygiene | Explicitly bans forbidden libraries (e.g., scipy ) and unstable code patterns (e.g., indexing pygame surfaces). | |
| Component Logic | Environment | Validates environment parsing from world files. |
| Planner | Verifies path connectivity, and ensures all planned waypoints lie strictly within free-space coordinates. | |
| Control | Check accuracy of differential-drive wheel speed commands for forward motion, turning, and waypoint tracking. | |
| End-to-End | Schema | Validates simulation by checking return schemas for positions, speeds, and collision counts. |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
Robotic Control
Robotic control studies how machines use sensing and computation to produce reliable movement and interaction in changing environments.
See all 584 papers