mars_lib  0.1.0.3dc76ee85e09
Modular and Robust Sensor-Fusion
Public Member Functions | Private Attributes | List of all members
mars::GPSInit Class Reference

The GPSInit class is an initializer for calculating the average coordinates over a given time window. More...

#include </home/runner/work/mars_lib/mars_lib/source/mars/include/mars/sensors/gps/gps_utils.h>

+ Collaboration diagram for mars::GPSInit:

Public Member Functions

 GPSInit ()=default
 
 GPSInit (const double &init_duration)
 
void Reset ()
 Reset resets the initialization routine. More...
 
GpsCoordinates get_gps_mean (const std::shared_ptr< SensorAbsClass > &sensor_handle, const Buffer &buffer, const GpsCoordinates &cur_meas, const Time &cur_time)
 get_gps_mean calculates the mean over the given time window using the measurements in the buffer More...
 
void set_done ()
 set_done sets the routine to done, even if no calculation was yet performed or unsuccesful More...
 
bool IsDone () const
 IsDone returns the value of b_is_initialized_. More...
 

Private Attributes

double init_duration_ { 1.0 }
 window time to use measurements from More...
 
bool b_is_initialized_ { false }
 flag that determines if any previous initialization was successful More...
 
bool b_verbose_ { false }
 enable/disable output (currently hardcoded) More...
 

Detailed Description

The GPSInit class is an initializer for calculating the average coordinates over a given time window.

Constructor & Destructor Documentation

◆ GPSInit() [1/2]

mars::GPSInit::GPSInit ( )
default

◆ GPSInit() [2/2]

mars::GPSInit::GPSInit ( const double &  init_duration)

Member Function Documentation

◆ Reset()

void mars::GPSInit::Reset ( )

Reset resets the initialization routine.

◆ get_gps_mean()

GpsCoordinates mars::GPSInit::get_gps_mean ( const std::shared_ptr< SensorAbsClass > &  sensor_handle,
const Buffer buffer,
const GpsCoordinates cur_meas,
const Time cur_time 
)

get_gps_mean calculates the mean over the given time window using the measurements in the buffer

Parameters
sensor_handlesensor handle to use
buffermars::Buffer to retrieve measurements from
cur_meascurrent measurement (returned if none found in buffer)
cur_timecurrent time (returned if none found in buffer)
Returns
the mean of the GPSCoordinates within the time window

◆ set_done()

void mars::GPSInit::set_done ( )

set_done sets the routine to done, even if no calculation was yet performed or unsuccesful

◆ IsDone()

bool mars::GPSInit::IsDone ( ) const

IsDone returns the value of b_is_initialized_.

Returns
true if initialization was succesful

Member Data Documentation

◆ init_duration_

double mars::GPSInit::init_duration_ { 1.0 }
private

window time to use measurements from

◆ b_is_initialized_

bool mars::GPSInit::b_is_initialized_ { false }
private

flag that determines if any previous initialization was successful

◆ b_verbose_

bool mars::GPSInit::b_verbose_ { false }
private

enable/disable output (currently hardcoded)


The documentation for this class was generated from the following file: