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
# - utm_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 implicit 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
Return object information as string
Print object information
convert object to bytearray
Overloaded function.
__init__(self: themachinethatgoesping.navigation.datastructures.SensorDataUTM, sensordatalatlon: themachinethatgoesping.navigation.datastructures.SensorData, northing: float, easting: float, utm_zone: int, utm_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
utm_northern_hemisphere
: if true: northern hemisphere, else: southern hemisphere
__init__(self: themachinethatgoesping.navigation.datastructures.SensorDataUTM, sensordata_local: themachinethatgoesping.navigation.datastructures.SensorDataLocal, utm_zone: int, utm_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
utm_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 implicit conversion from SensorDataLatLon class)
__init__(self: themachinethatgoesping.navigation.datastructures.SensorDataUTM, northing: float = 0, easting: float = 0, utm_zone: int = 0, utm_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
utm_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
Return object information as string
Print object information
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
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).
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
< 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