Skip to content

Commit

Permalink
Simplify mavsdk imports #16
Browse files Browse the repository at this point in the history
  • Loading branch information
RexBerry committed Oct 12, 2022
1 parent 2c77262 commit bef139c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions flight/avoidance/obstacle_avoidance.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from dataclasses import dataclass

from mavsdk import System
from mavsdk.telemetry import Position as MavsdkPosition
import mavsdk
import mavsdk.telemetry

import utm

Expand Down Expand Up @@ -69,7 +69,7 @@ def from_dict(cls, position_data: InputPoint) -> "Point":
)

@classmethod
def from_mavsdk_position(cls, position: MavsdkPosition) -> "Point":
def from_mavsdk_position(cls, position: mavsdk.telemetry.Position) -> "Point":
"""
Factory method accepting a mavsdk.telemetry.Position object
Expand All @@ -96,7 +96,7 @@ def from_mavsdk_position(cls, position: MavsdkPosition) -> "Point":


async def calculate_avoidance_path(
drone: System,
drone: mavsdk.System,
obstacle_data: list[InputPoint],
avoidance_radius: float = 10.0,
) -> list[Point]:
Expand All @@ -105,7 +105,7 @@ async def calculate_avoidance_path(
Parameters
----------
drone : System
drone : mavsdk.System
The drone for which the path will be calculated for
obstacle_data : list[InputPoint]
Previously known positions
Expand All @@ -119,7 +119,7 @@ async def calculate_avoidance_path(
"""

# Get position of drone
raw_drone_position: MavsdkPosition
raw_drone_position: mavsdk.telemetry.Position
async for position in drone.telemetry.position():
raw_drone_position = position
break
Expand Down

0 comments on commit bef139c

Please sign in to comment.