From 7da669b97ec71f138c74d562b8a3b219d3f98a50 Mon Sep 17 00:00:00 2001 From: neoraider Date: Fri, 13 Apr 2007 17:58:03 +0000 Subject: Makefile angelegt; Grundfunktionen erweitert --- Navigation.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Navigation.h (limited to 'Navigation.h') diff --git a/Navigation.h b/Navigation.h new file mode 100644 index 0000000..561e342 --- /dev/null +++ b/Navigation.h @@ -0,0 +1,31 @@ +#ifndef _ROBOCUP_NAVIGATION_H_ +#define _ROBOCUP_NAVIGATION_H_ + +#include "Motor.h" +#include "util.h" + + +class Navigation { + private: + Motor *motors[3]; + float motorPos[3]; + + float speed; + float direction; + float spin; + + void update(); + public: + Navigation(Motor *m1, float p1, Motor *m2, float p2, Motor *m3, float p3); + + void setSpeed(float speed) {this->speed = CLAMP(0.0, speed, 1.0); update();} + float getSpeed() {return speed;} + + void setDirection(float direction) {this->direction = direction; update();} + float getDirection() {return direction;} + + void setSpin(float spin) {this->spin = CLAMP(-1.0, spin, 1.0); update();} + float getSpin() {return spin;} +}; + +#endif -- cgit v1.2.3