Commands
- class commands.Command(related_task: int, id: int, command_type: str, start_time: int, command_status: str)[source]
Bases:
ABCAbstract base class for all drone command types.
- Parameters:
related_task (int) – ID of parent task
id (int) – Unique command identifier
command_type (str) – Command category (e.g., ‘NAVIGATION’, ‘CAMERA’)
start_time (int) – Unix timestamp of command initiation
command_status (str) – Current execution state (‘Pending’|’Running’|’Completed’)
Note
All concrete commands must implement execute() and result() methods
Bases:
CommandTake off from ground/hand command implementation.
- Parameters:
params – Flight parameters in order: [0] minimum_pitch (float): Minimum pitch angle during takeoff (degrees) [1] yaw_angle (float): Initial heading (degrees true) [2] latitude (float): Takeoff latitude (decimal degrees) [3] longitude (float): Takeoff longitude (decimal degrees)
Simulate takeoff procedure with 10s delay.
Return takeoff confirmation with position.
- Returns:
(command_id, status, lat, lon)
Bases:
CommandLand at specified location command implementation.
- Parameters:
params – Landing parameters in order: [0] minimum_altitude (float): Minimum safe altitude (meters) [1] precision_land_mode (int): Landing accuracy mode (0-3) [2] yaw_angle (float): Approach heading (degrees) [3] latitude (float): Target latitude (decimal degrees) [4] longitude (float): Target longitude (decimal degrees) [5] landing_altitude (float): Touchdown altitude (meters)
Simulate landing procedure with 10s delay.
Return landing confirmation with position.
- Returns:
(command_id, status, lat, lon)
Bases:
CommandNavigate to waypoint command implementation.
- Parameters:
params – Navigation parameters in order: [0] hold_time (int): Loiter time at waypoint (seconds) [1] acceptancer_radius (float): Waypoint acceptance radius (meters) [2] pass_waypoint (bool): Continue through waypoint [3] yaw_angle (float): Target heading (degrees) [4] latitude (float): Waypoint latitude (decimal degrees) [5] longitude (float): Waypoint longitude (decimal degrees) [6] relative_altitude (float): Altitude relative to takeoff (meters)
Simulate waypoint navigation with 10s delay.
Return waypoint confirmation with position.
- Returns:
(command_id, status, lat, lon)
Bases:
CommandReturn to home position command implementation.
- Parameters:
params – Return parameters: [0] landing_permission (bool): Allow automatic landing
Simulate return home with 10s delay.
Return home position confirmation.
- Returns:
(command_id, status, None, None)
- class commands.Camera_Image(related_task, id, command_type, start_time, command_status, params)[source]
Bases:
CommandImage capture command implementation.
- Parameters:
params – Camera parameters in order: [0] yaw_angle (float): Camera heading (degrees) [1] pitch_angle (float): Camera tilt angle (degrees) [2] photo_count (int): Number of images to capture [3] time_interval (float): Time between captures (seconds)
- class commands.Analyze_Image(related_task, id, command_type, start_time, command_status, params)[source]
Bases:
CommandImage analysis command implementation.
- Parameters:
params – Analysis parameters in order: [0] product (str): Target detection product [1] latitude (float): Image location latitude [2] longitude (float): Image location longitude
- class commands.Spray(related_task, id, command_type, start_time, command_status, params)[source]
Bases:
CommandSpray treatment command implementation.
- Parameters:
params – Spray parameters in order: [0] product (str): Treatment product name [1] product_amount (float): Quantity to dispense (liters) [2] latitude (float): Application latitude [3] longitude (float): Application longitude