Skip to content

User interface

Pierre Jaffuer edited this page Jul 3, 2023 · 14 revisions

Overview

The simulator is composed of 5 main components:

  • Menu bar
  • 3D view
  • Inspector / Tests
  • Simulation options
  • Timeline

overview

Menu bar

Rendering performance/quality

The preferences menu has a few options to improve rendering performances:

  • Shadows: toggle shadow rendering
  • Antialiasing: toggle antialiasing (MSAA 4x + FXAA)

preferences

Toggle UI panels

Inactive drones and UI panels visibility can be toggled in the view menu.

view

3D view

The 3D view renders the simulation (drones, base, search team's target position) while providing tools and helpers to navigate and interact with the scene.

3d view

Toolbar

A toolbar is located in the upper-left corner:

  • A selected tool is always bound to the left mouse
  • A tool action is relative to the hovered ground position by the mouse cursor

💡 Right-clicking on the ground will deploy a new drone at the same height as the base deployment height (top of the search team's target beam).

Moving the search team's target position

target

Sets the location of the search team's target position on the ground.

Camera controls

(a)pan  (b)zoom  (c)rotate

Some tools are provided to control the camera:

  • View panning (a)
  • Zoom in/out (b)
  • Rotate camera (c)

Navigation tools are also mapped to keyboard + mouse combos:

  • Middle mouse: rotate view
  • Middle mouse + shift: pan view
  • Scroll wheel: zoom in/out

Visualizations

Visualization options are located in the upper-left corner:

  • Toggle drone vision rendering
  • Toggle top-down/perspective camera
  • Reset camera

visualization and camera 

Drone vision

(a)no drone vision  (b)drone vision

Drone vision rendering disabled on image (a) vs enabled on image (b).

Perspective / top-down camera

💡 Rotating the camera will automatically switch to the perspective camera.

(a)perspective camera  (b)top-down camera

Perspective camera on image (a) vs top-down camera on image (b).

Timeline

The timeline provides controls to pause, resume and reset the simulation. It also records simulation frames: a simulation step which provoked a system change compared to the previous step (ex: drone motion, drone state modification, ...).

Dragging the cursor in the timeline's frame widget allows you to step back/forward the simulation or directly jump back in time.

⚠️ Currently, it's impossible to resume or play forward the simulation from a past frame. The simulation will always start from the last recorded frame.

timeline

⚠️ Due to UI performance reasons, the timeline is disabled while a new frame is recorded as shown here:

timeline updating

Simulation options

simulation options

Here are a few options and actions for the simulator:

  • Kill Inactive: remove inactive drones from the system
  • Graph display: for each drone draw a link to its visible neighbors of lower id
  • Protocol: switches to a different protocol (and tries to auto migrate drone states). See how you can add your own protocol here.
  • Movement time: how much time a drone's movement animation takes.

⚠️ Protocol switching will reset the timeline.

💡 Setting Movement time to 0ms will disable animated motion (max speed).

⚠️ Graph display is currently only accurate for protocol PReturnO2_final.

⚠️ For now, the simulator is locked at a maximum of 60 steps/s because drones use the Godot's physics system to query their neighbors during a fixed physics update.

Inspecting drone states

inspector

The left panel allows you to inspect the state of every drone for each frame of the simulation.

Tests

All tests operations (saving and loading) happens in the specified folder given to the Test directory path.

test directory path

Creation

test saving

The bottom part of the test panel allows you to export the current frame as a test in the Test directory path. A test is written in a readable JSON format, see how you can write tests manually here.

A test will register from the selected frame:

  • The current protocol
  • The search team's target position
  • All drones states

💡 Checking position relative to D will format all coordinates with an expression string parametrized by the drone's maximum movement distance. See write tests manually here.

Loading

To load a test, simply use the right arrow next to its name.

test list

💡 the list can be refreshed by clicking on the button next to the Test directory path.

Exceptions handling

If a protocol raises an exception, the simulation stops and the current simulation step is discarded. An error message (a) is then shown in a popup window alongside the calculated drone state (b) that raised the exception:

(a)error message  (b)failed drone state

💡 This popup doesn't block inputs, which means you can still move the camera around, interact, ...

⚠️ Switching to another protocol or to a previous frame in the timeline will automatically close this popup.