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
# - 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

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 implicit 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

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

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

convert object to bytearray

class SensorDataUTM
__init__(*args, **kwargs)

Overloaded function.

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

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

  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 implicit conversion from SensorDataLatLon class)

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

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

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

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

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

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

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

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

convert object to bytearray