Skip to content

Commit cc65bfe

Browse files
authored
3.1 (#90)
* Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update mavlink_control.py * Update waypoints.py * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update mavlink_control.py * Update default_layout.html * Update waypoints.js * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update mavlink_control.py * Update waypoints.js * Update waypoints.js * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.js * Update waypoints.js * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update mavlink_control.py * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update default_layout.html * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.js * Update waypoints.js * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update mavlink_control.py * Update logs.py * Update logs.py * Update logs.py * Update logs.py * Update logs.py * Update logs.py * Update logs.py * Update logs.py * Update mavlink_control.py * Update waypoints.js * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update default_layout.html * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Delete flight_data_collect/drone_communication/points_archived.py * Update autocomplete.py * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update mavlink_control.py * Update mavlink_control.py * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update mavlink_control.py * Update waypoints.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update default_layout.html * Update points.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update waypoints.py * Update sanitize_text.py * Update waypoints.py * Update default_layout.html * Update waypoints.css * Update waypoints.css * Update waypoints.css * Update waypoints.css * Update waypoints.js * Update waypoints.js * Update default_layout.html * Update default_layout.html * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Waypoints (#88) * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Delete flightmonitor/templates/mapbox_example.html * Update default_layout.html * Edit common.js. * Edit common.js. * Update common.js * Update common.js * Update common.js * Edit common.js. * Edit common.js. * Edit common.js. * Edit common.js. * Edit common.js. * Edit waypoints.py. * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Edit waypoints.py. * Edit waypoints.py. * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update mavlink_control.py * Update waypoints.py * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update mavlink_control.py * Update default_layout.html * Update waypoints.js * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update mavlink_control.py * Update waypoints.js * Update waypoints.js * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.js * Update waypoints.js * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update mavlink_control.py * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update default_layout.html * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.js * Update waypoints.js * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update mavlink_control.py * Update logs.py * Update logs.py * Update logs.py * Update logs.py * Update logs.py * Update logs.py * Update logs.py * Update logs.py * Update mavlink_control.py * Update waypoints.js * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update default_layout.html * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Delete flight_data_collect/drone_communication/points_archived.py * Update autocomplete.py * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update mavlink_control.py * Update mavlink_control.py * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update mavlink_control.py * Update waypoints.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update default_layout.html * Update points.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update mavlink_control.py * Update mavlink_control.py * Update mavlink_control.py * Update waypoints.py * Update sanitize_text.py * Update waypoints.py * Update default_layout.html * Update waypoints.css * Update waypoints.css * Update waypoints.css * Update waypoints.css * Update waypoints.js * Update waypoints.js * Update default_layout.html * Update default_layout.html * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update waypoints.py * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update default_layout.html * Update default_layout.html * Update default_layout.html * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update default_layout.html * Update default_layout.html * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js * Update waypoints.js
1 parent 4394267 commit cc65bfe

18 files changed

Lines changed: 1278 additions & 23 deletions

File tree

.env

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
GOOGLE_MAP_API_KEY=smt
3+
4+
5+

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@ db.sqlite3
2929
.idea
3030
*.pyc
3131
__pycache__/
32-
static/*
32+
static/*
33+
.env
34+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import requests
2+
from django.conf import settings
3+
from django.http import JsonResponse
4+
5+
def autocomplete_view(query, lat=None, lon=None):
6+
params = {
7+
'input': query,
8+
'key': settings.GOOGLE_MAP_API_KEY,
9+
}
10+
if not (lat and lon):
11+
# UC Irvine GPS
12+
#https://latitude.to/articles-by-country/us/united-states/1122/university-of-california-irvine
13+
lat = 33.6405407712
14+
lon = -117.838914978
15+
params['location'] = f'{lat},{lon}' # This biases the autocomplete predictions to the specified location
16+
17+
#response = requests.get(f'https://maps.googleapis.com/maps/api/place/autocomplete/json?input={query}&key={settings.GOOGLE_MAP_API_KEY}')
18+
response = requests.get('https://maps.googleapis.com/maps/api/place/autocomplete/json', params=params)
19+
20+
print(response.text if response.status_code == 200 else None) # Not all eq, Not pass
21+
22+
#return JsonResponse(response.json()) # TypeError: Object of type 'JsonResponse' is not JSON serializable
23+
return response.json()
24+
25+
def test_autocomplete_view():
26+
print("test_autocomplete_view")
27+
query = "1 Shields Ave., Davis, CA 95616"
28+
places = autocomplete_view(query)
29+
print(places, "???")
30+
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
from pymavlink import mavutil
2+
import time
3+
import socket
4+
5+
6+
def find_vacant_channel(master):
7+
# Retrieve RC_CHANNELS message
8+
msg = master.recv_match(type='RC_CHANNELS', blocking=True)
9+
10+
# Iterate through RC channel values to find vacant channels
11+
vacant_channels = []
12+
for i in range(1, msg.chancount + 1):
13+
# Check if the channel value is unassigned or unused
14+
if msg['chan{}_raw'.format(i)] == 0:
15+
vacant_channels.append(i)
16+
return i
17+
18+
#print("Vacant channels: ", vacant_channels)
19+
20+
#if not len(vacant_channels):
21+
return -1
22+
23+
def find_switch_threshold(master, channel_number):
24+
# Monitor the state of the switch to determine the threshold value
25+
initial_state = None
26+
27+
while initial_state is None:
28+
msg = master.recv_match(type='RC_CHANNELS', blocking=True)
29+
switch_value = getattr(msg, "chan{}_raw".format(channel_number), None)
30+
31+
if switch_value is not None:
32+
initial_state = switch_value
33+
print("Initial switch value:", initial_state)
34+
35+
# Determine the threshold value based on the initial state
36+
threshold_value = initial_state - 100 # Adjust the threshold offset as needed
37+
print("Threshold value:", threshold_value)
38+
39+
return threshold_value
40+
41+
def toggle_avoidance_system(master, channel_number, threshold_value):
42+
# Set the RCx_OPTION parameter to 40 (replace x with the vacant channel number)
43+
rc_option_param = "RC{}_OPTION".format(channel_number)
44+
master.param_set(rc_option_param, 40)
45+
46+
# Monitor the state of the switch
47+
while True:
48+
msg = master.recv_match(type='RC_CHANNELS', blocking=True)
49+
switch_value = getattr(msg, "chan{}_raw".format(channel_number), None)
50+
51+
if switch_value is not None and switch_value > threshold_value:
52+
# Activate the avoidance system
53+
print("Avoidance system activated")
54+
# Your code to activate the avoidance system goes here
55+
else:
56+
# Deactivate the avoidance system
57+
print("Avoidance system deactivated")
58+
# Your code to deactivate the avoidance system goes here
59+
60+
def format_param_message(param_name, param_value, success):
61+
if success:
62+
return f"Parameter {param_name} was successfully set to {param_value}"
63+
else:
64+
return f"Failed to set parameter {param_name}"
65+
66+
def print_param(mav, param_name, param_value):
67+
# Request the current value of the parameter
68+
mav.param_fetch_one(param_name)
69+
70+
# Wait for the parameter value to be received
71+
while mav.param(param_name) is None:
72+
msg = mav.recv_match(type='PARAM_VALUE', blocking=True)
73+
74+
# Check if the parameter value matches the value we tried to set
75+
success = mav.param(param_name) == param_value
76+
print(format_param_message(param_name, param_value, success))
77+
78+
def config_lidar(): #or other proximity sensors.
79+
print("D1")
80+
# Connect to the autopilot
81+
#master = mavutil.mavlink_connection('udpout:localhost:14550')
82+
SERVER_IP = socket.gethostbyname(socket.gethostname())
83+
connect_address = 14550
84+
master = mavutil.mavlink_connection(SERVER_IP + ':' + str(connect_address))
85+
print(str(SERVER_IP)+" "+str(connect_address)) #dude it's private ip...
86+
87+
while(master.target_system == 0):
88+
print("Checking Heartbeat")
89+
90+
#the_connection.wait_heartbeat()
91+
msg = master.wait_heartbeat(timeout=6)
92+
if msg:
93+
print(msg)
94+
break
95+
print("D2")
96+
97+
# Set AVOID_ENABLE to use all sources of barrier information
98+
master.mav.param_set_send(
99+
target_system=1,
100+
target_component=1,
101+
param_id=b"AVOID_ENABLE",
102+
param_value=7,
103+
param_type=mavutil.mavlink.MAV_PARAM_TYPE_UINT8
104+
)
105+
106+
#print("Message Read" + str(master.recv_match(type="COMMAND_ACK", blocking =True))
107+
print_param(master, "AVOID_ENABLE", 7)
108+
109+
# Set PRX1_TYPE to enable using a 360-degree Lidar as a "proximity sensor"
110+
master.mav.param_set_send(
111+
target_system=1,
112+
target_component=1,
113+
param_id=b"PRX1_TYPE",
114+
param_value=15,
115+
param_type=mavutil.mavlink.MAV_PARAM_TYPE_UINT8
116+
)
117+
118+
print_param(master, "PRX1_TYPE", 15)
119+
120+
# Set AVOID_MARGIN to control the distance from the barrier
121+
master.mav.param_set_send(
122+
target_system=1,
123+
target_component=1,
124+
param_id=b"AVOID_MARGIN",
125+
param_value=5,
126+
param_type=mavutil.mavlink.MAV_PARAM_TYPE_REAL32
127+
)
128+
129+
print_param(master, "AVOID_MARGIN", 5)
130+
131+
# Set AVOID_BEHAVE to control avoidance behavior
132+
master.mav.param_set_send(
133+
target_system=1,
134+
target_component=1,
135+
param_id=b"AVOID_BEHAVE",
136+
param_value=1,
137+
param_type=mavutil.mavlink.MAV_PARAM_TYPE_UINT8
138+
)
139+
140+
print_param(master, "AVOID_BEHAVE", 1)
141+
142+
print("D3")
143+
# Loop and listen for LIDAR messages
144+
for _ in range(10):
145+
msg = master.recv_match(type='DISTANCE_SENSOR', blocking=True)
146+
formatted_distance = f"LIDAR distance: {msg.current_distance} meters"
147+
print(formatted_distance)
148+
#time.sleep(1) # Sleep for 1 second
149+
#if time.time()
150+
151+
print("lidar data done")
152+
153+
#No avoidance if switch_value is low. Optional.
154+
#TODO.
155+
#https://ardupilot.org/copter/docs/common-simple-object-avoidance.html
156+
return
157+
vacant_channel = find_vacant_channel(master)
158+
if vacant_channel == -1:
159+
return
160+
161+
switch_threshold = find_switch_threshold(master, vacant_channel)
162+
163+
# Set RCx_OPTION to 40
164+
toggle_avoidance_system(master, vacant_channel, switch_threshold)
165+
166+
#Refs.
167+
#https://ardupilot.org/copter/docs/common-simple-object-avoidance.html
168+
#online webs.
169+
170+
#This is to send fake distance data (note to use rand()) from gcs to the drone. But could config. by sitl instead.
171+
#https://www.ardusub.com/developers/pymavlink.html
172+
#https://github.com/ArduPilot/ardupilot/blob/master/Tools/autotest/arducopter.py#L6881
173+
174+
#could send data the other way. but may require concurrency.
175+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import logging
2+
3+
def log(*args, **kwargs): # logs.log(1, 2, 3, a=4, b=5)
4+
5+
s = ""
6+
for item in args:
7+
s += str(item) + ", "
8+
for item in kwargs.items():
9+
s += str(item) + ", "
10+
11+
logging.basicConfig(format='%(name)s - %(levelname)s - %(message)s', level=logging.INFO)
12+
13+
logger = logging.getLogger(__name__)
14+
15+
logger.info(s)
16+

flight_data_collect/drone_communication/mavlink_control.py

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
from pymavlink import mavutil, mavwp
22
import socket
3-
import json
3+
import json
4+
import urllib.parse
45
from flight_data_collect.drone_communication.mavlink_constants import MAVLINK_MSG_ID_SET_MODE
56
from flightmonitor.consumers import send_message_to_clients
67

7-
SERVER_IP = socket.gethostbyname(socket.gethostname())
8+
from . import logs, waypoints, autocomplete, lidar_data
9+
810

11+
SERVER_IP = socket.gethostbyname(socket.gethostname())
912

1013
def get_ack_msg(connect_address: int, mavlink, message_type, should_send=False, command_name=None):
1114
ack_msg = mavlink.recv_match(type=message_type, timeout=6, blocking=True)
@@ -114,6 +117,52 @@ def set_arm(connect_address: int, is_disarm=False):
114117

115118

116119
def fly_to_point(connect_address: int, lat, lon, alt):
120+
try:
121+
if not alt:
122+
alt = 10
123+
addr = ",".join(list(map(str, [lat,lon,alt])))
124+
logs.log(addr) #"1,2,3"
125+
addrList = [addr, addr] #["1,2,3", "1,2,3"]
126+
msg = waypoints.add(connect_address, addrList)
127+
if not msg:
128+
msg = "None"
129+
print(msg)
130+
return str(msg)
131+
except Exception as e:
132+
print(e)
133+
return str({'ERROR': str(e), 'droneid': connect_address})
134+
135+
136+
#didn't work, either. (By Team 3.)
137+
"""
138+
# Set mode GUIDED
139+
# Arm the drone
140+
try:
141+
mavlink = mavutil.mavlink_connection(SERVER_IP + ':' + str(connect_address))
142+
msg = mavlink.wait_heartbeat(timeout=6)
143+
if not msg:
144+
return {'ERROR': f'No heartbeat from {connect_address} (timeout 6s)', 'droneid': connect_address}
145+
146+
# Specify the target position
147+
mavlink.mav.mission_item_send(mavlink.target_system, mavlink.target_component,
148+
0, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT,
149+
mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 2, 0,
150+
0, 0, 0, 0,
151+
lat, lon, alt)
152+
153+
ack_msg = get_ack_msg(connect_address, mavlink, 'MISSION_ACK')
154+
if ack_msg:
155+
return ack_msg
156+
else:
157+
return {'ERROR': 'No ack_msg received (timeout 6s).', 'droneid': connect_address}
158+
except Exception as e:
159+
print(e)
160+
return {'ERROR': str(e), 'droneid': connect_address}
161+
"""
162+
163+
164+
#didn't work. (By Team 2.)
165+
"""
117166
try:
118167
mavlink = mavutil.mavlink_connection(SERVER_IP + ':' + str(connect_address))
119168
msg = mavlink.wait_heartbeat(timeout=6)
@@ -132,3 +181,48 @@ def fly_to_point(connect_address: int, lat, lon, alt):
132181
except Exception as e:
133182
print(e)
134183
return {'ERROR': str(e), 'droneid': connect_address}
184+
"""
185+
186+
187+
def update_waypoints(connect_address: int, addrs: str):
188+
print("wp") #reached.
189+
190+
#Could use SQL or JS.
191+
#Used JS for now.
192+
193+
try:
194+
#addrs = "a1%b1|a2%b2"
195+
addrList = [] #[addr1, addr2, addr3]
196+
addrList1 = addrs.split("|") #["a1%b1", "a2%b2"]
197+
from .sanitize_text import sanitize_text
198+
for item in addrList1:
199+
decoded_str = urllib.parse.unquote(item) #"a1%b1"
200+
#print(decoded_str) #"a1 b1"
201+
addr = sanitize_text(decoded_str)
202+
addrList.append(addr)
203+
204+
connect_address = int(sanitize_text(str(connect_address)))
205+
206+
logs.log(connect_address, addrList)
207+
msg = waypoints.add(connect_address, addrList)
208+
209+
if not msg:
210+
msg = "None"
211+
print(msg)
212+
return "// // // // " + str(msg)
213+
except Exception as e:
214+
print(e)
215+
return str({'// // // // ERROR': str(e), 'droneid': connect_address})
216+
217+
def autocomplete_field(addr: str):
218+
print("auto") #reached.
219+
from .autocomplete import autocomplete_view
220+
from .sanitize_text import sanitize_text
221+
222+
try:
223+
msg = autocomplete_view(sanitize_text(addr))
224+
return msg
225+
except Exception as e:
226+
print(e)
227+
return {'ERROR': str(e)}
228+

0 commit comments

Comments
 (0)