Pathfinding nach rechts funktioniert noch nicht...der rest schon
Dependencies: mbed
Fork of MicroMouse_MASTER_THREE by
CheckWalls.cpp
- Committer:
- ruesipat
- Date:
- 2018-03-31
- Revision:
- 1:d9e840c48b1e
- Child:
- 2:592f01278db4
File content as of revision 1:d9e840c48b1e:
#include <cmath> #include "CheckWalls.h" using namespace std; const float CheckWalls::WALL_DISTANCE = 20.0f; CheckWalls::CheckWalls(float distanceRight, float distanceFront, float distanceLeftFront, int& wallRight, int& wallFront, int& wallLeft): wallRight(wallRight), wallFront(wallFront), wallLeft(wallLeft) { this->distanceRight = distanceRight; this->distanceFront = distanceFront; this->distanceLeftFront = distanceLeftFront; } CheckWalls::~CheckWalls() {} void CheckWalls::check(){ if (distanceRight < WALL_DISTANCE){ //Abstand zur RECHTEN WAND wallRight = 1; //Wand }else{ wallRight = 0; //keine Wand } if (distanceFront < WALL_DISTANCE){ //Abstand zur WAND VORNE wallFront = 1; //Wand }else{ wallFront = 0; //Keine Wand } if (distanceLeftFront < WALL_DISTANCE){ //Anbstand zur LINKEN WAND wallLeft = 1; //Wand }else{ wallLeft = 0; //keine Wand } }