new grid walkers + fixes new test-cases worked on step/and turn detection android offline-data-reader worked on vap-grouping
44 lines
985 B
C
44 lines
985 B
C
#ifndef WALKSTATEHEADING_H
|
|
#define WALKSTATEHEADING_H
|
|
|
|
#include "../../../../geo/Heading.h"
|
|
|
|
/**
|
|
* base-class e.g. needed for GridWalkHeading and GridWalkHeadingControl to work
|
|
*/
|
|
struct WalkStateHeading {
|
|
|
|
/** used for better naming: heading.error instead of headingError */
|
|
struct _Heading {
|
|
|
|
/**
|
|
* the direction [0:2pi] the walk should move to
|
|
* e.g. indiciated by:
|
|
* compass
|
|
* integration over gyroscope values
|
|
*/
|
|
Heading direction;
|
|
|
|
/**
|
|
* (cumulative) error between walked edges and requested direction (above).
|
|
* is used to ensure that (even though the grid contains only 45° edges) we
|
|
* approximately walk into the requested direction.
|
|
*/
|
|
float error = 0;
|
|
|
|
/** ctor */
|
|
_Heading(const Heading direction, const float error) : direction(direction), error(error) {;}
|
|
|
|
} heading;
|
|
|
|
|
|
|
|
|
|
/** ctor */
|
|
explicit WalkStateHeading(const Heading& direction, const float error) : heading(direction, error) {;}
|
|
|
|
};
|
|
|
|
|
|
#endif // WALKSTATEHEADING_H
|