ref: update handler on_complete_trajectory

This commit is contained in:
2025-09-17 21:58:16 +03:00
parent 19a424015f
commit a352464979
2 changed files with 19 additions and 21 deletions

34
main.py
View File

@@ -4,27 +4,21 @@ from visualization import VisualizationManager
from trajectory_drawer import TrajectoryDrawer
from yandex_map import YandexMap
# Создаем менеджер визуализации
# viz_manager = VisualizationManager("Drone Autopilot - Global Map & Detection")
def main():
global trajectoryDrawer
# Создаем симулятор с AutoPilot для обработки изображений
# Передаем менеджер визуализации в автопилот
# simulator = Simulator(RandomPilot(), AutoPilot(viz_manager=viz_manager), viz_manager=viz_manager)
yandexMap = YandexMap()
yandexMap.savePhoto('map.jpg')
yandexMap.destroy()
yandexMap = YandexMap()
yandexMap.savePhoto('map.jpg')
# yandexMap.destroy()
trajectoryDrawer = TrajectoryDrawer('map.jpg')
trajectoryDrawer.on_complete_trajectory = lambda x: print(x)
trajectoryDrawer.show()
trajectoryDrawer = TrajectoryDrawer('map.jpg')
trajectoryDrawer.on_complete_trajectory = onCompleteTrajectory
trajectoryDrawer.show()
# Использование
# if __name__ == "__main__":
# # Укажите путь к вашему изображению
# image_path = "map.jpg" # Замените на путь к вашему изображению
# drawer = TrajectoryDrawer(image_path)
# drawer.show()
# Запускаем симуляцию
# simulator.loop()
def onCompleteTrajectory(points):
print("I've got points. Here these: ")
print(points)
if __name__ == "__main__":
main()