FPV Simulator Documentation

A browser-based FPV drone simulator built on real terrain, satellite imagery and OpenStreetMap buildings, with aerial and ground targets, thermal vision, dataset recording and a WebSocket API for autonomy development.

Open the simulator dremian.com

Getting started

Open sim.dremian.com in a desktop browser. There is nothing to install and no account. The drone spawns in the air above Ternopil, Ukraine. Press W to add throttle and fly with the keys below, or plug in a USB gamepad / RC transmitter.

Flying

Keyboard

KeyAction
W / SThrottle up / down. Throttle is sticky — it stays where you leave it.
A / DYaw left / right
↑ / ↓Pitch nose down (forward) / nose up
← / →Roll left / right
VToggle FPV / chase camera
T / FThermal vision / normal (day) vision
RReset the drone to the spawn point
- / =Time of day −30 / +30 minutes
F9Start / stop dataset recording
EscClose any open panel

Stick inputs ramp up over about a third of a second: a tap gives a small correction, holding a key builds to full deflection.

Gamepad and RC transmitter

A USB gamepad or an RC transmitter in USB joystick mode is detected automatically and takes over from the keyboard. Open the 🎮 Joystick panel and press Calibrate to map your sticks: move every stick through its full travel, and the sim records the axis, rest position, travel limits and direction of each channel (throttle, yaw, pitch, roll). Non-centring throttles and asymmetric sticks are supported. The calibration is saved in your browser.

On-screen display

The OSD follows the Betaflight style: altitude and climb rate in the corners, a sliding compass strip at the top, ground speed, flight timer, throttle, a home arrow pointing back to spawn and a radar showing targets around you. The wind arrow points where the wind blows to. A warning appears when you fly into the prop wash behind a plane.

Panels

The icon column on the right edge opens each panel. Press Esc or click outside to close it. All settings are saved in your browser.

IconPanel
🔍Search — type a place name and press Enter to fly there (OpenStreetMap geocoding).
⚙Settings — sound, wind strength, day / thermal camera, time of day, map layers (OSD, buildings, trees, roads, water, targets), camera FOV and tilt, gimbal, prop wash, freeze in place.
🎯Targets — count, speed and maximum distance for each target type.
🚁Drone & noise — aircraft preset and payload with live mass, thrust, drag, T/W and hover readouts, plus the IMU / barometer / magnetometer / GPS noise profile and per-sensor scales.
🎮Joystick — gamepad / RC calibration and live channel readout.
📹Record — start / stop dataset recording (same as F9).
?Help — keyboard reference and a link to this page.

Locations

Fly anywhere on Earth: use the 🔍 search, or start at a preset or exact coordinates with a URL parameter.

?loc=PlaceSpawn height
ternopilTernopil, Ukraine (default)400 m
manhattanTimes Square, New York100 m
praguePrague Old Town250 m
parisEiffel Tower, Paris120 m
londonLondon60 m
montblancMont Blanc summit4900 m
grandcanyonGrand Canyon rim2200 m

Custom spawn: /?lat=52.0116&lon=4.3571&h=150 (Delft). h is optional, default 200 m.

URL parameters

ParameterEffect
loc=<preset>Spawn at a preset location
lat=…&lon=…&h=…Spawn at exact coordinates; h in metres (default 200)
tier=performance|quality|cinematicForce a graphics tier instead of auto-detection
fps=NFrame-rate cap (default 60, max 120)
renderScale=NRender resolution relative to the window (e.g. 0.75)
dpr=NDevice-pixel-ratio override (default 1.0)
adaptive=0Turn off automatic resolution scaling when FPS drops
tau=NRate-smoothing time constant in ms (default 54, fitted to real flight logs)
procedural=1Procedural ground colouring instead of satellite imagery
trail=1Draw the flight path as a cyan trail
perf=1Show a GPU / frame-time stats widget
dev=1Developer overlays and self-checks
debug=1Verbose physics / render debug overlay
splats=1Load Gaussian-splat scenes where available (experimental)

Aircraft

