From 7ef9e815d960126bff4fd7e0d6eeaa27ce222f32 Mon Sep 17 00:00:00 2001 From: Mihir Bala Date: Mon, 5 Feb 2024 14:25:01 -0500 Subject: [PATCH] ModalAI Drone changes --- .../implementation/drones/ModalAISeekerDrone.py | 12 +----------- onboard/python/supervisor.py | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/onboard/python/implementation/drones/ModalAISeekerDrone.py b/onboard/python/implementation/drones/ModalAISeekerDrone.py index a221adb8..91a4d3be 100644 --- a/onboard/python/implementation/drones/ModalAISeekerDrone.py +++ b/onboard/python/implementation/drones/ModalAISeekerDrone.py @@ -62,7 +62,6 @@ async def hovering(self, timeout=None): async def telemetry_subscriber(self): async def pos(self): - await self.drone.telemetry.set_rate_position(1) async for position in self.drone.telemetry.position(): self.telemetry['lat'] = position.latitude_deg self.telemetry['lng'] = position.longitude_deg @@ -72,14 +71,12 @@ async def head(self): async for heading in self.drone.telemetry.heading(): self.telemetry['head'] = heading.heading_deg async def battery(self): - await self.drone.telemetry.set_rate_battery(1) async for battery in self.drone.telemetry.battery(): self.telemetry['battery'] = battery.remaining_percent async def mag(self): async for health in self.drone.telemetry.health(): self.telemetry['mag'] = health.is_magnetometer_calibration_ok async def sat(self): - await self.drone.telemetry.set_rate_gps_info(1) async for info in self.drone.telemetry.gps_info(): self.telemetry['sat'] = info.num_satellites @@ -194,14 +191,7 @@ async def toggleThermal(self, on): ''' Status methods ''' async def getName(self): - try: - product = await self.drone.info.get_product() - if product.product_name is not None and product.product_name != 'undefined': - return product.product_name - except Exception: - pass - - return "MavlinkDrone" + return "ModalAISeekerDrone" async def getLat(self): return self.telemetry['lat'] diff --git a/onboard/python/supervisor.py b/onboard/python/supervisor.py index 1efc70b3..61a87888 100644 --- a/onboard/python/supervisor.py +++ b/onboard/python/supervisor.py @@ -185,7 +185,7 @@ async def commandHandler(self): logger.debug(f'Got PCMD values: {pitch} {yaw} {roll} {gaz}') asyncio.create_task(self.drone.PCMD(roll, pitch, yaw, gaz)) - except zmq.Error as z: + except Exception as z: logger.error(z)