new grid walkers + fixes new test-cases worked on step/and turn detection android offline-data-reader worked on vap-grouping
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
#ifndef WALKMODULE_H
|
|
#define WALKMODULE_H
|
|
|
|
#include "../../../Grid.h"
|
|
|
|
/** base-class for all WalkStates */
|
|
struct WalkState {
|
|
|
|
/** current position within the grid (-> in cm!) */
|
|
GridPoint position;
|
|
|
|
/** ctor */
|
|
explicit WalkState(const GridPoint& position) : position(position) {;}
|
|
|
|
};
|
|
|
|
|
|
/**
|
|
* base-class for all walk-modules that influence p(e)
|
|
*/
|
|
template <typename Node, typename WalkState> class WalkModule {
|
|
|
|
public:
|
|
|
|
/** update the given WalkState before starting the walk. e.g. based on sensor readings */
|
|
virtual void updateBefore(WalkState& state) = 0;
|
|
|
|
/** get the probability p(e) from curNode to potentialNode */
|
|
virtual double getProbability(const WalkState& state, const Node& startNode, const Node& curNode, const Node& potentialNode) const = 0;
|
|
|
|
/** one step (edge) is taken */
|
|
virtual void step(WalkState& state, const Node& curNode, const Node& nextNode) = 0;
|
|
|
|
/** update the walk state based on the given transition (if any update is necssary) */
|
|
virtual void updateAfter(WalkState& state, const Node& startNode, const Node& endNode) = 0;
|
|
|
|
};
|
|
|
|
#endif // WALKMODULE_H
|