Pick an airframe in the 🚁 panel (or dronePreset via the API). Physics use quaternion attitude, Betaflight “Actual” rates, quadratic drag, wind with gusts, prop wash behind planes, and collisions with buildings, roads and terrain. Payload mass adds to the frame mass and changes hover throttle and thrust-to-weight.

PresetAirframeMassMax thrust
quadcopter_5inch5″ FPV racer (default)0.65 kg25 N
quadcopter7″ long range1.2 kg60 N
quadcopter_10inch10″ heavy lifter3.0 kg120 N
cinewhoopCinewhoop0.45 kg16 N
wingedFixed-wing (wing lift, forward thrust)2.0 kg30 N

Targets

Targets spawn around the drone and move on their own. Set the number, speed and maximum distance per type in the 🎯 panel; the API's targets field also sets altitude and distance bands, spawn points and evasive manoeuvres.

TypeWhat it isDefault countAltitudeDistanceSpeed
droneFPV quadcopter820–200 m50–600 m15 m/s
planeLoitering-munition style fixed-wing6400–1200 m200–2500 m40 m/s
vehicleGround vehicle12ground50–1500 m10 m/s
fennekFennek armoured reconnaissance vehicle4ground50–1000 m15 m/s

Press T to see the scene through a thermal camera and F to switch back.

Dataset recording

Press F9 or the 📹 icon, pick an output folder, fly, and press F9 again to stop. Recording writes straight to disk (File System Access API, Chrome / Edge):

dataset_<time>/
  video.mp4 | video.webm   what the on-screen camera saw, one frame per log row
  log.jsonl                row N describes video frame N
  meta.json                video format, airframe, world origin, units

Each log row holds the time, flight mode, the stick commands flown that frame, the controller's raw axes and buttons (including switches and aux channels), the drone's position, attitude, velocity, airspeed and rotation rates, the wind, the camera, and every target with its position, velocity and its bounding box in the frame (null when out of view). Video is H.264 when the browser can encode it, VP9/VP8 otherwise.

WebSocket API

The simulator can be flown and observed by your own code: send stick commands, teleport the drone, configure the world, and receive telemetry and JPEG camera frames with target ground truth.

The page connects out to a relay on your machine at ws://localhost:8080/browser. Your client connects to the same relay at ws://localhost:8080/. The relay forwards client messages to the sim and sim messages to every client. The sim retries every 3 s, so start the relay before or after opening the page. All messages are JSON.

Seeing a ws://localhost:8080 error in the browser console? That is the sim looking for a relay. It is harmless when you are just flying.

1. Run a relay

# relay.py — pip install websockets
import asyncio
from websockets.asyncio.server import serve, broadcast

browser, clients = None, set()

async def handler(ws):
    global browser
    if ws.request.path == "/browser":          # the simulator page
        browser = ws
        try:
            async for msg in ws:
                broadcast(clients, msg)
        finally:
            browser = None
    else:                                      # your code
        clients.add(ws)
        try:
            async for msg in ws:
                if browser:
                    await browser.send(msg)
        finally:
            clients.discard(ws)

async def main():
    async with serve(handler, "localhost", 8080, max_size=None):
        await asyncio.get_running_loop().create_future()

asyncio.run(main())

2. Hello world

# hello.py — read one telemetry message from the sim
import asyncio, json
from websockets.asyncio.client import connect

async def main():
    async with connect("ws://localhost:8080/", max_size=None) as ws:
        async for raw in ws:
            msg = json.loads(raw)
            if msg["type"] == "telemetry":
                p = msg["data"]["position"]
                print(f'Hello, drone at {p["latitude"]:.5f}, {p["longitude"]:.5f}, '
                      f'{p["altitude"]:.0f} m above ground')
                return

asyncio.run(main())
pip install websockets
python relay.py      # terminal 1, keep it running
                     # open sim.dremian.com in Chrome
python hello.py      # terminal 2

3. Fly it

# client.py — spawn over Delft, then print telemetry while holding mid-throttle
import asyncio, json
from websockets.asyncio.client import connect

