from pymavlink import mavutil import math import time from rich.console import Console…
- User
from pymavlink import mavutil import math import time from rich.console import Console from rich.text import Text from drone import Drone import sys
cs = Console() INFO = Text("INFO") INFO.stylize("bold magenta") ACTION = Text("ACTION") ACTION.stylize("bold green") ABORT = Text("ABORT") ABORT.stylize("bold RED") ENTER = Text("ENTER") ENTER.stylize("bold RED") ALERT = Text("ALERT") ALERT.stylize("bold RED")
cs.print("", ENTER, " the drone 1 ID : ", end = "") kk1 = int(input()) cs.print("", ENTER, " the drone 2 ID : ", end = "") kk2 = int(input()) cs.print("**", ENTER, " the drone 3 ID : ", end = "") kk3 = int(input())
cs.print("", ENTER, " the Altitude and Speed of the RTL respectively for drone 1 (rA, rS) : ", end = "") r1A, r1S = map(int, input().split(",")) cs.print("", ENTER, " the Altitude and Speed of the RTL respectively for drone 2 (rA, rS) : ", end = "") r2A, r2S = map(int, input().split(",")) cs.print("**", ENTER, " the Altitude and Speed of the RTL respectively for drone 3 (rA, rS) : ", end = "") r3A, r3S = map(int, input().split(","))
cs.print("", ENTER, " the take off height for drone 1 : ", end = "") take1 = int(input()) cs.print("", ENTER, " the take off height for drone 2 : ", end = "") take2 = int(input()) cs.print("**", ENTER, " the take off height for drone 3 : ", end = "") take3 = int(input())
cs.print("", ENTER, " the waypoint mission speed for drone 1: ", end = "") speed1=int(input()) cs.print("", ENTER, " the waypoint mission speed for drone 2: ", end = "") speed2=int(input()) cs.print("**", ENTER, " the waypoint mission speed for drone 3: ", end = "") speed3=int(input())
waypoints = [ (-35.3628588,149.1648891, 12), (-35.3626331, 149.1653596, 12), ]
waypoints= [
(-35.3629705,149.1649417,12),
(-35.3628578,149.1651791,12),
]
for setting up the connection
cs.print("", INFO, ": START Connection") the_connection = mavutil.mavlink_connection('udpin:localhost:14551', baud=115200) the_connection.wait_heartbeat() cs.print("", ACTION, " : telemetry connection DONE")
for Connecting the drone 1
cs.print("", INFO, ": Connecting to Drone 1") drone1 = Drone(kk1, the_connection) cs.print("", ACTION, ": Drone 1 is Connected")
for connecting the drone 2
cs.print("", INFO, ": Connecting to Drone 2") drone2 = Drone(kk2, the_connection) cs.print("", ACTION, ": Drone 2 is Connected")
for connecting the drone 2
cs.print("", INFO, ": Connecting to Drone 3") drone3 = Drone(kk3, the_connection) cs.print("", ACTION, ": Drone 3 is Connected")
time.sleep(5)
rtl_params = { kk1: {'RTL_ALT': r1A * 100, 'RTL_SPEED': r1S * 100}, kk2: {'RTL_ALT': r2A * 100, 'RTL_SPEED': r2S * 100}, kk3: {'RTL_ALT': r3A * 100, 'RTL_SPEED': r3S * 100} }
- Assistant