102
edits
No edit summary |
|||
Line 18: | Line 18: | ||
* Apply: applies the integrator algorithm to the entry orientation data. | * Apply: applies the integrator algorithm to the entry orientation data. | ||
* Reset: sets the initial orientation and its initial time to a desired value. | * Reset: sets the initial orientation and its initial time to a desired value. | ||
==== Defining the Apply method ==== | ==== Defining the Apply method ==== | ||
This method receives two parameters: | This method receives two parameters: | ||
* | * softengyro: This contains the result of integrating the initial orientation data, it contains a vector of orientation values represented as a Quaternion with their corresponding timestamps. | ||
* | * rawgyro: This parameter contains the data from sensors, could have data from gyroscope, accelerometer and magnetometer. | ||
<syntaxhighlight lang=c++> | <syntaxhighlight lang=c++> | ||
RuntimeError | RuntimeError ExampleIntegrator::Apply( | ||
std::vector<std::pair<Quaternion<double>, uint64_t>>& | std::vector<std::pair<Quaternion<double>, uint64_t>>& softengyro, | ||
std::vector< | const std::vector<SensorPayload> rawgyro) { | ||
RuntimeError ret{}; | RuntimeError ret{}; | ||
/* | /* Integrator algorithm logic */ | ||
return ret; | return ret; | ||
Line 38: | Line 38: | ||
==== Defining the Reset method ==== | ==== Defining the Reset method ==== | ||
This method receives an | This method receives an orientation value as parameter and a time value (in microseconds) as parameter and sets the IIntegrator initial orientation member and the initial time member. | ||
<syntaxhighlight lang=c++> | <syntaxhighlight lang=c++> | ||
RuntimeError | RuntimeError SimpleComplementaryIntegrator::Reset( | ||
const Quaternion<double> initial_orient, const uint64_t initial_time) { | |||
RuntimeError ret{}; | RuntimeError ret{}; | ||
/* Reset | /* Reset initial orientation and initial time logic */ | ||
this->initial_orient_ = /* logic result */; | |||
this->initial_time_ = /* logic result */; | |||
return ret; | return ret; | ||
Line 103: | Line 107: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Interpolator == | == Interpolator == |
edits