async def main():
    async with connect("ws://localhost:8080/", max_size=None) as ws:
        await ws.send(json.dumps({"type": "command", "command": "setPosition",
                                  "latitude": 52.0116, "longitude": 4.3571, "altitude": 50}))
        await ws.send(json.dumps({"type": "telemetry_rate", "rate": 10}))
        async for raw in ws:
            msg = json.loads(raw)
            if msg["type"] == "telemetry":
                p = msg["data"]["position"]
                print(f'{p["latitude"]:.6f} {p["longitude"]:.6f} {p["altitude"]:.1f} m AGL')
                await ws.send(json.dumps({"type": "control",
                                          "thrust": 0.5, "pitch": 0, "roll": 0, "yaw": 0}))

asyncio.run(main())

Open sim.dremian.com (or a local copy) in Chrome with the relay running, then start the client.

Messages to the simulator

MessageFields
controlthrust 0…1, pitch roll yaw −1…1. Alternatively data: {throttle −1…1, pitch, roll, yaw}. Overrides the keyboard / gamepad while messages keep arriving.
commandcommand plus parameters (flat, or as data: {command, params}). See below.
telemetry_raterate — telemetry messages per second, 1…120 (default 30).
set_settingkey, value — change any setting. Invalid values are rejected.
camera_stream_multidata: {cameraId, active, …} — start / stop a camera stream and configure the world in one message. See below.
get_camera_parametersReplies with camera_parameters: the streamed camera's horizontal FOV, 3×3 camera matrix, zero distortion and frame size.

Commands

commandParametersEffect
setPositionlatitude, longitude, altitude (m above ground); optional velocityNorth/East/Down (m/s), roll pitch yaw (deg)Teleport, move the world origin there and respawn targets around it
followPoselatitude, longitude, altitude, optional roll pitch yawPlace the drone at an externally simulated pose and freeze sim physics (for SITL / replay)
enableControls—Unfreeze physics and accept control input again
disableControls—Ignore control messages
startCameraStreamoptional rate, quality, width, heightStart streaming camera 1
stopCameraStream—Stop streaming
setGimbalPitchpitch (deg, positive = up)Point the camera gimbal

Camera streams

camera_stream_multi runs one stream per cameraId (camera1, camera2), so a wide and a narrow lens can stream at once. Both share the same mount.

FieldMeaning
activetrue to start, false to stop this camera
rate, qualityFrames per second; JPEG quality 0…1 (default 30, 0.7)
width, heightFrame size in pixels (default 640×480, square pixels)
fovHorizontal field of view in degrees
angleCamera tilt in degrees, positive = up (camera 1)
gimbal_enabled, gimbal_pitch_max_up, gimbal_pitch_max_downPitch-stabilised gimbal and its travel limits in degrees (camera 1)
exposure_sSimulated exposure time for motion blur; 0 = sharp

The same message can also set up the world:

FieldMeaning
time_of_dayHour 0…24, or "day", "dusk", "night"
vision_mode"normal" or "thermal"
drone_typeAn aircraft preset
thrust_axis, wing_area_m2Custom airframe: body-frame thrust direction ([0,0,-1] up, [1,0,0] forward) and wing area for lift (0…10 m²)
wind_strength0…10
sensor_noiseThermal sensor noise 0…1
hot_targetRender targets hot in thermal
targetsPer type (drone, plane, vehicle, fennek): count, speed, evasive, height_range [min,max], distance_range [min,max], spawns, lateral_jink

Messages from the simulator

telemetry, sent at the telemetry rate (sensor noise applied per the noise profile):

{"type": "telemetry", "data": {
  "timestamp": 1795452998774,
  "position": {"latitude": 52.0116, "longitude": 4.3571,
               "altitude": 50.2,        // m above ground
               "altitudeMSL": 49.1, "groundHeight": -1.1},
  "orientation": {"roll": 0.4, "pitch": -2.1, "yaw": 87.0},              // deg, yaw −180…180
  "velocity": {"vx": 0.1, "vy": 3.2, "vz": -0.4},                        // m/s NED (north, east, down)
  "rotationRates": {"rollRate": 0.0, "pitchRate": 1.2, "yawRate": 0.0},  // deg/s
  "wind": {"speed": 2.1, "direction": 240, "gusting": false},
  "targets": [{"id": "drone-0", "type": "drone", "latitude": 52.0121, "longitude": 4.3580,
               "altitude": 81.0,        // m MSL
               "agl": 82.1,             // m above spawn origin
               "speed": 15, "heading": 1.57}]                           // m/s, rad (0 = north)
}}

