Skip to content

Commit

Permalink
Rename Drone to System
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasVautherin committed Sep 17, 2019
1 parent 42408d6 commit 716f26b
Show file tree
Hide file tree
Showing 15 changed files with 98 additions and 71 deletions.
6 changes: 3 additions & 3 deletions examples/calibration.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3

import asyncio
from mavsdk import Drone
from mavsdk import System


async def run():

drone = Drone()
await drone.connect(drone_address="udp://:14540")
drone = System()
await drone.connect(system_address="udp://:14540")

print("-- Starting gyro calibration")
async for progress_data in drone.calibration.calibrate_gyro():
Expand Down
6 changes: 3 additions & 3 deletions examples/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import asyncio

from mavsdk import (CameraError, CameraMode)
from mavsdk import Drone
from mavsdk import System


async def run():
drone = Drone()
await drone.connect(drone_address="udp://:14540")
drone = System()
await drone.connect(system_address="udp://:14540")

asyncio.ensure_future(print_camera_mode(drone))
asyncio.ensure_future(print_camera_status(drone))
Expand Down
6 changes: 3 additions & 3 deletions examples/firmware_version.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env python3

import asyncio
from mavsdk import Drone
from mavsdk import System


async def run():
drone = Drone()
await drone.connect(drone_address="udp://:14540")
drone = System()
await drone.connect(system_address="udp://:14540")

info = await drone.info.get_version()
print(info)
Expand Down
6 changes: 3 additions & 3 deletions examples/mission.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import asyncio

from mavsdk import Drone
from mavsdk import System
from mavsdk import (MissionItem)


async def run():
drone = Drone()
await drone.connect(drone_address="udp://:14540")
drone = System()
await drone.connect(system_address="udp://:14540")

asyncio.ensure_future(print_mission_progress(drone))
termination_task = asyncio.ensure_future(observe_is_in_air(drone))
Expand Down
6 changes: 3 additions & 3 deletions examples/offboard_attitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

import asyncio

from mavsdk import Drone
from mavsdk import System
from mavsdk import (Attitude, OffboardError)


async def run():
""" Does Offboard control using attitude commands. """

drone = Drone()
await drone.connect(drone_address="udp://:14540")
drone = System()
await drone.connect(system_address="udp://:14540")

print("-- Arming")
await drone.action.arm()
Expand Down
18 changes: 9 additions & 9 deletions examples/offboard_position_ned.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@

import asyncio

from mavsdk import Drone
from mavsdk import (OffboardError, PositionNEDYaw)
from mavsdk import System
from mavsdk import (OffboardError, PositionNedYaw)


async def run():
""" Does Offboard control using position NED coordinates. """

drone = Drone()
await drone.connect(drone_address="udp://:14540")
drone = System()
await drone.connect(system_address="udp://:14540")

print("-- Arming")
await drone.action.arm()

print("-- Setting initial setpoint")
await drone.offboard.set_position_ned(PositionNEDYaw(0.0, 0.0, 0.0, 0.0))
await drone.offboard.set_position_ned(PositionNedYaw(0.0, 0.0, 0.0, 0.0))

print("-- Starting offboard")
try:
Expand All @@ -40,19 +40,19 @@ async def run():
return

print("-- Go 0m North, 0m East, -5m Down within local coordinate system")
await drone.offboard.set_position_ned(PositionNEDYaw(0.0, 0.0, -5.0, 0.0))
await drone.offboard.set_position_ned(PositionNedYaw(0.0, 0.0, -5.0, 0.0))
await asyncio.sleep(10)

print("-- Go 5m North, 0m East, -5m Down within local coordinate system, turn to face East")
await drone.offboard.set_position_ned(PositionNEDYaw(5.0, 0.0, -5.0, 90.0))
await drone.offboard.set_position_ned(PositionNedYaw(5.0, 0.0, -5.0, 90.0))
await asyncio.sleep(10)

print("-- Go 5m North, 10m East, -5m Down within local coordinate system")
await drone.offboard.set_position_ned(PositionNEDYaw(5.0, 10.0, -5.0, 90.0))
await drone.offboard.set_position_ned(PositionNedYaw(5.0, 10.0, -5.0, 90.0))
await asyncio.sleep(15)

print("-- Go 0m North, 10m East, 0m Down within local coordinate system, turn to face South")
await drone.offboard.set_position_ned(PositionNEDYaw(0.0, 10.0, 0.0, 180.0))
await drone.offboard.set_position_ned(PositionNedYaw(0.0, 10.0, 0.0, 180.0))
await asyncio.sleep(10)

print("-- Stopping offboard")
Expand Down
6 changes: 3 additions & 3 deletions examples/offboard_velocity_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

import asyncio

from mavsdk import Drone
from mavsdk import System
from mavsdk import (OffboardError, VelocityBodyYawspeed)


async def run():
""" Does Offboard control using velocity body coordinates. """

drone = Drone()
await drone.connect(drone_address="udp://:14540")
drone = System()
await drone.connect(system_address="udp://:14540")

print("-- Arming")
await drone.action.arm()
Expand Down
24 changes: 12 additions & 12 deletions examples/offboard_velocity_ned.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@

import asyncio

from mavsdk import Drone
from mavsdk import (OffboardError, VelocityNEDYaw)
from mavsdk import System
from mavsdk import (OffboardError, VelocityNedYaw)


