AirGenDrone
class provides a simplified interface to control aerial vehicles in the simulation.
takeoffAsync()
method initiates the takeoff sequence, and the .join()
call ensures that our code waits until the takeoff is complete before proceeding.
simPlanPath
function does the heavy lifting:
draw_path=True
)moveOnPathAsync
method takes several parameters:
points
: List of waypoints defining the pathvelocity
: Desired speed in meters per secondtimeout
: Maximum time to wait for completion (in seconds)drivetrain
: Control mode for the drone’s movement (ForwardOnly
means the drone will always face its direction of travel)yaw_mode
: Controls how the drone’s heading changes during flight.join()
call ensures our code waits until the drone completes the entire path.
ForwardOnly
means the drone orients itself in the direction of travel, like an airplane. Alternatively, MaxDegreeOfFreedom
allows the drone to move in any direction while maintaining its orientation.
is_rate
) determines how to interpret the second parameter. When set to False
, the second parameter is an absolute yaw angle in radians. When set to True
, the second parameter becomes a yaw rate (angular velocity) in radians/second.
moveOnPathAsync
control how closely the drone follows the path. A value of -1
uses the default lookahead distance, while the last parameter (set to 0
) is the adaptive lookahead factor, where zero means non-adaptive.