File tree Expand file tree Collapse file tree 4 files changed +31
-27
lines changed Expand file tree Collapse file tree 4 files changed +31
-27
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,11 @@ async def run():
24
24
drone = System ()
25
25
await drone .connect (system_address = "udpin://0.0.0.0:14540" )
26
26
27
- tasks = []
28
- tasks .append (asyncio .create_task (observe_current_settings (drone )))
29
- tasks .append (asyncio .create_task (observe_camera_mode (drone )))
30
- tasks .append (asyncio .create_task (observe_possible_setting_options (drone )))
27
+ tasks = [
28
+ asyncio .create_task (observe_current_settings (drone )),
29
+ asyncio .create_task (observe_camera_mode (drone )),
30
+ asyncio .create_task (observe_possible_setting_options (drone )),
31
+ ]
31
32
32
33
while True :
33
34
entered_input = await ainput (usage_str )
Original file line number Diff line number Diff line change @@ -147,24 +147,25 @@ async def run():
147
147
await drone .action .disarm ()
148
148
return
149
149
150
- waypoints = []
151
-
152
150
# Read data from the CSV file
153
151
async with await anyio .open_file ("active.csv" , "r" , newline = "" ) as csvfile :
154
152
content = await csvfile .read ()
155
- reader = csv .DictReader (io .StringIO (content ))
156
- for row in reader :
157
- waypoints .append ((float (row ["t" ]),
158
- float (row ["px" ]),
159
- float (row ["py" ]),
160
- float (row ["pz" ]),
161
- float (row ["vx" ]),
162
- float (row ["vy" ]),
163
- float (row ["vz" ]),
164
- float (row ["ax" ]),
165
- float (row ["ay" ]),
166
- float (row ["az" ]),
167
- int (row ["mode" ])))
153
+ waypoints = [
154
+ (
155
+ float (row ["t" ]),
156
+ float (row ["px" ]),
157
+ float (row ["py" ]),
158
+ float (row ["pz" ]),
159
+ float (row ["vx" ]),
160
+ float (row ["vy" ]),
161
+ float (row ["vz" ]),
162
+ float (row ["ax" ]),
163
+ float (row ["ay" ]),
164
+ float (row ["az" ]),
165
+ int (row ["mode" ]),
166
+ )
167
+ for row in csv .DictReader (io .StringIO (content ))
168
+ ]
168
169
169
170
print ("-- Performing trajectory" )
170
171
total_duration = waypoints [- 1 ][0 ]
Original file line number Diff line number Diff line change @@ -96,9 +96,10 @@ async def run():
96
96
await drone .connect ()
97
97
98
98
# Start the tasks
99
- tasks = []
100
- tasks .append (asyncio .create_task (print_gps_info (drone )))
101
- tasks .append (asyncio .create_task (send_rtcm (drone )))
99
+ tasks = [
100
+ asyncio .create_task (print_gps_info (drone )),
101
+ asyncio .create_task (send_rtcm (drone )),
102
+ ]
102
103
103
104
# Keep the program running indefinitely
104
105
exit_event = asyncio .Event ()
Original file line number Diff line number Diff line change @@ -15,11 +15,12 @@ async def run():
15
15
await drone .connect (system_address = "udpin://0.0.0.0:14540" )
16
16
17
17
# Start the tasks
18
- tasks = []
19
- tasks .append (asyncio .create_task (print_battery (drone )))
20
- tasks .append (asyncio .create_task (print_gps_info (drone )))
21
- tasks .append (asyncio .create_task (print_in_air (drone )))
22
- tasks .append (asyncio .create_task (print_position (drone )))
18
+ tasks = [
19
+ asyncio .create_task (print_battery (drone )),
20
+ asyncio .create_task (print_gps_info (drone )),
21
+ asyncio .create_task (print_in_air (drone )),
22
+ asyncio .create_task (print_position (drone )),
23
+ ]
23
24
24
25
# Keep the program running indefinitely
25
26
exit_event = asyncio .Event ()
You can’t perform that action at this time.
0 commit comments