Skip to content

Commit

Permalink
Switch to relative imports #16
Browse files Browse the repository at this point in the history
  • Loading branch information
RexBerry committed Feb 1, 2023
1 parent d501477 commit a1dcebf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 26 deletions.
5 changes: 5 additions & 0 deletions flight/avoidance/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
Import relevant functions and classes from this module
"""

from .obstacle_avoidance import calculate_avoidance_velocity, Point, InputPoint, Velocity
25 changes: 2 additions & 23 deletions flight/avoidance/obstacle_avoidance.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import mavsdk
import mavsdk.telemetry

from point import Point, InputPoint
from velocity import Velocity
from .point import Point, InputPoint
from .velocity import Velocity


async def calculate_avoidance_velocity(
Expand Down Expand Up @@ -146,24 +146,3 @@ async def calculate_avoidance_velocity(
avoidance_velocity: Velocity = drone_velocity + correction_velocity

return avoidance_velocity


def main() -> None:
"""
Tells the user how to test this module
"""

# TODO: Change if we add another test Python script for the second drone
print("Run")
print()
print("\t./opensitlmultiple.sh")
print()
print("and")
print()
print("\tpython3 ./test.py")
print()
print("to test this module.")


if __name__ == "__main__":
main()
1 change: 0 additions & 1 deletion flight/avoidance/point.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from dataclasses import dataclass

import mavsdk.telemetry

import utm

# Input points are dicts with time and UTM coordinate data
Expand Down
2 changes: 0 additions & 2 deletions flight/avoidance/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ async def run() -> None:
"""

drone: mavsdk.System = mavsdk.System()
print("Will connect")
await drone.connect(system_address="udp://:14540")
print("Connected")

status_text_task: asyncio.Task[None] = asyncio.ensure_future(print_status_text(drone))

Expand Down

0 comments on commit a1dcebf

Please sign in to comment.