How f1tenth/f1tenth_gym works
Project type and purpose
• This is a full-featured open-source simulation library packaged as an OpenAI Gym environment for the F1TENTH autonomous racing platform.
• It provides a configurable 2D/3D race-car simulator (physics, collision, sensor, rendering) behind a Gym-compatible API so RL agents can train and test control policies.
File structure
• Top-level:
• gym/f110_gym: the core Python package
• examples/: usage scripts (waypoint_follow.py, config files)
• docs/: Sphinx/Doxygen documentation, including API reference under docs/api
• Dockerfile, CI workflows, setup.py, requirements
• Inside gym/f110_gym/envs:
• base_classes.py – abstract Env, RaceCar, Simulator
• collision_models.py – collision testing utilities
• dynamic_models.py – vehicle dynamics definitions
• laser_models.py – LiDAR scan simulator
• f110_env.py – main Env implementation
• f110_env_backup.py – legacy Env
• rendering.py – Pyglet/OpenGL renderer
• maps/: environment map definitions (yaml, pgm)
• unittest folder: end-to-end and unit tests for each subsystem.
README for additional insights
• Confirms it’s a Gym environment (pip install-e .), provides a Docker setup for GPU rendering, and points to docs.
• Usage pattern: user does gym.make("f110_gym"), steps through env, receives observations (LiDAR, pose), applies actions (steering, throttle).