Environment Configuration
Configuration is split between the environment ID and optional keyword
arguments passed to make. The ID chooses the map, number of agents, sensor
mode, collision mode, rewards, controls, control-step ratio, and episode length.
Keyword arguments override fields on f1tenth_gym_jax.envs.utils.Param.
Environment IDs
The canonical ID format is:
{map}_{num_agents}_{scan|noscan}_{collision|nocollision}_{rewards}_{longitudinal+steering}_{timestep_ratio}_{max_steps}_v0
For the default 90-second episode length, omit max_steps:
{map}_{num_agents}_{scan|noscan}_{collision|nocollision}_{rewards}_{longitudinal+steering}_{timestep_ratio}_v0
Older model filenames that omit timestep_ratio are still accepted for
compatibility and use timestep_ratio=1.
Examples:
from f1tenth_gym_jax import make
env = make(
"Spielberg_2_scan_collision_progress+alive_velocity+steeringangle_10_500_v0"
)
default_length_env = make(
"Spielberg_1_scan_collision_progress_acceleration+steeringvelocity_10_v0"
)
ID Fields
mapA registered map name such as
Spielberg,Monza, orSpa. Usef1tenth_gym_jax.registration.list_available_mapsto inspect the current built-in and locally cached maps.num_agentsPositive integer number of cars in the environment.
scanornoscanEnables or disables laser scan observations.
collisionornocollisionEnables or disables vehicle and map collision termination.
rewards+-joined subset oftime,progress, andalive.longitudinal+steeringLongitudinal control is
accelerationorvelocity. Steering control issteeringvelocityorsteeringangle.timestep_ratioNumber of dynamics integration steps per environment control step.
max_stepsMaximum number of environment control steps before termination. The default shorthand computes
int(90 / (timestep * timestep_ratio)).
Actions and Bounds
The environment ID names controls as longitudinal+steering for readability,
but action vectors are ordered as [steering_command, longitudinal_command].
For example, an acceleration+steeringvelocity environment expects
[steering_velocity, acceleration].
Inspect the exact bounds from the environment:
env = make(
"Spielberg_1_noscan_nocollision_progress_acceleration+steeringvelocity_1_v0"
)
action_space = env.action_space("agent_0")
print(action_space.low, action_space.high)
Keyword Overrides
Additional keyword arguments passed to make override Param fields.
env = make(
"Spielberg_1_noscan_nocollision_progress_acceleration+steeringvelocity_1_v0",
model="ks",
integrator="euler",
observe_others=False,
mu=1.0,
timestep=0.02,
)
Common overrides:
Field |
Values |
Effect |
|---|---|---|
|
|
Selects the single-track or kinematic bicycle dynamics. |
|
|
Selects the micro-step integrator. |
|
positive float |
Dynamics integration step in seconds. |
|
positive integer |
Integration micro-steps per environment step. |
|
boolean |
Adds relative state of other agents to each observation. |
|
boolean |
Adds range scan beams to each observation. |
|
boolean |
Enables vehicle-vehicle and vehicle-map collision checks. |
|
positive integer |
Ends an episode after this many completed laps. |
|
positive integer |
Ends an episode after this many control steps. |
Vehicle parameters such as mu, C_Sf, C_Sr, lf, lr,
h, m, I, steering limits, acceleration limits, vehicle dimensions,
and scan parameters are also configurable through the same keyword override
path. See f1tenth_gym_jax.envs.utils.Param for the full set of fields.
Observation Layout
Each agent observation starts with Frenet state [s, ey, epsi] followed by
the configured Cartesian dynamics state. If observe_others=True, relative
states for the other agents are appended as [relative_x, relative_y,
longitudinal_v, relative_psi] per other agent. If scans are enabled, scan
beams are appended after the state fields.
The index groups are exposed as env.observation_space_ind.
Maps and Cache
Bundled maps are loaded from the installed package. Downloaded maps are stored
under $XDG_CACHE_HOME/f1tenth_gym_jax/maps by default. Set
F1TENTH_GYM_JAX_MAP_DIR to use a different writable map cache.