Skip to content

Commit

Permalink
Add Point class #16
Browse files Browse the repository at this point in the history
  • Loading branch information
RexBerry committed Sep 27, 2022
1 parent b33c0c7 commit 7cfdf75
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions flight/avoidance/obstacle_avoidance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,42 @@
Contains a moving obstacle avoidance function
"""

from dataclasses import dataclass
from typing import Optional

from mavsdk import System
from mavsdk.telemetry import Position

# TODO: Update types to the correct types # pylint: disable=fixme
# TODO: Update type to the correct type # pylint: disable=fixme
Obstacle = dict[str, float]
Coordinate = dict[str, float]


@dataclass
class Point:
"""
A point in 3D space
Attributes
----------
utm_x : float
The x-coordinate of this point in the UTM coordinate system
utm_y : float
The y-coordinate of this point in the UTM coordinate system
utm_zone_number : int
The UTM zone this point is in
utm_zone_letter : str
The letter of the UTM latitude band
"""

utm_x: float
utm_y: float
utm_zone_number: int
utm_zone_letter: str


async def calculate_avoidance_path(
drone: System, obstacle: Obstacle, position: Optional[Position]
) -> list[Coordinate]:
) -> list[Point]:
"""
Given a drone and a moving obstacle, calculates a path avoiding the obstacle
Expand Down

0 comments on commit 7cfdf75

Please sign in to comment.