Skip to content

Commit 50604c1

Browse files
authored
Merge pull request #354 from mavlink/update-examples
Update examples following removal of uuid from core plugin
2 parents fd6a162 + 6945172 commit 50604c1

14 files changed

+23
-23
lines changed

examples/camera.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ async def run():
1313
print("Waiting for drone to connect...")
1414
async for state in drone.core.connection_state():
1515
if state.is_connected:
16-
print(f"Drone discovered with UUID: {state.uuid}")
16+
print(f"Drone discovered!")
1717
break
1818

1919
print_mode_task = asyncio.ensure_future(print_mode(drone))

examples/firmware_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ async def run():
1111
print("Waiting for drone to connect...")
1212
async for state in drone.core.connection_state():
1313
if state.is_connected:
14-
print(f"Drone discovered with UUID: {state.uuid}")
14+
print(f"Drone discovered!")
1515
break
1616

1717
info = await drone.info.get_version()

examples/follow_me_example.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from mavsdk.follow_me import (Config, FollowMeError, TargetLocation)
88

99
default_height = 8.0 #in Meters
10-
follow_distance = 2.0 #in Meters, this is the distance that the drone will remain away from Target while following it
11-
#Direction relative to the Target
10+
follow_distance = 2.0 #in Meters, this is the distance that the drone will remain away from Target while following it
11+
#Direction relative to the Target
1212
#Options are NONE, FRONT, FRONT_LEFT, FRONT_RIGHT, BEHIND
1313
direction = Config.FollowDirection.BEHIND
1414
responsiveness = 0.02
@@ -19,27 +19,27 @@
1919
async def fly_drone():
2020
drone = System()
2121
await drone.connect(system_address="udp://:14540")
22-
22+
2323
#This waits till a mavlink based drone is connected
2424
async for state in drone.core.connection_state():
2525
if state.is_connected:
26-
print(f"-- Connected to drone with UUID: {state.uuid}")
26+
print(f"-- Connected to drone!")
2727
break
28-
28+
2929
#Checking if Global Position Estimate is ok
3030
async for global_lock in drone.telemetry.health():
3131
if global_lock.is_global_position_ok:
3232
print("-- Global position state is good enough for flying.")
3333
break
34-
34+
3535
#Arming the drone
3636
print ("-- Arming")
3737
await drone.action.arm()
38-
38+
3939
#Follow me Mode requires some configuration to be done before starting the mode
4040
conf = Config(default_height, follow_distance, direction, responsiveness)
4141
await drone.follow_me.set_config(conf)
42-
42+
4343
print ("-- Taking Off")
4444
await drone.action.takeoff()
4545
await asyncio.sleep(8)
@@ -54,12 +54,12 @@ async def fly_drone():
5454
print ("-- Following Target")
5555
await drone.follow_me.set_target_location(target)
5656
await asyncio.sleep(2)
57-
57+
5858
#Stopping the follow me mode
5959
print ("-- Stopping Follow Me Mode")
6060
await drone.follow_me.stop()
6161
await asyncio.sleep(5)
62-
62+
6363
print ("-- Landing")
6464
await drone.action.land()
6565

examples/geofence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async def run():
2222
print("Waiting for drone...")
2323
async for state in drone.core.connection_state():
2424
if state.is_connected:
25-
print(f"Drone discovered with UUID: {state.uuid}")
25+
print(f"Drone discovered!")
2626
break
2727

2828
# Fetch the home location coordinates, in order to set a boundary around the home location

examples/goto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ async def run():
1111
print("Waiting for drone to connect...")
1212
async for state in drone.core.connection_state():
1313
if state.is_connected:
14-
print(f"Drone discovered with UUID: {state.uuid}")
14+
print(f"Drone discovered!")
1515
break
1616

1717
print("Waiting for drone to have a global position estimate...")

examples/manual_control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async def manual_controls():
3737
# This waits till a mavlink based drone is connected
3838
async for state in drone.core.connection_state():
3939
if state.is_connected:
40-
print(f"-- Connected to drone with UUID: {state.uuid}")
40+
print(f"-- Connected to drone!")
4141
break
4242

4343
# Checking if Global Position Estimate is ok

examples/mission.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ async def run():
1313
print("Waiting for drone to connect...")
1414
async for state in drone.core.connection_state():
1515
if state.is_connected:
16-
print(f"Drone discovered with UUID: {state.uuid}")
16+
print(f"Drone discovered!")
1717
break
1818

1919
print_mission_progress_task = asyncio.ensure_future(print_mission_progress(drone))

examples/offboard_attitude.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async def run():
2020
print("Waiting for drone to connect...")
2121
async for state in drone.core.connection_state():
2222
if state.is_connected:
23-
print(f"Drone discovered with UUID: {state.uuid}")
23+
print(f"Drone discovered!")
2424
break
2525

2626
print("-- Arming")

examples/offboard_velocity_body.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async def run():
1616
print("Waiting for drone to connect...")
1717
async for state in drone.core.connection_state():
1818
if state.is_connected:
19-
print(f"Drone discovered with UUID: {state.uuid}")
19+
print(f"Drone discovered!")
2020
break
2121

2222
print("-- Arming")

examples/offboard_velocity_ned.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async def run():
1616
print("Waiting for drone to connect...")
1717
async for state in drone.core.connection_state():
1818
if state.is_connected:
19-
print(f"Drone discovered with UUID: {state.uuid}")
19+
print(f"Drone discovered!")
2020
break
2121

2222
print("-- Arming")

0 commit comments

Comments
 (0)