diff --git a/flight/avoidance/__init__.py b/flight/avoidance/__init__.py new file mode 100644 index 00000000..5777d760 --- /dev/null +++ b/flight/avoidance/__init__.py @@ -0,0 +1,5 @@ +""" +Import relevant functions and classes from this module +""" + +from .obstacle_avoidance import calculate_avoidance_velocity, Point, InputPoint, Velocity diff --git a/flight/avoidance/obstacle_avoidance.py b/flight/avoidance/obstacle_avoidance.py index f13b88f7..165e8863 100644 --- a/flight/avoidance/obstacle_avoidance.py +++ b/flight/avoidance/obstacle_avoidance.py @@ -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( @@ -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() diff --git a/flight/avoidance/point.py b/flight/avoidance/point.py index b5a87b8c..429477b8 100644 --- a/flight/avoidance/point.py +++ b/flight/avoidance/point.py @@ -6,7 +6,6 @@ from dataclasses import dataclass import mavsdk.telemetry - import utm # Input points are dicts with time and UTM coordinate data diff --git a/flight/avoidance/test.py b/flight/avoidance/test.py index dc53c894..7873738e 100644 --- a/flight/avoidance/test.py +++ b/flight/avoidance/test.py @@ -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))