A simulator for a Lane Tracking Assistance (LTA) system, including a vehicle model and customizable highway configurations.
This project simulates a highway environment for testing the LTA system. The highway can be either flat or sinusoidal, defined by the equation A * sin(w * t)
, where:
A
is the amplitude in meters.w
is the angular frequency in radians/second.
- Simulates realistic lane tracking scenarios.
- Supports flat and sinusoidal highway profiles.
- Customizable amplitude and frequency parameters.
- Real-time data visualization via PlotJuggler.
- Interactive control to steer the car out of its path.
- Install uv:
pip install uv
- Run the simulator:
Note: For best results, ensure
uv lta-sim <amplitude> <frequency>
frequency <= 0.002
andaplitude <= 6
.
- Install dependencies:
pip install -r requirements.txt
- Run the simulator:
Note: For best results, ensure
python lta-sim.py <amplitude> <frequency>
frequency <= 0.002
andaplitude <= 6
.
You can connect PlotJuggler to the simulator via UDP JSON on port 5005
for real-time data visualization. Ensure PlotJuggler is configured to listen on this port for incoming data.
- Steer the car out of its path: Use
A
andD
or the left and right arrow keys. - Toggle controller: Press
Space
to enable/disable the controller. - Quit the simulation: Press
Q
.
- Python 3.8 or later
- Required Python packages (listed in
requirements.txt
)
Run the simulator with a sinusoidal highway profile:
uv lta-sim 3 0.001
This will simulate a highway with an amplitude of 3 meters and a frequency of 0.001 rad/s.
- Lower frequencies (e.g.,
<= 0.002
) result in smoother simulations and better performance. - For flat highways, set amplitude to
0
.