camera_frame_multi, one per active camera per frame. Frames start once terrain has loaded under the drone:

{"type": "camera_frame_multi", "data": {
  "cameraId": "camera1", "format": "jpeg", "width": 640, "height": 480,
  "data": "<base64 JPEG>", "timestamp": 1795452998774,
  "droneState": { /* position, orientation, velocity, rotationRates as in telemetry */ },
  "targets": [{"type": "drone", "heading": 90.0,                         // aerial targets only, deg
               "position": {"latitude": 52.0121, "longitude": 4.3580, "altitude": 82.1}}]
}}

camera_parameters, the reply to get_camera_parameters:

{"type": "camera_parameters", "fov": 60, "aspectRatio": 1.333,
 "camera_matrix": [[fx, 0, cx], [0, fy, cy], [0, 0, 1]],
 "dist_coeffs": [0, 0, 0, 0, 0], "frame_width": 640, "frame_height": 480}

On connecting, the sim sends {"type": "status", "status": "browser-connected"}.

Using with SITL

Use the sim as the world for a real autopilot running in software-in-the-loop. SITL flies the vehicle with its own physics, and the sim follows its pose and renders it. Your ground station flies it like the real aircraft, and your vision code gets camera frames of that flight.

ArduPilot / PX4 SITL ──MAVLink──► sitl_bridge.py ──followPose──► relay ──► sim
        ▲                                                                   │
  ground station                                   camera_frame_multi ◄─────┘
  (Mission Planner, QGroundControl, pymavlink)     → your detection / tracking code
AutopilotSupportedNotes
ArduCopter, ArduPlaneYesStarted with sim_vehicle.py
PX4 (SIH)YesThe built-in SIH physics, no Gazebo needed
Betaflight, INAVNot through SITLTheir SITLs have no physics of their own: they wait for a simulator to feed them sensor data, which the sim does not do yet. Fly the sim's own acro physics with control messages instead.

1. Start the relay and open the sim

Same as for the WebSocket API: python relay.py, then open the sim in Chrome.

2. Start SITL where you want to fly

ArduCopter, from an ArduPilot checkout (use -v ArduPlane for a plane):

Tools/autotest/sim_vehicle.py -v ArduCopter --custom-location=52.0116,4.3571,0,0

Your ground station connects as usual: sim_vehicle.py starts MAVProxy, which sends MAVLink to UDP 14550. The bridge uses SITL's second MAVLink port, TCP 5762, so MAVProxy's stream-rate requests can't slow it down.

PX4 SIH, from a PX4-Autopilot checkout. PX4 only streams to UDP 14550, so split it with MAVProxy:

PX4_HOME_LAT=52.0116 PX4_HOME_LON=4.3571 PX4_HOME_ALT=0 make px4_sitl sihsim_quadx
mavproxy.py --master udpin:0.0.0.0:14550 --out udp:127.0.0.1:14551 --out udp:127.0.0.1:14552 --streamrate=30

Run the bridge with udpin:0.0.0.0:14551 and add a UDP 14552 link in QGroundControl.

3. Run the bridge

# sitl_bridge.py — pip install pymavlink websockets
# SITL flies; the sim follows its pose.
import asyncio, json, math, sys
from pymavlink import mavutil
from websockets.asyncio.client import connect

MAVLINK = sys.argv[1] if len(sys.argv) > 1 else "tcp:127.0.0.1:5762"   # ArduPilot SITL

