Physical Wheel and Pedal Experiments
Relevant source files
The following files were used as context for generating this wiki page:
Physical Wheel and Pedal Experiments encompass a series of research trials (E02 and E03) designed to validate the ability of a simulated fruit fly body to operate mechanical vehicle controls. The experiments test whether actuation of the fly's limbs can causally turn a passive steering wheel and depress a sprung pedal through physical contact and engineered grip constraints. Sources: README.md:9-25, scripts/wheel_experiment.py:1-5.
These experiments bridge the gap between a connectome-based neural model and CARLA vehicle motion. The system uses MuJoCo to simulate high-frequency physics, ensuring that steering and acceleration result from actual mechanical interaction rather than direct data injection into the car simulator. Sources: README.md:38-40, scripts/validate_carla_cockpit.py:9-12.
Physical Steering Experiments (E02-Wheel)
The steering experiment verifies that the fly's foreleg can rotate a passive wheel when a mechanical grip is active. It compares "enabled" trials (with a foot grip) against "disabled" trials to prove causality. Sources: scripts/wheel_experiment.py:10-25.
Wheel Architecture and Data Flow
The WheelRig provides the simulation environment, including the fly body and the wheel mechanics. During a trial, the system requests a target angle, calculates the necessary joint servos through diagnostic Inverse Kinematics (IK), and steps the MuJoCo simulation. Sources: scripts/wheel_experiment.py:10-25, scripts/wheel_experiment.py:35-40.
The diagram shows the logic for validating physical steering control through grip intervention. Sources: scripts/wheel_experiment.py:10-25, scripts/wheel_experiment.py:46-52.
Wheel Experiment Parameters
| Parameter | Value / Range | Description |
|---|---|---|
| Target Range | [0.18, 0.42] rad | Range of requested steering angles. |
| Hold Error Limit | 0.08 rad | Maximum allowed deviation from target during hold. |
| Disabled Limit | 0.02 rad | Maximum allowed motion when grip is disabled. |
| Physics DT | 0.00005 s | Time step for MuJoCo physics simulation. |
| Wheel Damping | 0.10 | Damping applied to the passive wheel. |
Sources: scripts/wheel_experiment.py:36-46.
Physical Pedal Experiments (E02-Pedal)
The pedal experiment validates the fly's ability to depress a passive spring pedal using the middle leg's distal tarsus. It measures displacement in millimeters and contact force to ensure the mechanical link is functional. Sources: scripts/pedal_experiment.py:10-25.
Pedal Contact Logic
The PedalRig simulates a sprung pad with a specific mass and damping profile. A successful trial requires the fly to maintain the pedal at a target displacement (mm) while recording normal contact forces via MuJoCo sensors. Sources: scripts/pedal_experiment.py:10-25, scripts/pedal_experiment.py:32-38.
The diagram illustrates the flow from requested displacement to physical contact measurement. Sources: scripts/pedal_experiment.py:10-27.
Pedal Configuration
| Option | Default Value | Description |
|---|---|---|
| Pad Travel | 0.25 mm | Maximum physical travel of the pedal pad. |
| Spring Constant | 3 | Stiffness of the pedal return spring. |
| Damping | 0.02 | Damping for the pedal motion. |
| Error Limit | 0.04 mm | Maximum hold error for a successful trial. |
| Contact Sole | Right Middle Distal Tarsus | The specific limb part used for actuation. |
Sources: scripts/pedal_experiment.py:32-40.
Integration with Neural Controllers (E03)
In E03, diagnostic IK is replaced by a trained neural policy. The connectome-based model receives observations (target angle, current wheel angle, joint positions) and outputs joint commands at a lower frequency (20Hz) than the physics simulation (20kHz). Sources: scripts/record_learned_wheel.py:25-35, scripts/record_learned_wheel.py:60-65.
Control Frequency and Clocking
The experiment synchronizes multiple clocks to maintain causal consistency:
- Physics Clock: 20,000 Hz for MuJoCo contact stability.
- Body Sampling: 200 Hz for recording joint and wheel states.
- Neural Decision: 20 Hz for model inference.
Sources: scripts/record_learned_wheel.py:61-63.
Validation Sequence
Validation scripts reconcile the saved physical traces against the neural actions to ensure no data injection occurred. The script validate_carla_cockpit.py re-runs the physics simulation using only the saved neural actions; a successful validation requires the resulting qpos to match the recorded trace within a tolerance of 1e-10. Sources: scripts/validate_carla_cockpit.py:23-35.
Summary of Results
Physical experiments demonstrated that stationary steering is highly accurate after training, with 100/100 held-out targets passed. In connected steering trials, the fly operated the physical wheel to drive a CARLA vehicle through a 24-second sequence. Crucially, disconnecting the foot grip removes over 99% of the steering response, confirming the mechanical nature of the control. Sources: README.md:14-22, scripts/validate_carla_cockpit.py:92-95.