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#

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

__init__(*args, **kwargs)#

Overloaded function.

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

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

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

copy(self: SensordataLatLon) SensordataLatLon#

return a copy using the c++ default copy constructor

static from_binary(buffer: bytes, check_buffer_is_read_completely: bool = True) SensordataLatLon#

create T_CLASS object from bytearray

hash(self: SensordataLatLon) int#

hash function implemented using binary_hash

info_string(self: SensordataLatLon, float_precision: int = 2) str#

Return object information as string

print(self: SensordataLatLon, float_precision: int = 2) None#

Print object information

slow_hash(self: SensordataLatLon) int#

hash function implemented using slow_hash

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

convert object to bytearray

class SensordataUTM#

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__(*args, **kwargs)#

Overloaded function.

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

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

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

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

copy(self: SensordataUTM) SensordataUTM#

return a copy using the c++ default copy constructor

static from_binary(buffer: bytes, check_buffer_is_read_completely: bool = True) SensordataUTM#

create T_CLASS object from bytearray

static from_sensordata(sensordatalatlon: SensordataLatLon, setutm_zone: int = -1) SensordataUTM#

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

hash(self: SensordataUTM) int#

hash function implemented using binary_hash

info_string(self: SensordataUTM, float_precision: int = 2) str#

Return object information as string

print(self: SensordataUTM, float_precision: int = 2) None#

Print object information

slow_hash(self: SensordataUTM) int#

hash function implemented using slow_hash

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

convert object to bytearray

static to_sensordata(sensordata_utm: SensordataUTM) SensordataLatLon#

Convert a utm sensordatalatlon to an unprojected data

Parameter data_utm:

$Returns:

SensordataLatLon

property utm_zone#

< UTM/UPS zone number

class SensordataLocal#

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__(*args, **kwargs)#

Overloaded function.

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

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

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

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

copy(self: SensordataLocal) SensordataLocal#

return a copy using the c++ default copy constructor

property easting#

< in m, positive eastwards

static from_binary(buffer: bytes, check_buffer_is_read_completely: bool = True) SensordataLocal#

create T_CLASS object from bytearray

hash(self: SensordataLocal) int#

hash function implemented using binary_hash

info_string(self: SensordataLocal, float_precision: int = 2) str#

Return object information as string

property northing#

< in m, positive northwards

print(self: SensordataLocal, float_precision: int = 2) None#

Print object information

slow_hash(self: SensordataLocal) int#

hash function implemented using slow_hash

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

convert object to bytearray

class Sensordata#

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__(*args, **kwargs)#

Overloaded function.

  1. __init__(self: themachinethatgoesping.navigation.datastructures.Sensordata, arg0: themachinethatgoesping::navigation::datastructures::SensordataLatLon) -> None

Construct a new Sensordata object

  1. __init__(self: themachinethatgoesping.navigation.datastructures.Sensordata, arg0: themachinethatgoesping::navigation::datastructures::SensordataLocal) -> None

Construct a new Sensordata object

  1. __init__(self: themachinethatgoesping.navigation.datastructures.Sensordata, arg0: themachinethatgoesping::navigation::datastructures::SensordataUTM) -> None

Construct a new Sensordata object

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

copy(self: Sensordata) Sensordata#

return a copy using the c++ default copy constructor

property depth#

< in m, positive downwards

static from_binary(buffer: bytes, check_buffer_is_read_completely: bool = True) Sensordata#

create T_CLASS object from bytearray

hash(self: Sensordata) 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: Sensordata, float_precision: int = 2) str#

Return object information as string

property pitch#

< from attitude source, in °, positive means bow up

print(self: Sensordata, float_precision: int = 2) None#

Print object information

property roll#

< from attitude source, in °, positive means port up

slow_hash(self: Sensordata) int#

hash function implemented using slow_hash

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

convert object to bytearray