A complete environment for executing, visualizing and generating data of simulated flights of an Unmanned Aerial Vehicle (UAV) chasing a ground target.
SimpleSim
is originally developed by the author alongside with their participation in the AIIA Laboratory
of the Aristotle University of Thessaloniki (AUTh). The simulator is written in Python 3.9
programming language, making use of
the numpy
and matplotlib
libraries. Fundamental math and physics equations are used behind the scenes, in combination with a pinch of artistic effort.
In order to use SimpleSim
, you need to clone the current repository and run the following code in the project directory:
from Simulator import Simulator
simulator = Simulator()
run_data = simulator.get_run_data()
simulator.visualize()
The SimpleSim
environment composes of a UAV and a ground target. More details for each component are provided in the following sections
The UAV is an abstraction of a flying object in the 3-dimensional space. It is equiped with a camera that surveils the ground, under a
specific angle that is formed with respect to the horizontal axis. The camera field of view (FOV) has a specific radius, shaping a circle
of view on the ground. Both the angle and the radius are totally customizable at creation time of the Simulator
object.
The ground target is an abstraction of an object moving on the ground (z=0
) in the 3-dimensional space. Its trajectory is unrelated to the UAV's
movement. Its route in the 3D space is totally customizable.
SimpleSim
provides a real-time, animated plot of the simulated run. The animated plot shows the UAV and target's route, as well as the UAV's
trace (shadow) on the ground and the UAV's camera field of view on the ground. In order to visualize a randomly generated run, you can use the
following code:
Simulator().visualize()
The above concise, yet powerful, line of code yields a new window with an real-time animated plot of the above elements and an explanatory legend.
Last but not least, SimpleSim
provides an in-build method for accessing run data for both the UAV and the ground target. The data are structured
under a specially designed, two-leveled dictionary which can be accessed using the following code snippet:
run_data_dict = Simulator().get_run_data()
Inside run_data_dict
one can find the following hierarchy of stored data:
-
UAV
route
(ndarray
): the exact coordinates (x, y, z) at every step of the UAV flightmin_height
(float
): the minimum height the UAV reached during flightmax_height
(float
): the maximum height the UAV reached during flightground_trace_route
(ndarray
): the exact coordinates (x, y, z) of the ground trace of the UAV at every step of its flightcamera_FOV_center
(ndarray
): the exact coordinates (x, y, z) of the UAV camera field of view center at every step of its flightcamera_FOV_radius
(float
): the radius of the UAV camera field of view centercamera_FOV_angle_degrees
(float
): the angle (in degrees) that the UAV camera vision shapes with the horizontal axiscamera_target_miss_hits
(ndarray
): contains number_of_steps boolean values (True -> target inside FOV at step i, False -> target outside FOV at step 1)camera_target_euclidean_distance_form_FOV_center
(ndarray
): contains number_of_steps float values that represent the Euclidean distance between the target and the camera field of view center at every stepcamera_target_manhattan_distance_form_FOV_center
(ndarray
): contains number_of_steps float values that represent the Manhattan distance between the target and the camera field of view center at every step
-
target
route
(ndarray
): the exact coordinates (x, y, z) at every step of the target movement
Using SimpleSim
as the vehicle to run neural networks is an intriguiung idea that the author intends to implement, under the
guidance of their AIIA Laboratory Supervisor.