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#

https://mybinder.org/badge_logo.svg
 # 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#

class SensordataLatLon(*args, **kwargs)#

A structure to store a georeferenced location and attitude data from different sensors (e.g. GPS, IMU, etc.)

__init__(self, sensordata: Sensordata, latitude: float, longitude: float) None#
__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.

  1. __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

  1. __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)

  1. __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

copy(self) SensordataLatLon#

return a copy using the c++ default copy constructor

from_binary = <nanobind.nb_func object>#
hash(self) int#

hash function implemented using binary_hash

info_string(self, float_precision: int = 3, superscript_exponents: bool = True) str#

Return object information as string

property latitude#

(self) -> float

property longitude#

(self) -> float

print(self, float_precision: int = 3, superscript_exponents: bool = True) None#

Print object information

to_binary(self, resize_buffer: bool = True) bytes#

convert object to bytearray

class SensordataUTM(*args, **kwargs)#

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, sensordatalatlon: Sensordata, northing: float, easting: float, utm_zone: int, northern_hemisphere: bool) None#
__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.

  1. __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

  1. __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

  1. __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)

  1. __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

copy(self) SensordataUTM#

return a copy using the c++ default copy constructor

from_binary = <nanobind.nb_func object>#
from_sensordata = <nanobind.nb_func object>#
hash(self) int#

hash function implemented using binary_hash

info_string(self, float_precision: int = 3, superscript_exponents: bool = True) str#

Return object information as string

property northern_hemisphere#

(self) -> bool

print(self, float_precision: int = 3, superscript_exponents: bool = True) None#

Print object information

to_binary(self, resize_buffer: bool = True) bytes#

convert object to bytearray

to_sensordata = <nanobind.nb_func object>#
property utm_zone#

UTM/UPS zone number

class SensordataLocal(*args, **kwargs)#

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, sensordatautm: SensordataUTM) None#
__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.

  1. __init__(self, sensordatautm: themachinethatgoesping.navigation_nanopy.datastructures.SensordataUTM) -> None

Construct a new Sensor Position object (all offsets set to 0)

  1. __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

  1. __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

copy(self) SensordataLocal#

return a copy using the c++ default copy constructor

property easting#

in m, positive eastwards

from_binary = <nanobind.nb_func object>#
hash(self) int#

hash function implemented using binary_hash

info_string(self, float_precision: int = 3, superscript_exponents: bool = True) str#

Return object information as string

property northing#

in m, positive northwards

print(self, float_precision: int = 3, superscript_exponents: bool = True) None#

Print object information

to_binary(self, resize_buffer: bool = True) bytes#

convert object to bytearray

class Sensordata(*args, **kwargs)#

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: SensordataLatLon, /) None#
__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.

  1. __init__(self, arg: themachinethatgoesping.navigation_nanopy.datastructures.SensordataLatLon, /) -> None

Construct a new Sensordata object

  1. __init__(self, arg: themachinethatgoesping.navigation_nanopy.datastructures.SensordataLocal, /) -> None

Construct a new Sensordata object

  1. __init__(self, arg: themachinethatgoesping.navigation_nanopy.datastructures.SensordataUTM, /) -> None

Construct a new Sensordata object

  1. __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

copy(self) Sensordata#

return a copy using the c++ default copy constructor

property depth#

in m, positive downwards

from_binary = <nanobind.nb_func object>#
hash(self) int#

hash function implemented using binary_hash

property heading#

from heading source in °, 0° is north, 90° is east

property heave#

from heave source, will be added to depth in m, positive upwards

info_string(self, float_precision: int = 3, superscript_exponents: bool = True) str#

Return object information as string

property pitch#

from attitude source, in °, positive means bow up

print(self, float_precision: int = 3, superscript_exponents: bool = True) None#

Print object information

property roll#

from attitude source, in °, positive means port up

to_binary(self, resize_buffer: bool = True) bytes#

convert object to bytearray