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.)
Overloaded function.
__init__(self: themachinethatgoesping.navigation.datastructures.SensordataLatLon, sensordata: themachinethatgoesping.navigation.datastructures.Sensordata, latitude: float, longitude: float) -> None
Construct a new Sensor Data Lat Lon object using a base sensor data object
- Parameter
data
: $Parameter
latitude
:
in °, positive northwards
- Parameter
longitude
: in °, positive eastwards
__init__(self: themachinethatgoesping.navigation.datastructures.SensordataLatLon, sensordata_utm: themachinethatgoesping::navigation::datastructures::SensordataUTM) -> None
Construct an SensordataLatLon object from an existing SensordataUTM object (this allows for explicit conversion from SensordataUTM class)
__init__(self: themachinethatgoesping.navigation.datastructures.SensordataLatLon, latitude: float = 0, longitude: float = 0, depth: float = 0, heave: float = 0, heading: float = 0, pitch: float = 0, roll: float = 0) -> None
Construct a new SensordataLatLon object
- Parameter
latitude
: in °, positive northwards
- Parameter
longitude
: in °, positive eastwards
- Parameter
depth
: in m, positive downwards
- Parameter
heave
: from heave sensor, will be added to depth in m, positive upwards
- Parameter
heading
: in °, 0° is north, 90° is east
- Parameter
pitch
: in °, positive means bow up
- Parameter
roll
: in °, positive means port up
return a copy using the c++ default copy constructor
create T_CLASS object from bytearray
hash function implemented using binary_hash
Return object information as string
Print object information
hash function implemented using slow_hash
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.
Overloaded function.
__init__(self: themachinethatgoesping.navigation.datastructures.SensordataUTM, sensordatalatlon: themachinethatgoesping.navigation.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
- Parameter
data
: $Parameter
northing
:
in m, positive northwards
- Parameter
easting
: in m, positive eastwards
- Parameter
utm_zone
: UTM/UPS zone number
- Parameter
northern_hemisphere
: if true: northern hemisphere, else: southern hemisphere
__init__(self: themachinethatgoesping.navigation.datastructures.SensordataUTM, sensordata_local: themachinethatgoesping.navigation.datastructures.SensordataLocal, utm_zone: int, northern_hemisphere: bool) -> None
Construct an SensordataUTM object from an existing SensordataLocal object (using a known zone and hemisphere)
- Parameter
data_local
: $Parameter
utm_zone
:
UTM/UPS zone number
- Parameter
northern_hemisphere
: if true: northern hemisphere, else: southern hemisphere
__init__(self: themachinethatgoesping.navigation.datastructures.SensordataUTM, sensordatalatlon: themachinethatgoesping.navigation.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: themachinethatgoesping.navigation.datastructures.SensordataUTM, northing: float = 0, easting: float = 0, utm_zone: int = 0, northern_hemisphere: bool = True, depth: float = 0, heave: float = 0, heading: float = 0, pitch: float = 0, roll: float = 0) -> None
Construct a new SensordataUTM object
- Parameter
northing
: in m, positive northwards
- Parameter
easting
: in m, positive eastwards
- Parameter
utm_zone
: UTM/UPS zone number
- Parameter
northern_hemisphere
: if true: northern hemisphere, else: southern hemisphere
- Parameter
depth
: in m, positive downwards
- Parameter
heave
: is added to depth in m, positive upwards
- Parameter
heading
: in °, 0° is north, 90° is east
- Parameter
pitch
: in °, positive means bow up
- Parameter
roll
: in °, positive means port up
return a copy using the c++ default copy constructor
create T_CLASS object from bytearray
Construct convert a SensordataLatLon Object to UTM
- Parameter
data
: valid SensordataLatLon object
- Parameter
setzone
: set a preferred UTM zone negative means automatic, zero means UPS, positive means a particular UTM zone
- Returns:
SensordataUTM
- Parameter
hash function implemented using binary_hash
Return object information as string
Print object information
hash function implemented using slow_hash
convert object to bytearray
Convert a utm sensordatalatlon to an unprojected data
- Parameter
data_utm
: $Returns:
SensordataLatLon
- Parameter
< 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.
Overloaded function.
__init__(self: themachinethatgoesping.navigation.datastructures.SensordataLocal, sensordatautm: themachinethatgoesping::navigation::datastructures::SensordataUTM) -> None
Construct a new Sensor Position object (all offsets set to 0)
__init__(self: themachinethatgoesping.navigation.datastructures.SensordataLocal, sensordata: themachinethatgoesping.navigation.datastructures.Sensordata, northing: float, easting: float) -> None
Construct a new Sensor Data Local object using a base sensor data object
- Parameter
data
: $Parameter
northing
:
in m, positive northwards
- Parameter
easting
: in m, positive eastwards
__init__(self: themachinethatgoesping.navigation.datastructures.SensordataLocal, northing: float = 0, easting: float = 0, depth: float = 0, heave: float = 0, heading: float = 0, pitch: float = 0, roll: float = 0) -> None
Construct a new SensordataLocal object
- Parameter
northing
: in m, positive northwards
- Parameter
easting
: in m, positive eastwards
- Parameter
depth
: in m, positive downwards
- Parameter
heave
: from heave sensor, will be added to depth in m, positive upwards
- Parameter
heading
: in °, 0° is north, 90° is east
- Parameter
pitch
: in °, positive means bow up
- Parameter
roll
: in °, positive means port up
return a copy using the c++ default copy constructor
< in m, positive eastwards
create T_CLASS object from bytearray
hash function implemented using binary_hash
Return object information as string
< in m, positive northwards
Print object information
hash function implemented using slow_hash
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).
Overloaded function.
__init__(self: themachinethatgoesping.navigation.datastructures.Sensordata, arg0: themachinethatgoesping::navigation::datastructures::SensordataLatLon) -> None
Construct a new Sensordata object
__init__(self: themachinethatgoesping.navigation.datastructures.Sensordata, arg0: themachinethatgoesping::navigation::datastructures::SensordataLocal) -> None
Construct a new Sensordata object
__init__(self: themachinethatgoesping.navigation.datastructures.Sensordata, arg0: themachinethatgoesping::navigation::datastructures::SensordataUTM) -> None
Construct a new Sensordata object
__init__(self: themachinethatgoesping.navigation.datastructures.Sensordata, depth: float = 0, heave: float = 0, heading: float = 0, pitch: float = 0, roll: float = 0) -> None
Construct a new Sensordata object
- Parameter
depth
: from depth source, in m, positive downwards
- Parameter
heave
: from heave sensor, will be added to depth in m, positive upwards
- Parameter
heading
: from heading source, in °, 0° is north, 90° is east
- Parameter
pitch
: from attitude source, in °, positive means bow up
- Parameter
roll
: from attitude source, in °, positive means port up
return a copy using the c++ default copy constructor
< in m, positive downwards
create T_CLASS object from bytearray
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
hash function implemented using slow_hash
convert object to bytearray