Skip to content

Commit

Permalink
ModalAI Drone changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mihirbala committed Feb 5, 2024
1 parent edd9ada commit 7ef9e81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions onboard/python/implementation/drones/ModalAISeekerDrone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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']
Expand Down
2 changes: 1 addition & 1 deletion onboard/python/supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 7ef9e81

Please sign in to comment.