flight_plan_executer package#

Submodules#

flight_plan_executer.fpe module#

class flight_plan_executer.fpe.FlightPlanExecuter#

Bases: Node

The Flight Plan Executer is responsible for reading and parsing the flight plans, comparing the drone’s position and orientation to the info of that flight plan, and figuring out where the drone actually should be and what orientation it should have. It does this by calculating paths based on the input that goes through a map projection, and finding the best way for that drone to change it’s orientation so that it will be able to complete it’s plan.

execute_flight_step()#

The main driver function of the Flight Plan Executer. Checks the current command that is to be executed from the flight plan and executes the corresponding functions to achieve that movement. Finalizes by publishing the updated values to the Position PID.

fly(command)#

Executed when the current flight command is ‘fly’. Forward position direction set to None, as required by the PID. Computes what heading and relative positions the drone should have while flying along a curved or straight line.

hold_position(wait_time, position) tuple[float, float, float]#

Keeps the drone still at one position for a longer period of time

land(command)#

Executed when the current flight command is ‘land’. Sets the wanted point where the drone should be landing. Uses the fpe_math support file to calculates the difference from the drone’s current position and that point, to be sent off to the PID. Also passes on the heading that is set in the flight plan.

takeoff(command)#

Executed when the current flight command is ‘takeoff’. Sets the wanted point where the drone should take off to. Uses the fpe_math support file to calculates the difference from the drone’s current position and that point, to be sent off to the PID. Also passes on the heading that is set in the flight plan. Finally holds the drone still in that point for a certain amount of time.

flight_plan_executer.fpe.main(args=None)#

flight_plan_executer.fpe_math module#

flight_plan_executer.fpe_math.calculate_position_diff(type, current_pos, current_heading, expected_data: dict)#

This calculates the position relative to the drone, often used in flying by waypoints.

flight_plan_executer.fpe_math.calculate_segment_path_diff(type, current_pos, current_heading, start, end, centre, clockwise=False)#

Calculating how the drone shall fly to achieve following a specified segment, either curved or straight In this mode we ignore the y_diff (forward difference) since the drone shall keep flying at a steady pace at all times. We only regulate height, heading and sideways difference to keep the drone in the same spot.

flight_plan_executer.fpe_math.swap_segment(type, current_pos, start, end, centre, clockwise=False) bool#

This function decides whether it is time to swap to the next segment or not. It does this based on the current segment and creates an infinetely invisible line normal to the end-heading at the end point. If the drone crosses this point, it changes to the next segment

flight_plan_executer.map_projection module#

class flight_plan_executer.map_projection.MapProjection#

Bases: object

This class uses Plate Caree map projection formulas to convert spherical coordinates to planar coordinates, as well as convert the global coordinates to our own local coordinate system.

get_xy(lon, lat) list[float, float]#

Gets projected coordinates in the xy plane.

Module contents#