Telemetry¶
What a Gym.step(), Gym.reset() or Gym.restore() answers.
Choosing groups¶
When you connect, you name the groups every sample carries, or TelemetryGroup.ALL for every one of them. Each
group is an attribute of Telemetry, and a group you did not choose is None. The lidar group is the scan of
the gym’s Lidar, so it is there exactly when you give one.
Group |
Attribute |
View |
Holds |
|---|---|---|---|
|
race time, flags, lap, checkpoints taken |
||
|
position, orientation, velocities |
||
|
gear, shift state, inputs in force, drive command |
||
|
contact, surface, suspension, icing per wheel |
||
|
the gameplay effects in force |
||
|
tuple of |
the car’s collision shape, in world space |
|
|
every scalar of the game’s vehicle state |
||
|
what the gym’s |
A TelemetryGroup value is a set of groups: combine them with | when opening a gym, and test one with in.
groups = TelemetryGroup.RACE | TelemetryGroup.VEHICLE | TelemetryGroup.WHEELS
TelemetryGroup.WHEELS in groups
Types and units¶
Units follow the game: metres, metres per second, radians per second, milliseconds, ticks of 10 ms. Coordinates are
world space unless a property says otherwise. A scalar property is a plain int, float or bool; a vector is a
NumPy array. The wheel and lidar views give their properties an axis (4 wheels, R rays) before a vector’s
components.
- type Vec3¶
A
numpy.ndarrayoffloat32whose last axis is(x, y, z): shape(3,).
- type Quat¶
A
numpy.ndarrayoffloat32whose last axis is a unit quaternion(x, y, z, w): shape(4,).
- type FloatArray¶
A
numpy.ndarrayoffloat32: a scalar, or the axis the property documents.
- type IntArray¶
A
numpy.ndarrayof integers: a scalar, or the axis the property documents.
- type BoolArray¶
A
numpy.ndarrayofbool: a scalar, or the axis the property documents.
The telemetry object¶
- class Telemetry¶
What a step, a reset or a restore answered: the state at one race tick.
The group attributes (
t.race,t.vehicle, …) are the groups the gym was opened with andNonefor the others. A scalar property is a plainint,floatorbool; a vector one is a(3,)array.- property drivetrain: Drivetrain | None¶
The drivetrain group, or
Noneif it was not chosen.
Race¶
- class Race¶
Race time, flags, lap and the checkpoints taken.
t.racewhenTelemetryGroup.RACEwas chosen.
- Race.flags: int¶
Bits of
RaceFlag;finishedandentered_off_zoneread them. A scalar.
- Race.checkpoints_taken: int¶
Checkpoints passed so far, over every lap;
Gym.checkpoints()says which and when. A scalar.
Vehicle¶
- class Vehicle¶
The car’s pose and velocities in world space.
t.vehiclewhenTelemetryGroup.VEHICLEwas chosen.
Drivetrain¶
- class Drivetrain¶
Gear, shift state, the inputs in force and the drive command.
t.drivetrainwhenTelemetryGroup.DRIVETRAINwas chosen.
- Drivetrain.shift_state: int¶
A
GearShiftStatevalue. A scalar.
Wheels¶
- class Wheels¶
The four wheels, with a trailing axis of four in the order front-left, front-right, rear-left, rear-right.
t.wheelswhenTelemetryGroup.WHEELSwas chosen.
- Wheels.compression: FloatArray¶
Suspension compression. Shape
(4,).
- Wheels.icing_percent: FloatArray¶
Icing of the wheel, in percent. Shape
(4,).
- Wheels.angular_velocity: FloatArray¶
Wheel spin, in rad/s. Shape
(4,).
Effects¶
- class Effects¶
The gameplay effects in force, one bit per
Effect.t.effectswhenTelemetryGroup.EFFECTSwas chosen.
Collision shape¶
t.shape is a tuple of Ellipsoid, one per sphere or ellipsoid of the car’s collision shape, however many the
car has, in world space at the scale the physics uses. The wheel spheres ride the suspension, so the list changes from
one state to the next.
Lidar readings¶
What the gym’s Lidar saw at the sample, and what Gym.raycast() returns. Configure the rays on the
Lidar page.
- class LidarScan¶
What the rays saw, with a trailing axis over the rays in the order they were given.
t.lidarwhen the gym has aLidar; also whatGym.raycastreturns.
- LidarScan.distance: FloatArray¶
Along the ray, in m; the range when nothing was hit. Shape
(R,).
- LidarScan.flags: IntArray¶
Bits of
LidarHitFlag;hitreads them. Shape(R,).
Runtime¶
- class Runtime¶
Every scalar of the game’s vehicle runtime state, one property per field.
t.runtimewhenTelemetryGroup.RUNTIMEwas chosen.
Every scalar of the game’s vehicle runtime state and of its four wheel contact states, each a FloatArray,
one property per field. The groups above are the curated view; this is the full one, and a field that appears in both
holds the same value. Conventions:
Wheel fields carry a position prefix:
fl_,fr_,rl_,rr_.A field named
*_tick_ageis the age of a timestamp in ticks: how long ago the thing happened.A flag word is published one column per named bit,
0or1(surface_effect_flags_no_grip).Fields prefixed
m6_tom15_belong to other handling models (TM2 cars, boats) and sit at their reset value for every TM2020 car.
The fields worth sampling for a TM2020 car:
Water:
is_in_water(a point cast hit this step),wetness(0 to 1, rises in water and dries on ground contact; scales brake and lateral limits).Grip:
surface_grip_scale(the mean over wheels of the icing grip scale: 1 normally, 0.8 on ice or snow above 5 km/h, near 0 under NoGrip),is_any_wheel_on_ice_or_snow, per wheelicing_state(0 none, 1 icing up, 2 thawing),icing_blend,icing_thaw_floor.Gates and effects:
gate_gameplay_id(the gameplay id of the gate the chassis is in),surface_effect_flags_*(this step’s surface effects: engine off, engine forced on, no brakes, no steering, no grip) andheld_surface_effect_flags_*(the same bits held until a reset gate or checkpoint),slow_motion_time_scale,cruise_control_target_meters_per_second,reactor_boost_*,fragile_gate_active,fragile_damage.Script coefficients, named as ManiaScript names them:
accel_coef,control_coef,gravity_coef,adherence_coef.Steering (Stadium car):
steering_smoothed,steering_direction(0 neutral, 1 left, 2 right),steering_direction_change_tick_age,steering_direction_change_drive_scale,forward_motion_alignment_scale(1 moving along the heading, 0.2 sliding sideways under throttle).Surfaces (Stadium car):
all_wheels_on_dirt_target,dirt_axle_force_ramp_*,soft_surface_wheel_count,soft_surface_drive_scale_hold_deadline_tick_age.Collisions:
has_contact_this_step,wall_hit_damping_start_tick_age,roof_contact_this_step,side_or_roof_contact_this_step,floor_contact_this_step,direction_change_boost_*(a throttle reversal away from a wall below 40 km/h),contact_solver_residual,collision_yaw_rate_*.Respawn:
respawn_hold_deadline_tick_age,first_step_tick_after_respawn,pose_discontinuity_count(teleports and respawns).Per wheel:
damper_length(suspension length in metres, smaller is compressed),damper_velocity,wheel_angular_velocity(rad/s),wheel_spin_blend(0 rolls at ground speed, 1 spins with the drive demand),wheel_rotation_radians,wheel_steer_angle_radians,has_ground_contact,had_contact_last_step,is_slipping,surface_material_id,surface_gameplay_id.
All fields¶
scene_runtime_idcollision_item_countm6_upright_cos_contact_scale_fullm6_upright_cos_contact_scale_zerom6_upright_cos_wheel_point_fullm6_upright_cos_wheel_point_zerom6_upright_cos_speed_response_fullwheel_contact_normal_y_ground_thresholdpending_replay_event_flagaccel_coefaction_key_steer_limitcontrol_coefgravity_coefimpact_notice_body_normal_sum_ximpact_notice_body_normal_sum_yimpact_notice_body_normal_sum_zimpact_notice_body_peak_normal_speed_mpsimpact_notice_body_material_idwheel_countlinked_parent_entity_idrace_timer_base_tick_agerespawn_hold_deadline_tick_agesurface_effect_flags_engine_offsurface_effect_flags_engine_forced_onsurface_effect_flags_no_brakessurface_effect_flags_no_steeringsurface_effect_flags_no_grippose_discontinuity_counthas_contact_this_stepis_in_water_this_stepany_wheel_slippingm6_direct_steer_ratiowheel_slip_last_tick_agesteering_smoothedm6_drift_latch_activem6_surface_speed_scalem6_surface_acceleration_scalem6_surface_brake_scalem6_surface_gripm6_surface_force_ramp_start_kmhm6_surface_force_ramp_end_kmhm6_surface_force_ramp_magnitudem6_surface_drift_tangent_force_scalem6_surface_steer_approach_ratem6_magnetic_surface_classm6_overhead_contact_reflect_pendingm6_overhead_contact_normal_xm6_overhead_contact_normal_ym6_overhead_contact_normal_zm6_has_recent_contactm6_has_three_recent_contactsm6_wheel_steering_angle_radiansm6_throttle_demand_smoothedm6_brake_demand_smoothedbrake_input_toggle_countm6_drift_wheel_force_blendm6_drift_direction_signm13_throttle_pulse_start_tick_agem6_chassis_upright_factorm13_collision_penalty_accumulatorm9_rotation_coast_modem9_throttle_input_smoothedm9_pitch_input_smoothedm9_roll_input_smoothedm9_yaw_assist_scalem9_rotation_phase_radiansm9_rotation_rate_radians_per_secondcollision_penalty_accumulatorm14_steer_integratedm14_throttle_integratedm14_propeller_phase_radiansm14_lift_speed_budget_kphm14_last_destabilized_tick_agem14_reverse_brake_start_tick_agem14_reverse_brake_scalem15_throttle_integratedm15_impact_window_start_tick_agem15_impact_window_first_contact_tick_agem15_impact_window_stopped_tick_agem15_impact_window_collision_event_countm15_impact_window_max_tilt_radiansm15_impact_metricm12_speed_hold_gainm12_target_world_z_speedm12_yaw_torque_scalesurface_grip_scalegravity_scaledirection_change_boost_start_tick_agedirection_change_boost_end_tick_agedirection_change_boost_contact_flags_front_hitdirection_change_boost_contact_flags_rear_hitfragile_gate_activefragile_damagefragile_impact_pending_weightfragile_impact_pending_sample_countheld_surface_effect_flags_engine_offheld_surface_effect_flags_engine_forced_onheld_surface_effect_flags_no_brakesheld_surface_effect_flags_no_steeringheld_surface_effect_flags_no_gripcruise_control_target_meters_per_secondeffects_reset_start_tick_ageslow_motion_time_scaleslow_motion_reset_deadline_tick_ageis_in_watercheckpoint_passed_effects_reset_pendingwater_hold_deadline_tick_agewater_exit_correction_deadline_tick_agewetnesswall_hit_this_stepwall_hit_damping_start_tick_agelinked_collision_support_velocity_sample_countgate_gameplay_idgate_merge_group_idslow_motion_last_gate_merge_group_idreactor_boost_typereactor_boost_levelreactor_boost_start_tick_agereactor_boost_first_start_tick_agereactor_boost_up_ground_cast_start_tick_agereactor_boost_duration_ticksreactor_boost_up_over_water_steering_start_tick_ageforward_motion_alignment_scaledirt_axle_force_ramp_start_tick_ageall_wheels_on_dirt_targetdirt_axle_force_ramp_base_scalesoft_surface_drive_scale_hold_deadline_tick_agesoft_surface_wheel_countsteering_direction_change_tick_agesteering_direction_change_drive_scalesteering_neutral_start_tick_agesteering_yaw_torque_directionsteering_directioncollision_yaw_rate_change_accumulatedcollision_yaw_rate_window_start_tick_agedirectional_response_gravity_coefadherence_coefvehicle_transform_copy_tick_ageruntime_flags_transform_copy_sourceruntime_flags_ghost_response_appliedruntime_flags_crush_impulse_recordedruntime_flags_crush_impulse_from_kinematicruntime_flags_opposing_crush_impulseruntime_flags_one_body_solve_rancontact_solver_residualprevious_slow_motion_time_scaleprevious_steering_directionprevious_step_forward_speed_mpsrear_wheels_icing_grip_scalefront_wheels_icing_grip_scaleis_any_wheel_on_ice_or_snowfirst_step_tick_after_respawnwheel_contact_countcar_to_car_contact_countprevious_step_had_contactroof_contact_this_stepside_or_roof_contact_this_stepfloor_contact_this_stepphysicalized_flags_physicalizedauto_pilot_update_activem13_pair_link_eligiblem9_ground_clearance_metersm9_last_step_position_yarena_player_state_idis_update_activearena_player_update_blockedregistry_indexfl_damper_lengthfl_damper_velocityfl_suspension_contact_compression_maxfl_wheel_force_scalefl_wheel_angular_velocityfl_m6_contact_patch_speedfl_had_contact_last_stepfl_has_ground_contactfl_surface_material_idfl_surface_gameplay_idfl_is_slippingfl_wheel_spin_blendfl_wheel_rotation_radiansfl_wheel_steer_angle_radiansfl_wheel_steer_angle_target_radiansfl_m6_contact_position_hashfl_m6_suspension_forcefl_fragile_impact_window_start_tick_agefl_fragile_impact_countfl_fragile_impact_weight_sumfl_icing_statefl_icing_transition_tick_agefl_icing_blendfl_icing_thaw_floorfl_reactor_boost_up_ground_distance_maxfl_reactor_boost_up_peak_ground_distance_tick_agefl_super_reactor_boost_up_ground_distancefl_super_reactor_boost_up_has_ground_hitfr_damper_lengthfr_damper_velocityfr_suspension_contact_compression_maxfr_wheel_force_scalefr_wheel_angular_velocityfr_m6_contact_patch_speedfr_had_contact_last_stepfr_has_ground_contactfr_surface_material_idfr_surface_gameplay_idfr_is_slippingfr_wheel_spin_blendfr_wheel_rotation_radiansfr_wheel_steer_angle_radiansfr_wheel_steer_angle_target_radiansfr_m6_contact_position_hashfr_m6_suspension_forcefr_fragile_impact_window_start_tick_agefr_fragile_impact_countfr_fragile_impact_weight_sumfr_icing_statefr_icing_transition_tick_agefr_icing_blendfr_icing_thaw_floorfr_reactor_boost_up_ground_distance_maxfr_reactor_boost_up_peak_ground_distance_tick_agefr_super_reactor_boost_up_ground_distancefr_super_reactor_boost_up_has_ground_hitrl_damper_lengthrl_damper_velocityrl_suspension_contact_compression_maxrl_wheel_force_scalerl_wheel_angular_velocityrl_m6_contact_patch_speedrl_had_contact_last_steprl_has_ground_contactrl_surface_material_idrl_surface_gameplay_idrl_is_slippingrl_wheel_spin_blendrl_wheel_rotation_radiansrl_wheel_steer_angle_radiansrl_wheel_steer_angle_target_radiansrl_m6_contact_position_hashrl_m6_suspension_forcerl_fragile_impact_window_start_tick_agerl_fragile_impact_countrl_fragile_impact_weight_sumrl_icing_staterl_icing_transition_tick_agerl_icing_blendrl_icing_thaw_floorrl_reactor_boost_up_ground_distance_maxrl_reactor_boost_up_peak_ground_distance_tick_agerl_super_reactor_boost_up_ground_distancerl_super_reactor_boost_up_has_ground_hitrr_damper_lengthrr_damper_velocityrr_suspension_contact_compression_maxrr_wheel_force_scalerr_wheel_angular_velocityrr_m6_contact_patch_speedrr_had_contact_last_steprr_has_ground_contactrr_surface_material_idrr_surface_gameplay_idrr_is_slippingrr_wheel_spin_blendrr_wheel_rotation_radiansrr_wheel_steer_angle_radiansrr_wheel_steer_angle_target_radiansrr_m6_contact_position_hashrr_m6_suspension_forcerr_fragile_impact_window_start_tick_agerr_fragile_impact_countrr_fragile_impact_weight_sumrr_icing_staterr_icing_transition_tick_agerr_icing_blendrr_icing_thaw_floorrr_reactor_boost_up_ground_distance_maxrr_reactor_boost_up_peak_ground_distance_tick_agerr_super_reactor_boost_up_ground_distancerr_super_reactor_boost_up_has_ground_hit