Skip to content

Commit

Permalink
change GPS methods to use sensor, add type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
jhazentia committed Apr 5, 2024
1 parent a632242 commit 93a32d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions scos_actions/hardware/gps_iface.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from abc import ABC, abstractmethod

from scos_actions.hardware.sensor import Sensor


class GPSInterface(ABC):
@abstractmethod
def get_location(self, sigan, timeout_s=1):
def get_location(self, sensor : Sensor, timeout_s : float=1):
pass

@abstractmethod
def get_gps_time(self, sigan):
def get_gps_time(self, sensor : Sensor):
pass
4 changes: 2 additions & 2 deletions scos_actions/hardware/mocks/mock_gps.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

class MockGPS(GPSInterface):

def get_location(self, sigan, timeout_s=1):
def get_location(self, sensor, timeout_s=1):
logger.warning("Using mock GPS!")
return 39.995118, -105.261572, 1651.0

def get_gps_time(self, sigan):
def get_gps_time(self, sensor):
logger.warning("Using mock GPS!")
return datetime.now()

0 comments on commit 93a32d0

Please sign in to comment.