2026-10-06 18:28:45 +00:00
2026-10-06 18:11:59 +00:00
2026-10-06 18:28:45 +00:00
2026-10-06 18:28:45 +00:00
2026-10-06 18:11:59 +00:00
2026-10-06 18:28:45 +00:00
2026-10-06 18:28:45 +00:00
2026-10-06 18:28:45 +00:00
2026-10-06 18:28:45 +00:00
2026-10-06 18:28:45 +00:00
2026-10-06 18:11:59 +00:00
2026-10-06 18:28:45 +00:00
2026-10-06 18:11:59 +00:00
2026-10-06 18:11:59 +00:00
2026-10-06 18:11:59 +00:00
2026-10-06 18:28:45 +00:00
2026-10-06 18:11:59 +00:00
2026-10-06 18:28:45 +00:00

ATS Native FSD

Experimental simulator autopilot and Tesla Semi cab displays for American Truck Simulator. The controller follows the game's directed lanes and active GPS route, measures nearby vehicles and trailers, and drives through vJoy.

Run

Use Run-Native-Drive.bat or the Tesla Semi FSD desktop shortcut. Both start the native backend.

C:\Python314\python.exe -B tools/run_native_gameplay.py --input auto --cab-only --no-record

The engine must be powered, Drive selected, ATS cruise disabled, and a supported GPS route available before engagement. The map cache prepares the trip in the background and the screen reports readiness and missing connections.

  • F8: engage or release driving controls.
  • Home / End: adjust MAX by 5 MPH.
  • Manual steering/braking or Escape: release controls.
  • Cabin mouse-look: independent of driving observations.

User-facing speeds, distances and range use imperial units. MAX follows increases in the truck navigator's posted limit, with a 5 MPH trailer offset or 10 MPH bobtail offset. Home/End can override the target within 5–80 MPH. A lower or unchanged posted limit does not overwrite a manual setting.

The verified automatic input transport is vJoy. --input vjoy, --input ets2la and --input spf select explicit transports; the SPF bridge is diagnostic and its acknowledgement alone does not establish that ATS mapped its controls.

Native driving

NativeLaneGraphManager verifies mounted game/mod assets, keeps a persistent map cache, and expands it in a separate process as the truck and GPS route move. A changed executable or mounted archive invalidates incompatible geometry.

The whole-trip planner works backwards from the destination over directed lane connections. It selects lanes needed for later turns and exits, reports unresolved segments, and plans supported truck detours. A prepared maneuver still needs current boundary permissions and observed traffic clearance.

Steering follows ordered lane geometry with lane-center feedback, damping, speed-dependent limits, and stronger low-speed authority for tight turns. Speed control combines the selected path, curve anticipation, coverage, traffic following, and signal stops. Braking slows a zero-drag truck when a lower target requires it; releasing throttle alone is insufficient in this game.

Passing uses mounted adjacent-road lane definitions and measured vehicle bodies. When MAX exceeds a slower lead's speed, the planner checks a supported passing lane, signals, follows a road-anchored transition, and returns only after the passed vehicle clears the player's trailer. Shoulders and opposing lanes are excluded. Signalized junction queues do not trigger a pass.

Traffic-light planning associates live lamp states with authored stop curves. Green entry also requires the supported crossing policy and fresh observed traffic gaps. Incomplete observations retain a hold. Vehicle observations do not provide complete detection of random construction cones, yellow X barriers, invisible walls, or temporary closures. Unsupported geometry remains an explicit route gap.

Roads and prefab paths use verified source formulas and measured spans. Banked roads support an experimental linear endpoint-roll surface model up to six degrees; truck heading, height and lane-membership checks still apply. The approximation and driving controller remain experimental.

Charging stops

The Tesla Semi battery estimate uses the mod's SDK fuel amount divided by capacity. At 20% or below, a background planner searches for the nearest reachable mapped charging/fuel service over qualified connected lanes.

The custom navigation display shows the detour and retains the original trip. Game GPS/job data is preserved. At a supported pump approach, the controller holds the brake while the driver completes the game's refuelling interaction. At 90% or above, it resumes the original route. A diversion never automatically engages F8. Unsupported station entrances are reported and leave the original route selected.

Cab displays

The two custom Tesla Semi screens show driving status, vehicle and trailer visuals, nearby traffic, the selected path, active navigation, gear, truck indicators, battery estimate and range. The right screen powers off with the truck. Hide the optional desktop panel with --cab-only.

Native driving does not capture a camera feed. The auxiliary viewport and camera hook are retired. Disable-Forward-Camera.bat runs the reversible removal helper with ATS closed, preserving the SPF framework, TruckScreen plugin, telemetry and vJoy.

native/truck_screen consumes display-only shared frames. Producers and the installed plugin use matching native V1 protocol names. The bridge validates frame handoffs, retains its last valid frame through short gaps, and shows an offline state when the producer expires. native/spf_sdk contains shared framework headers used by the screen and optional input plugins.

Build with native/truck_screen/build.ps1; install the display package with Install-Tesla-Screens.bat while ATS is closed. Addon installation preserves existing game/mod archives.

Runtime reliability and diagnostics

GPS, actor and signal reads run in independent background workers. The control loop consumes completed observations without waiting for slow process-memory reads or reconnects. Original observation times and expiry checks remain; a late result cannot become fresh by completing late. Pauses and GPS destination changes invalidate cached observations immediately.

Cab rendering runs on a separate worker. Actuator command publication and release use separate synchronization. A 500 ms command watchdog remains active; manual takeover and confirmed focus/actuator faults release controls. Every new engagement requires a human F8 press.

diagnostics/native-control.jsonl records engagements, releases, source ages, reader durations, selected lanes, trip gaps, traffic, charging status, and control/render timings. diagnostics/native-lanes/trips contains trip reports. --no-record disables image recording but retains compact control logs.

C:\Python314\python.exe -B -m unittest discover -s tests
C:\Python314\python.exe -B tools/check_native_trip.py

The regression suite covers native routing, geometry, traffic, signals, speed, input ownership, displays and asynchronous observations. Simulator behavior still needs live validation; passing tests does not establish complete route coverage or collision avoidance.

S
Description
ATS native Tesla-style autopilot, route planner, traffic-aware control, and in-game displays
Readme
4.5 MiB
Languages
Python 83.2%
C 11.6%
C++ 3.5%
PowerShell 1.6%
Batchfile 0.1%