async def run():
""" Does Offboard control using velocity NED coordinates. """

drone = Drone()
await drone.connect(drone_address="udp://:14540")
drone = System()
await drone.connect(system_address="udp://:14540")

print("-- Arming")
await drone.action.arm()

print("-- Setting initial setpoint")
await drone.offboard.set_velocity_ned(VelocityNEDYaw(0.0, 0.0, 0.0, 0.0))
await drone.offboard.set_velocity_ned(VelocityNedYaw(0.0, 0.0, 0.0, 0.0))

print("-- Starting offboard")
try:
Expand All @@ -40,31 +40,31 @@ async def run():
return

print("-- Go up 2 m/s")
await drone.offboard.set_velocity_ned(VelocityNEDYaw(0.0, 0.0, -2.0, 0.0))
await drone.offboard.set_velocity_ned(VelocityNedYaw(0.0, 0.0, -2.0, 0.0))
await asyncio.sleep(4)

print("-- Go North 2 m/s, turn to face East")
await drone.offboard.set_velocity_ned(VelocityNEDYaw(2.0, 0.0, 0.0, 90.0))
await drone.offboard.set_velocity_ned(VelocityNedYaw(2.0, 0.0, 0.0, 90.0))
await asyncio.sleep(4)

print("-- Go South 2 m/s, turn to face West")
await drone.offboard.set_velocity_ned(VelocityNEDYaw(-2.0, 0.0, 0.0, 270.0))
await drone.offboard.set_velocity_ned(VelocityNedYaw(-2.0, 0.0, 0.0, 270.0))
await asyncio.sleep(4)

print("-- Go West 2 m/s, turn to face East")
await drone.offboard.set_velocity_ned(VelocityNEDYaw(0.0, -2.0, 0.0, 90.0))
await drone.offboard.set_velocity_ned(VelocityNedYaw(0.0, -2.0, 0.0, 90.0))
await asyncio.sleep(4)

print("-- Go East 2 m/s")
await drone.offboard.set_velocity_ned(VelocityNEDYaw(0.0, 2.0, 0.0, 90.0))
await drone.offboard.set_velocity_ned(VelocityNedYaw(0.0, 2.0, 0.0, 90.0))
await asyncio.sleep(4)

print("-- Turn to face South")
await drone.offboard.set_velocity_ned(VelocityNEDYaw(0.0, 0.0, 0.0, 180.0))
await drone.offboard.set_velocity_ned(VelocityNedYaw(0.0, 0.0, 0.0, 180.0))
await asyncio.sleep(2)

print("-- Go down 1 m/s, turn to face North")
await drone.offboard.set_velocity_ned(VelocityNEDYaw(0.0, 0.0, 1.0, 0.0))
await drone.offboard.set_velocity_ned(VelocityNedYaw(0.0, 0.0, 1.0, 0.0))
await asyncio.sleep(4)

print("-- Stopping offboard")
Expand Down
6 changes: 3 additions & 3 deletions examples/takeoff_and_land.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3

import asyncio
from mavsdk import Drone
from mavsdk import System


async def run():

drone = Drone()
await drone.connect(drone_address="udp://:14540")
drone = System()
await drone.connect(system_address="udp://:14540")

print("Waiting for drone...")
async for state in drone.core.connection_state():
Expand Down
6 changes: 3 additions & 3 deletions examples/telemetry.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3

import asyncio
from mavsdk import Drone
from mavsdk import System


async def run():
# Init the drone
drone = Drone()
await drone.connect(drone_address="udp://:14540")
drone = System()
await drone.connect(system_address="udp://:14540")

# Start the tasks
asyncio.ensure_future(print_battery(drone))
Expand Down
6 changes: 3 additions & 3 deletions examples/telemetry_flight_mode.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env python3

import asyncio
from mavsdk import Drone
from mavsdk import System


async def print_flight_mode():
drone = Drone()
await drone.connect(drone_address="udp://:14540")
drone = System()
await drone.connect(system_address="udp://:14540")

async for flight_mode in drone.telemetry.flight_mode():
print("FlightMode:", flight_mode)
Expand Down
6 changes: 3 additions & 3 deletions examples/telemetry_is_armed_is_in_air.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env python3

import asyncio
from mavsdk import Drone
from mavsdk import System


async def run():
drone = Drone()
await drone.connect(drone_address="udp://:14540")
drone = System()
await drone.connect(system_address="udp://:14540")

asyncio.ensure_future(print_is_armed(drone))
asyncio.ensure_future(print_is_in_air(drone))
Expand Down
6 changes: 3 additions & 3 deletions examples/telemetry_takeoff_and_land.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

import asyncio
from mavsdk import Drone
from mavsdk import System


async def run():
Expand All @@ -24,8 +24,8 @@ async def run():
"""

# Init the drone
drone = Drone()
await drone.connect(drone_address="udp://:14540")
drone = System()
await drone.connect(system_address="udp://:14540")

# Start parallel tasks
asyncio.ensure_future(print_altitude(drone))
Expand Down
2 changes: 1 addition & 1 deletion mavsdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import platform
import sys

from .drone import Drone
from .system import System
from .generated import * # NOQA

# Check for compatibility
Expand Down
Loading

0 comments on commit 716f26b

Please sign in to comment.