Skip to content

Commit 91b3639

Browse files
committed
Reformatting
1 parent fa89ecb commit 91b3639

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

tests/integration/mock_drones/fast_drone.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,18 @@
44
"""
55

66
import time
7-
import sys
87
from pymavlink import mavutil
98

109

11-
def main():
12-
# Connect to the waiting telemetry script
13-
# Note: Your test_telemetry.py uses tcp:localhost:12345
14-
# The drone must LISTEN on this port or CONNECT to it depending on your setup.
15-
# Based on standard MAVLink tests, usually the drone opens the server.
16-
17-
# We will try to bind to the port defined in your test_telemetry.py
10+
def main() -> None: # <--- Added return type annotation here
11+
"""
12+
Main execution loop.
13+
Connects to the MAVLink receiver and sends high-frequency mock data.
14+
"""
1815
connection_string = "tcpin:localhost:12345"
1916
print(f"FAST DRONE: Waiting for connection on {connection_string}...")
2017

18+
# Initialize connection
2119
master = mavutil.mavlink_connection(connection_string)
2220
master.wait_heartbeat()
2321
print("FAST DRONE: Connected! BLASTING DATA AT 100Hz.")
@@ -29,12 +27,18 @@ def main():
2927

3028
# 1. Send Attitude
3129
master.mav.attitude_send(
32-
current_time_ms, 0.1, 0.2, 0.3, 0.01, 0.02, 0.03 # Roll, Pitch, Yaw # Speeds
30+
current_time_ms,
31+
0.1,
32+
0.2,
33+
0.3, # Roll, Pitch, Yaw (radians)
34+
0.01,
35+
0.02,
36+
0.03, # Roll, Pitch, Yaw speeds (rad/s)
3337
)
3438

3539
# 2. Send Position
3640
master.mav.local_position_ned_send(
37-
current_time_ms, 10.5, 20.2, -5.0, 0.5, 0.1, 0.0 # x, y, z # vx, vy, vz
41+
current_time_ms, 10.5, 20.2, -5.0, 0.5, 0.1, 0.0 # x, y, z (m) # vx, vy, vz (m/s)
3842
)
3943

4044
# SLEEP FOR 10ms = 100Hz

0 commit comments

Comments
 (0)