A method of flying an unmanned aerial vehicle, the method including steps implemented using a controller forming part of the unmanned aerial vehicle, said steps comprising: storing a plurality of flight termination points; defining a plurality of emergency conditions (110, 120, 130, 140, 150); associating each emergency condition (110, 120, 130, 140, 150) with a priority level; associating each emergency condition (110, 120, 130, 140, 150) with an objective (115, 125, 135, 145, 155); sensing a plurality of operating parameters of the unmanned aerial vehicle to detect whether one of the plurality of emergency conditions (110, 120, 130, 140, 150) exists; when one or more emergency condition(110, 120, 130, 140, 150) is detected: identifying an available subset of the plurality of flight termination points at which a landing is possible; generating a trajectory for the detected emergency condition (110, 120, 130, 140, 150) having a highest associated priority level, wherein the trajectory is generated in accordance with the objective (115, 125, 135, 145, 155) associated with the emergency condition (110, 120, 130, 140, 150) that has the highest associated priority level wherein the step of generating a trajectory involves generating a trajectory terminating at one of the flight termination points of the available subset; and instructing the unmanned aerial vehicle to follow the generated trajectory. storing a plurality of flight termination points; defining a plurality of emergency conditions (110, 120, 130, 140, 150); associating each emergency condition (110, 120, 130, 140, 150) with a priority level; associating each emergency condition (110, 120, 130, 140, 150) with an objective (115, 125, 135, 145, 155); sensing a plurality of operating parameters of the unmanned aerial vehicle to detect whether one of the plurality of emergency conditions (110, 120, 130, 140, 150) exists; when one or more emergency condition(110, 120, 130, 140, 150) is detected: identifying an available subset of the plurality of flight termination points at which a landing is possible; generating a trajectory for the detected emergency condition (110, 120, 130, 140, 150) having a highest associated priority level, wherein the trajectory is generated in accordance with the objective (115, 125, 135, 145, 155) associated with the emergency condition (110, 120, 130, 140, 150) that has the highest associated priority level wherein the step of generating a trajectory involves generating a trajectory terminating at one of the flight termination points of the available subset; and instructing the unmanned aerial vehicle to follow the generated trajectory. identifying an available subset of the plurality of flight termination points at which a landing is possible; generating a trajectory for the detected emergency condition (110, 120, 130, 140, 150) having a highest associated priority level, wherein the trajectory is generated in accordance with the objective (115, 125, 135, 145, 155) associated with the emergency condition (110, 120, 130, 140, 150) that has the highest associated priority level wherein the step of generating a trajectory involves generating a trajectory terminating at one of the flight termination points of the available subset; and instructing the unmanned aerial vehicle to follow the generated trajectory.