![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
mit pathdingsbums
Dependencies: mbed
Fork of MicroMouse_MASTER_TWO by
CheckWalls.cpp
- Committer:
- ruesipat
- Date:
- 2018-04-04
- Revision:
- 2:592f01278db4
- Parent:
- 1:d9e840c48b1e
- Child:
- 5:b8b1a979b0d5
File content as of revision 2:592f01278db4:
#include <cmath> #include "CheckWalls.h" using namespace std; const float CheckWalls::WALL_DISTANCE = 100.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 } }