Skip to content
UAVProg
Languageen
Blocks

Blocks

Beyond the twelve

Simulator equipment blocks follow the connected aircraft's live inventory.

The twelve APEX blocks are the starter set, not the whole simulator toolbox. In a connected simulator session, the editor also reads the installed equipment and offers categories for it.

What appears

CategoryWhen it appearsWhat it offers
Simulator flightA valid live inventory is connectedTake off to a height, go to north/east/altitude, land, and wait for completion
SensorsA sensor of that type is installedRead a field, test readiness, wait for readiness
Hook and cargoA hook is installedLower, raise, grab, release, test cargo attached
Installed lightsAt least one light is installedSelect a light, switch it, set brightness

Sensor types may include temperature, gas, rangefinder, lidar, light, sound, flame, touch, barometer, battery, IMU and CO₂. The inventory for the actual session decides which devices and fields exist. Do not assume every mission includes every sensor.

Read a device, not an assumed number

Choose the device ID and field from the block dropdowns. Units matter: a distance field in millimetres is not metres, and a pressure field is not altitude.

Generated by Blocks
sim.wait_sensor('sensor-id')
print(sim.read('sensor-id', 'temperature_c'))

These IDs are placeholders: choose the installed device in the editor. Sensors may need warm-up. A missing, stale or invalid sample raises an error rather than becoming numeric zero. A stored reading is a snapshot; read again inside a loop.

Simulator navigation

The north/east/altitude block uses absolute world coordinates in metres and positive altitude upward. The extension converts that altitude into the downward-positive NED coordinate used internally.

It waits for arrival and low speed near the target. It does not plan around obstacles. Wind or an unreachable target can cause a timeout, so choose clear paths and suitable margins.

When equipment changes

The editor refreshes the categories from the simulator. A block referring to a removed or disconnected device is marked, and execution can be refused. Reconnect or replace the marked device blocks; an absent category is not evidence that the program is valid.

The hardware boundary

sim.* equipment blocks extend the simulator, not the real-drone API. APEX photo, recording and headless commands still only print a message in the simulator adapter. An installed light controlled with sim.light is a separate capability from a generic LED block for another aircraft.

Choose an action and reading the session actually supplies when writing a mission. An acknowledgement alone does not prove that a physical action happened.

See What the simulator models and Block reference.