async def main():
    mav = mavutil.mavlink_connection(MAVLINK)
    mav.wait_heartbeat()
    for msg_id in (mavutil.mavlink.MAVLINK_MSG_ID_GLOBAL_POSITION_INT,
                   mavutil.mavlink.MAVLINK_MSG_ID_ATTITUDE):     # 30 Hz, for smooth motion
        mav.mav.command_long_send(mav.target_system, mav.target_component,
                                  mavutil.mavlink.MAV_CMD_SET_MESSAGE_INTERVAL,
                                  0, msg_id, 1e6 / 30, 0, 0, 0, 0, 0)
    async with connect("ws://localhost:8080/", max_size=None) as ws:
        async for raw in ws:                    # wait until the sim tab is connected
            if json.loads(raw)["type"] == "telemetry":
                break

        async def drain():                      # the sim keeps sending telemetry: read it
            async for _ in ws:
                pass
        asyncio.create_task(drain())

        pos, command = None, "setPosition"      # setPosition once, then followPose
        while True:
            m = await asyncio.to_thread(mav.recv_match, blocking=True,
                                        type=["GLOBAL_POSITION_INT", "ATTITUDE"])
            if m.get_type() == "GLOBAL_POSITION_INT":
                if m.lat:                       # 0 until SITL has a position
                    pos = {"latitude": m.lat / 1e7, "longitude": m.lon / 1e7,
                           "altitude": m.relative_alt / 1000}   # metres above home
            elif pos:
                await ws.send(json.dumps({"type": "command", "command": command, **pos,
                                          "roll": math.degrees(m.roll),
                                          "pitch": math.degrees(m.pitch),
                                          "yaw": math.degrees(m.yaw)}))
                command = "followPose"

asyncio.run(main())
python sitl_bridge.py                          # ArduPilot SITL
python sitl_bridge.py udpin:0.0.0.0:14551      # PX4, through the MAVProxy split above

4. Fly

Arm and take off from your ground station, and the drone in the sim follows. To feed camera frames to your own code, send camera_stream_multi (see Camera streams) and read camera_frame_multi. Each frame carries the target ground truth.

Good to know. The first message, setPosition, moves the sim's world to SITL's home and respawns the targets there. Altitude is SITL's height above home, laid on the sim's terrain at that point. SITL's own ground is flat, so over hills the drone can look too high or sunk in away from home: start somewhere flat. While following, the sim's physics and keyboard are paused. Send {"type": "command", "command": "enableControls"} or reload the page to fly the sim yourself again.

Settings reference

Every setting below can be changed in the panels or with {"type": "set_setting", "key": …, "value": …}.

KeyValuesDefault
dronePresetquadcopter_5inch, quadcopter, quadcopter_10inch, cinewhoop, wingedquadcopter_5inch
dronePayloadMass0…20 kg0
droneWindStrength0…20.5
propWashEnabledtrue / falsetrue
freezeInPlacetrue / falsefalse
timeOfDay0…24 h12
cameraModefpv, chasefpv
cameraVisionModenormal, thermalnormal
droneCameraFOV30…120° horizontal60
cameraFpvPitchDeg−90…90° (positive = tilted down)15
gimbalEnabledtrue / falsefalse
gimbalPitchMaxUp / gimbalPitchMaxDown0…90°40 / 55
noiseProfilenone, low, medium, high, extrememedium
noiseGyroScale, noiseAccelScale, noiseBaroScale, noiseMagScale, noiseGpsScale0…51
sensorNoise0…1 (thermal sensor noise)0
audioVolume0…10
showOSD, showBuildings, showTrees, showRoads, showWater, showTargetstrue / falsetrue

Map data

All map data comes from free public sources, with no API keys:

LayerSource
Terrain elevationAWS Terrain Tiles (Mapzen / Tilezen, CC-BY)
Satellite imageryEsri World Imagery
Buildings, roads, trees, waterOpenStreetMap via the Overpass API, cached in your browser
Place searchOpenStreetMap Nominatim

Troubleshooting

ProblemWhat to do
No buildings or roadsThe public Overpass API is rate-limited or busy (HTTP 429 / 502). Wait a minute and reload; once loaded, an area stays cached.
Low frame rateAdd ?tier=performance or ?renderScale=0.6, or hide trees and water in ⚙ Settings.
Gamepad does nothingPress any button so the browser exposes it, then run Calibrate in the 🎮 panel.
Recording does not startUse Chrome or Edge and allow access to the folder you pick.
API client gets no messagesCheck the relay is on port 8080 and the sim tab is open. The sim reconnects every 3 s.