many changes and updates
- changed the wifi-estimation api - adjusted test-cases - worked on grid-bulding and grid-importance - new walking modules - fixed some minor issues
This commit is contained in:
54
grid/walk/v2/modules/WalkModuleFavorZ.h
Normal file
54
grid/walk/v2/modules/WalkModuleFavorZ.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#ifndef WALKMODULEFAVORZ_H
|
||||
#define WALKMODULEFAVORZ_H
|
||||
|
||||
#include "WalkModule.h"
|
||||
#include "WalkStateHeading.h"
|
||||
|
||||
#include "../../../../geo/Heading.h"
|
||||
#include "../../../../math/Distributions.h"
|
||||
|
||||
|
||||
/** favor z-transitions */
|
||||
template <typename Node, typename WalkState> class WalkModuleFavorZ : public WalkModule<Node, WalkState> {
|
||||
|
||||
public:
|
||||
|
||||
/** ctor */
|
||||
WalkModuleFavorZ() {
|
||||
;
|
||||
}
|
||||
|
||||
virtual void updateBefore(WalkState& state) override {
|
||||
(void) state;
|
||||
}
|
||||
|
||||
virtual void updateAfter(WalkState& state, const Node& startNode, const Node& endNode) override {
|
||||
(void) state;
|
||||
(void) startNode;
|
||||
(void) endNode;
|
||||
|
||||
}
|
||||
|
||||
virtual void step(WalkState& state, const Node& curNode, const Node& nextNode) override {
|
||||
(void) state;
|
||||
(void) curNode;
|
||||
(void) nextNode;
|
||||
}
|
||||
|
||||
double getProbability(const WalkState& state, const Node& startNode, const Node& curNode, const Node& potentialNode) const override {
|
||||
|
||||
(void) state;
|
||||
(void) startNode;
|
||||
|
||||
if (curNode.z_cm != potentialNode.z_cm) {
|
||||
return 8;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // WALKMODULEFAVORZ_H
|
||||
@@ -26,14 +26,14 @@ private:
|
||||
public:
|
||||
|
||||
/** ctor 3.0 should be OK! */
|
||||
WalkModuleHeadingControl(Control* ctrl) : dist(Distribution::VonMises<double>(0.0f, 1.5).getLUT()), draw(dist.getDrawList()), ctrl(ctrl) {
|
||||
WalkModuleHeadingControl(Control* ctrl) : dist(Distribution::VonMises<double>(0.0f, 2.0).getLUT()), draw(dist.getDrawList()), ctrl(ctrl) {
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
virtual void updateBefore(WalkState& state) override {
|
||||
|
||||
const float var = draw.get() * 0.15;//0.05;
|
||||
const float var = draw.get() * 0.20;//0.05;
|
||||
//const float var = 0;
|
||||
state.startHeading += ctrl->turnAngle + var;
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ public:
|
||||
(void) curNode;
|
||||
|
||||
const double prob = potentialNode.getNavImportance();
|
||||
return std::pow(prob, 10);
|
||||
//return prob;
|
||||
//return std::pow(prob, 10);
|
||||
return prob;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user