Sensordata structures#
Simple structures to store sensor data from IMU, compass, position system, depth sensor (e.g rtk signal) and heave sensor SensordataLatLon which records lat/lon can be implicitly converted to and from SensordataUTM which stores utm coordinates.
Example usage#
# import this module# import this module
from themachinethatgoesping.navigation.datastructures import SensordataLatLon, SensordataUTM
data_utm = SensordataUTM(
5427745.995, # northing
314082.699, # easting
60, # utm zone
False, # northern_hemisphere
3, # depth
-2, # heave,
45, # compass heading
10, # yaw
20, # pitch
30) # roll
print(data_utm)
# SensordataUTM
# *************
# - northing: 5427746.00 [positive northwards, m]
# - easting: 314082.70 [positive eastwards, m]
# - utm_zone: 60
# - northern_hemisphere: false
# - depth: 3.00 [positive downwards, m]
# - heave: -2.00 [positive upwards, m]
# - heading: 45.00 [90 ° at east]
# - pitch: 20.00 [° positive bow up]
# - roll: 30.00 [° positive port up]
# conversion to latlon data (works in both directions)
data_latlot = SensordataLatLon(data_utm)
print()
print(data_latlot)
# SensordataLatLon
# ****************
# - latitude: 41°16'49.2"S [ddd°mm',ss.s''N/S]
# - longitude: 41°16'49.2"W [ddd°mm',ss.s''E/W]
# - depth: 3.00 [positive downwards, m]
# - heave: -2.00 [positive upwards, m]
# - heading: 45.00 [90 ° at east]
# - pitch: 20.00 [° positive bow up]
# - roll: 30.00 [° positive port up]
Data structures#
A structure to store a georeferenced location and attitude data from different sensors (e.g. GPS, IMU, etc.)
- __init__(self, sensordata_utm: SensordataUTM) None
- __init__(self, latitude: float = 0, longitude: float = 0, depth: float = 0.0, heave: float = 0.0, heading: float = 0.0, pitch: float = 0.0, roll: float = 0.0) None
Overloaded function.
__init__(self, sensordata: themachinethatgoesping.navigation_nanopy.datastructures.Sensordata, latitude: float, longitude: float) -> None
Construct a new Sensor Data Lat Lon object using a base sensor data object
- Parameters:
data
latitude – in °, positive northwards
longitude – in °, positive eastwards
__init__(self, sensordata_utm: themachinethatgoesping.navigation_nanopy.datastructures.SensordataUTM) -> None
Construct an SensordataLatLon object from an existing SensordataUTM object (this allows for explicit conversion from SensordataUTM class)
__init__(self, latitude: float = 0, longitude: float = 0, depth: float = 0.0, heave: float = 0.0, heading: float = 0.0, pitch: float = 0.0, roll: float = 0.0) -> None
Construct a new SensordataLatLon object
- Parameters:
latitude – in °, positive northwards
longitude – in °, positive eastwards
depth – in m, positive downwards
heave – from heave sensor, will be added to depth in m, positive upwards
heading – in °, 0° is north, 90° is east
pitch – in °, positive means bow up
roll – in °, positive means port up
return a copy using the c++ default copy constructor
hash function implemented using binary_hash
Return object information as string
(self) -> float
(self) -> float
Print object information
convert object to bytearray
A structure to store a georeferenced data and attitude data from different sensors (e.g. GPS, IMU, etc.) Unlike SensordataLatLon, this structure stores UTM coordinates.
- __init__(self, sensordata_local: SensordataLocal, utm_zone: int, northern_hemisphere: bool) None
- __init__(self, sensordatalatlon: SensordataLatLon, setutm_zone: int = -1) None
- __init__(self, northing: float = 0, easting: float = 0, utm_zone: int = 0, northern_hemisphere: bool = True, depth: float = 0.0, heave: float = 0.0, heading: float = 0.0, pitch: float = 0.0, roll: float = 0.0) None
Overloaded function.
__init__(self, sensordatalatlon: themachinethatgoesping.navigation_nanopy.datastructures.Sensordata, northing: float, easting: float, utm_zone: int, northern_hemisphere: bool) -> None
Construct a new Sensor Data Local object using a base sensor data object
- Parameters:
data
northing – in m, positive northwards
easting – in m, positive eastwards
utm_zone – UTM/UPS zone number
northern_hemisphere – if true: northern hemisphere, else: southern hemisphere
__init__(self, sensordata_local: themachinethatgoesping.navigation_nanopy.datastructures.SensordataLocal, utm_zone: int, northern_hemisphere: bool) -> None
Construct an SensordataUTM object from an existing SensordataLocal object (using a known zone and hemisphere)
- Parameters:
data_local
utm_zone – UTM/UPS zone number
northern_hemisphere – if true: northern hemisphere, else: southern hemisphere
__init__(self, sensordatalatlon: themachinethatgoesping.navigation_nanopy.datastructures.SensordataLatLon, setutm_zone: int = -1) -> None
Construct an SensordataUTM object from an existing SensordataLatLon object (this allows for explicit conversion from SensordataLatLon class)
__init__(self, northing: float = 0, easting: float = 0, utm_zone: int = 0, northern_hemisphere: bool = True, depth: float = 0.0, heave: float = 0.0, heading: float = 0.0, pitch: float = 0.0, roll: float = 0.0) -> None
Construct a new SensordataUTM object
- Parameters:
northing – in m, positive northwards
easting – in m, positive eastwards
utm_zone – UTM/UPS zone number
northern_hemisphere – if true: northern hemisphere, else: southern hemisphere
depth – in m, positive downwards
heave – is added to depth in m, positive upwards
heading – in °, 0° is north, 90° is east
pitch – in °, positive means bow up
roll – in °, positive means port up
return a copy using the c++ default copy constructor
hash function implemented using binary_hash
Return object information as string
(self) -> bool
Print object information
convert object to bytearray
UTM/UPS zone number
A structure to store a georeferenced data and attitude data from different sensors (e.g. GPS, IMU, etc.) Unlike SensordataUTM, this structure stores coordinates without zone and hemisphere information.
- __init__(self, sensordata: Sensordata, northing: float, easting: float) None
- __init__(self, northing: float = 0, easting: float = 0, depth: float = 0.0, heave: float = 0.0, heading: float = 0.0, pitch: float = 0.0, roll: float = 0.0) None
Overloaded function.
__init__(self, sensordatautm: themachinethatgoesping.navigation_nanopy.datastructures.SensordataUTM) -> None
Construct a new Sensor Position object (all offsets set to 0)
__init__(self, sensordata: themachinethatgoesping.navigation_nanopy.datastructures.Sensordata, northing: float, easting: float) -> None
Construct a new Sensor Data Local object using a base sensor data object
- Parameters:
data
northing – in m, positive northwards
easting – in m, positive eastwards
__init__(self, northing: float = 0, easting: float = 0, depth: float = 0.0, heave: float = 0.0, heading: float = 0.0, pitch: float = 0.0, roll: float = 0.0) -> None
Construct a new SensordataLocal object
- Parameters:
northing – in m, positive northwards
easting – in m, positive eastwards
depth – in m, positive downwards
heave – from heave sensor, will be added to depth in m, positive upwards
heading – in °, 0° is north, 90° is east
pitch – in °, positive means bow up
roll – in °, positive means port up
return a copy using the c++ default copy constructor
in m, positive eastwards
hash function implemented using binary_hash
Return object information as string
in m, positive northwards
Print object information
convert object to bytearray
A structure to store a georeferenced location and attitude data from different sensors (e.g. IMU, etc.) No gps coordinates are stored in this structure (only depth).
- __init__(self, arg: SensordataLocal, /) None
- __init__(self, arg: SensordataUTM, /) None
- __init__(self, depth: float = 0.0, heave: float = 0.0, heading: float = 0.0, pitch: float = 0.0, roll: float = 0.0) None
Overloaded function.
__init__(self, arg: themachinethatgoesping.navigation_nanopy.datastructures.SensordataLatLon, /) -> None
Construct a new Sensordata object
__init__(self, arg: themachinethatgoesping.navigation_nanopy.datastructures.SensordataLocal, /) -> None
Construct a new Sensordata object
__init__(self, arg: themachinethatgoesping.navigation_nanopy.datastructures.SensordataUTM, /) -> None
Construct a new Sensordata object
__init__(self, depth: float = 0.0, heave: float = 0.0, heading: float = 0.0, pitch: float = 0.0, roll: float = 0.0) -> None
Construct a new Sensordata object
- Parameters:
depth – from depth source, in m, positive downwards
heave – from heave sensor, will be added to depth in m, positive upwards
heading – from heading source, in °, 0° is north, 90° is east
pitch – from attitude source, in °, positive means bow up
roll – from attitude source, in °, positive means port up
return a copy using the c++ default copy constructor
in m, positive downwards
hash function implemented using binary_hash
from heading source in °, 0° is north, 90° is east
from heave source, will be added to depth in m, positive upwards
Return object information as string
from attitude source, in °, positive means bow up
Print object information
from attitude source, in °, positive means port up
convert object to bytearray