The simulation can be run by running run_simulation_2D.m.
This file will setup the environment, run both the distance-based formation controller and the distance-aware bearing formation controller, and plot the results as shown in the results section.
The parameters of the simulation can be changed in init.m.
The main parameters of the simulation include the number of agents, the initial position and the desired position and can be set individually.
- The number of agents is set using
num_agents(integer) - The initial position is set using
initial_pos(array [n x 2]) - The desired position is set using
desired_pos(array [n x 2])
The desired position automatically adjusts to the number of agents. The desired position is a regular polygon that has the same number of sides as the number of agents.
