fixed compile issue
This commit is contained in:
@@ -12,41 +12,6 @@
|
|||||||
|
|
||||||
#include "../../../../geo/Heading.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) {;}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,10 @@ public:
|
|||||||
dist(Distribution::VonMises<double>(0.0f, 2.0).getLUT()),
|
dist(Distribution::VonMises<double>(0.0f, 2.0).getLUT()),
|
||||||
distNoise(0, Angle::degToRad(sensorNoiseDegreesSigma)),
|
distNoise(0, Angle::degToRad(sensorNoiseDegreesSigma)),
|
||||||
ctrl(ctrl) {
|
ctrl(ctrl) {
|
||||||
;
|
|
||||||
|
// ensure the template WalkState inherits from 'WalkStateHeading'!
|
||||||
|
StaticAssert::AinheritsB<WalkState, WalkStateHeading>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,43 @@
|
|||||||
#ifndef WALKSTATEHEADING_H
|
#ifndef WALKSTATEHEADING_H
|
||||||
#define 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) {;}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -65,13 +65,13 @@ TEST(Stairs, live_testWalk) {
|
|||||||
WalkModuleFavorZ<MyNode345092134, MyState102395234> modFavorZ;
|
WalkModuleFavorZ<MyNode345092134, MyState102395234> modFavorZ;
|
||||||
WalkModuleSpread<MyNode345092134, MyState102395234> modSpread;
|
WalkModuleSpread<MyNode345092134, MyState102395234> modSpread;
|
||||||
WalkModuleNodeImportance<MyNode345092134, MyState102395234> modImp;
|
WalkModuleNodeImportance<MyNode345092134, MyState102395234> modImp;
|
||||||
WalkModulePreventVisited<MyNode345092134, MyState102395234> modSkipDup;
|
//WalkModulePreventVisited<MyNode345092134, MyState102395234> modSkipDup;
|
||||||
//WalkModuleHeading<MyNode345092134, MyState102395234> modHead;
|
//WalkModuleHeading<MyNode345092134, MyState102395234> modHead;
|
||||||
|
|
||||||
gw.addModule(&modImp);
|
gw.addModule(&modImp);
|
||||||
gw.addModule(&modFavorZ);
|
gw.addModule(&modFavorZ);
|
||||||
gw.addModule(&modSpread);
|
gw.addModule(&modSpread);
|
||||||
gw.addModule(&modSkipDup);
|
//gw.addModule(&modSkipDup);
|
||||||
//gw.addModule(&modHead);
|
//gw.addModule(&modHead);
|
||||||
|
|
||||||
for (int run = 0; run < 5000; ++run) {
|
for (int run = 0; run < 5000; ++run) {
|
||||||
|
|||||||
Reference in New Issue
Block a user