From 9b15c707698aad7b7b6bf5d3070bab97f28a4e9d Mon Sep 17 00:00:00 2001 From: Mohamad Akkawi Date: Sun, 22 Jan 2023 20:20:18 -0500 Subject: [PATCH 01/10] update proto & submodules --- .gitmodules | 2 +- proto | 2 +- setup.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index 5db1fdfc..6c1d20f6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "proto"] path = proto - url = https://github.com/Dronecode/DronecodeSDK-Proto.git + url = https://github.com/akkawimo/MAVSDK-Proto.git diff --git a/proto b/proto index 743aa1d2..16b55790 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 743aa1d24094db30ac3ed503d9552fb9c49ef4c4 +Subproject commit 16b55790e54b83d79b42091d685356e10e82660b diff --git a/setup.py b/setup.py index eb7498bf..6c7b24af 100644 --- a/setup.py +++ b/setup.py @@ -100,8 +100,8 @@ def mavsdk_server_url(self): return f"https://github.com/mavlink/MAVSDK/releases/download/{self.mavsdk_server_tag}/mavsdk_server_{self.platform_suffix}" def run(self): - if 'MAVSDK_BUILD_PURE' not in os.environ: - self.download_mavsdk_server() + #if 'MAVSDK_BUILD_PURE' not in os.environ: + #self.download_mavsdk_server() build.run(self) @@ -129,7 +129,7 @@ def version(): setup( name="mavsdk", - version=version(), + #version=version(), description="Python wrapper for MAVSDK", long_description=parse_long_description(), long_description_content_type="text/markdown", From c4e265fe85ee878dfc1cdf0a1651aa3afcb3ece2 Mon Sep 17 00:00:00 2001 From: Alessandro Simovic Date: Wed, 25 Jan 2023 09:17:14 +0100 Subject: [PATCH 02/10] [wip] commit cellular status example --- examples/cellular_status_server.py | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 examples/cellular_status_server.py diff --git a/examples/cellular_status_server.py b/examples/cellular_status_server.py new file mode 100644 index 00000000..af13809b --- /dev/null +++ b/examples/cellular_status_server.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 + +from mavsdk import System +from mavsdk.telemetry_server import CellularStatus +from mavsdk.telemetry_server import TelemetryServerError + +import asyncio + +async def run(): + drone = System(mavsdk_server_address="localhost", port=50051,sysid=245,compid=190) + #await drone.connect('udp://:14550') + + #drone = System() + await drone.connect('udp://:14550') + + print("Waiting for drone to connect...") + async for state in drone.core.connection_state(): + if state.is_connected: + print(f"-- Connected to drone!") + break + + print("-- Arming") + await drone.action.arm() + + while True: + + cellular_status = CellularStatus(1,1,1,1,1,2,1,1,2,1,1,1,1,"hi",1.0,1.0) + print(cellular_status) + if await drone.telemetry_server.publish_cellular_status(cellular_status) is not TelemetryServerError: + print("OK") + else: + print("mavsdk ran into error") + return "error :(" + print("pub cellular_status 0") + + await asyncio.sleep(1) + +if __name__ == "__main__": + loop = asyncio.get_event_loop() + loop.run_until_complete(run()) \ No newline at end of file From 3b18d4ef8bbf90562001df0c432eb69672dbf206 Mon Sep 17 00:00:00 2001 From: Alessandro Simovic Date: Wed, 25 Jan 2023 10:14:59 +0100 Subject: [PATCH 03/10] update proto after rebase --- proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto b/proto index 16b55790..5be69116 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 16b55790e54b83d79b42091d685356e10e82660b +Subproject commit 5be691163cd85ade69f703e75fe25ae2c5d2ce5b From a00d5cf7130267a5270ff75d80b2554de4ca2451 Mon Sep 17 00:00:00 2001 From: Alessandro Simovic Date: Wed, 25 Jan 2023 11:24:51 +0100 Subject: [PATCH 04/10] cellular_status_server: dont arm --- examples/cellular_status_server.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) mode change 100644 => 100755 examples/cellular_status_server.py diff --git a/examples/cellular_status_server.py b/examples/cellular_status_server.py old mode 100644 new mode 100755 index af13809b..04a0ead2 --- a/examples/cellular_status_server.py +++ b/examples/cellular_status_server.py @@ -19,11 +19,10 @@ async def run(): print(f"-- Connected to drone!") break - print("-- Arming") - await drone.action.arm() + # print("-- Arming") + # await drone.action.arm() while True: - cellular_status = CellularStatus(1,1,1,1,1,2,1,1,2,1,1,1,1,"hi",1.0,1.0) print(cellular_status) if await drone.telemetry_server.publish_cellular_status(cellular_status) is not TelemetryServerError: From 9c1d93bd609f72c5529a2855d1e98c69d49be535 Mon Sep 17 00:00:00 2001 From: Mohamad Akkawi Date: Thu, 26 Jan 2023 23:53:24 -0500 Subject: [PATCH 05/10] update proto --- proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto b/proto index 5be69116..e31ae97f 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 5be691163cd85ade69f703e75fe25ae2c5d2ce5b +Subproject commit e31ae97f3435c5ae299d25d3dda0410a5e295a57 From de131f3965a1d47031989ae853dc67b805a6d072 Mon Sep 17 00:00:00 2001 From: Mohamad Akkawi Date: Thu, 26 Jan 2023 23:57:28 -0500 Subject: [PATCH 06/10] revert comments in setup.py --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 6c7b24af..eb7498bf 100644 --- a/setup.py +++ b/setup.py @@ -100,8 +100,8 @@ def mavsdk_server_url(self): return f"https://github.com/mavlink/MAVSDK/releases/download/{self.mavsdk_server_tag}/mavsdk_server_{self.platform_suffix}" def run(self): - #if 'MAVSDK_BUILD_PURE' not in os.environ: - #self.download_mavsdk_server() + if 'MAVSDK_BUILD_PURE' not in os.environ: + self.download_mavsdk_server() build.run(self) @@ -129,7 +129,7 @@ def version(): setup( name="mavsdk", - #version=version(), + version=version(), description="Python wrapper for MAVSDK", long_description=parse_long_description(), long_description_content_type="text/markdown", From c8f8b710c5e7773888ddc3f257ce1d0662f9f4ba Mon Sep 17 00:00:00 2001 From: Mohamad Akkawi Date: Sat, 11 Feb 2023 19:30:27 -0500 Subject: [PATCH 07/10] update proto --- proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto b/proto index e31ae97f..dcfd62c2 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit e31ae97f3435c5ae299d25d3dda0410a5e295a57 +Subproject commit dcfd62c26afa88eb784d7811e537d5209b0eea43 From 6b017c30b20f1447e018d940a859221460c4cbc0 Mon Sep 17 00:00:00 2001 From: Mohamad Akkawi Date: Sat, 11 Feb 2023 20:13:16 -0500 Subject: [PATCH 08/10] update cellular example script --- examples/cellular_status_server.py | 47 ++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/examples/cellular_status_server.py b/examples/cellular_status_server.py index 04a0ead2..177ed0c6 100755 --- a/examples/cellular_status_server.py +++ b/examples/cellular_status_server.py @@ -3,15 +3,14 @@ from mavsdk import System from mavsdk.telemetry_server import CellularStatus from mavsdk.telemetry_server import TelemetryServerError +from mavsdk.telemetry_server import ModemInfo import asyncio async def run(): - drone = System(mavsdk_server_address="localhost", port=50051,sysid=245,compid=190) - #await drone.connect('udp://:14550') + drone = System(mavsdk_server_address="localhost") - #drone = System() - await drone.connect('udp://:14550') + await drone.connect(system_address="udp://localhost:14550") print("Waiting for drone to connect...") async for state in drone.core.connection_state(): @@ -19,18 +18,48 @@ async def run(): print(f"-- Connected to drone!") break - # print("-- Arming") - # await drone.action.arm() - while True: - cellular_status = CellularStatus(1,1,1,1,1,2,1,1,2,1,1,1,1,"hi",1.0,1.0) + cellular_status = CellularStatus(1,2,3,4,5,6,7,8,9.0,10,11.0,12.0,13.0,14,15,16,1,"hi") + print(cellular_status) + if await drone.telemetry_server.publish_cellular_status(cellular_status) is not TelemetryServerError: + print("OK") + else: + print("mavsdk ran into error") + return "error :(" + print("pub cellular_status instance 1") + + await asyncio.sleep(1) + + modem_info = ModemInfo(1,2,3,4,"id","firmware","model") + print(modem_info) + if await drone.telemetry_server.publish_modem_info(modem_info) is not TelemetryServerError: + print("OK") + else: + print("mavsdk ran into error") + return "error :(" + print("pub modem_info instance 1") + + await asyncio.sleep(1) + + cellular_status = CellularStatus(1,2,3,4,5,6,7,8,9.0,10,11.0,12.0,13.0,14,15,16,2,"hi") print(cellular_status) if await drone.telemetry_server.publish_cellular_status(cellular_status) is not TelemetryServerError: print("OK") else: print("mavsdk ran into error") return "error :(" - print("pub cellular_status 0") + print("pub cellular_status instance 2") + + await asyncio.sleep(1) + + modem_info = ModemInfo(2,2,3,4,"id","firmware","model") + print(modem_info) + if await drone.telemetry_server.publish_modem_info(modem_info) is not TelemetryServerError: + print("OK") + else: + print("mavsdk ran into error") + return "error :(" + print("pub modem_info instance 2") await asyncio.sleep(1) From dcd6def071091874b339f1fe56bcb16a09563c59 Mon Sep 17 00:00:00 2001 From: Mohamad Akkawi Date: Mon, 13 Feb 2023 23:41:28 -0500 Subject: [PATCH 09/10] update proto --- proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto b/proto index dcfd62c2..e94f2bfa 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit dcfd62c26afa88eb784d7811e537d5209b0eea43 +Subproject commit e94f2bfa054acee3a811c10d5e95c0b0b6caa02c From f8ff4463d3086fc5747741471934bd4e433cc8b3 Mon Sep 17 00:00:00 2001 From: Mohamad Akkawi Date: Tue, 14 Feb 2023 00:58:24 -0500 Subject: [PATCH 10/10] update cellular example script --- examples/cellular_status_server.py | 33 ++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/examples/cellular_status_server.py b/examples/cellular_status_server.py index 177ed0c6..6d85645f 100755 --- a/examples/cellular_status_server.py +++ b/examples/cellular_status_server.py @@ -4,6 +4,8 @@ from mavsdk.telemetry_server import CellularStatus from mavsdk.telemetry_server import TelemetryServerError from mavsdk.telemetry_server import ModemInfo +from mavsdk.telemetry_server import OnboardComputerStatus +from mavsdk.telemetry_server import ComponentInfoBasic import asyncio @@ -30,7 +32,7 @@ async def run(): await asyncio.sleep(1) - modem_info = ModemInfo(1,2,3,4,"id","firmware","model") + modem_info = ModemInfo(1,2,3,"modem_id","iccid","firmware","model") print(modem_info) if await drone.telemetry_server.publish_modem_info(modem_info) is not TelemetryServerError: print("OK") @@ -52,7 +54,7 @@ async def run(): await asyncio.sleep(1) - modem_info = ModemInfo(2,2,3,4,"id","firmware","model") + modem_info = ModemInfo(2,2,3,"modem_id","iccid","firmware","model") print(modem_info) if await drone.telemetry_server.publish_modem_info(modem_info) is not TelemetryServerError: print("OK") @@ -63,6 +65,33 @@ async def run(): await asyncio.sleep(1) + comp_info = ComponentInfoBasic(1,2,"vendor_name","modem_name","software_version","hardware_version","serial_number") + print(comp_info) + if await drone.telemetry_server.publish_component_info_basic(comp_info) is not TelemetryServerError: + print("OK") + else: + print("mavsdk ran into error") + return "error :(" + print("pub comp_info") + + + await asyncio.sleep(1) + + a = [1,1,1] + + ocs_info = OnboardComputerStatus(1,2,3,a,a,a,a,4,a,a,5,6,a,a,a,a,a,a,a,a) + + print(ocs_info) + if await drone.telemetry_server.publish_onboard_computer_status(ocs_info) is not TelemetryServerError: + print("OK") + else: + print("mavsdk ran into error") + return "error :(" + print("pub ocs_info") + + await asyncio.sleep(1) + + if __name__ == "__main__": loop = asyncio.get_event_loop() loop.run_until_complete(run()) \ No newline at end of file