rome2_p6 imported

Dependencies:   mbed

Committer:
Appalco
Date:
Fri May 18 13:54:25 2018 +0000
Revision:
5:957580f33e52
Parent:
0:351a2fb21235
fixed tolerance and wayponts

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Appalco 0:351a2fb21235 1 /*
Appalco 0:351a2fb21235 2 * TaskMoveTo.h
Appalco 0:351a2fb21235 3 * Copyright (c) 2018, ZHAW
Appalco 0:351a2fb21235 4 * All rights reserved.
Appalco 0:351a2fb21235 5 */
Appalco 0:351a2fb21235 6
Appalco 0:351a2fb21235 7 #ifndef TASK_MOVE_TO_H_
Appalco 0:351a2fb21235 8 #define TASK_MOVE_TO_H_
Appalco 0:351a2fb21235 9
Appalco 0:351a2fb21235 10 #include <cstdlib>
Appalco 0:351a2fb21235 11 #include "Controller.h"
Appalco 0:351a2fb21235 12 #include "Task.h"
Appalco 0:351a2fb21235 13
Appalco 0:351a2fb21235 14 /**
Appalco 0:351a2fb21235 15 * This is a specific implementation of a task class that moves the robot to a given pose.
Appalco 0:351a2fb21235 16 */
Appalco 0:351a2fb21235 17 class TaskMoveTo : public Task {
Appalco 0:351a2fb21235 18
Appalco 0:351a2fb21235 19 public:
Appalco 0:351a2fb21235 20
Appalco 0:351a2fb21235 21 static const float DEFAULT_VELOCITY; /**< Default velocity value, given in [m/s]. */
Appalco 0:351a2fb21235 22 static const float DEFAULT_ZONE; /**< Default zone value, given in [m]. */
Appalco 0:351a2fb21235 23
Appalco 0:351a2fb21235 24 TaskMoveTo(Controller& controller, float x, float y, float alpha);
Appalco 0:351a2fb21235 25 TaskMoveTo(Controller& controller, float x, float y, float alpha, float velocity);
Appalco 0:351a2fb21235 26 TaskMoveTo(Controller& controller, float x, float y, float alpha, float velocity, float zone);
Appalco 0:351a2fb21235 27 virtual ~TaskMoveTo();
Appalco 0:351a2fb21235 28 virtual int run(float period);
Appalco 0:351a2fb21235 29
Appalco 0:351a2fb21235 30 private:
Appalco 0:351a2fb21235 31
Appalco 0:351a2fb21235 32 static const float PI;
Appalco 0:351a2fb21235 33 static const float K1;
Appalco 0:351a2fb21235 34 static const float K2;
Appalco 0:351a2fb21235 35 static const float K3;
Appalco 0:351a2fb21235 36
Appalco 0:351a2fb21235 37 Controller& controller; // reference to the controller object to use
Appalco 0:351a2fb21235 38 float x; // x coordinate of target position, given in [m]
Appalco 0:351a2fb21235 39 float y; // y coordinate of target position, given in [m]
Appalco 0:351a2fb21235 40 float alpha; // target orientation, given in [rad]
Appalco 0:351a2fb21235 41 float velocity; // maximum translational velocity, given in [m/s]
Appalco 0:351a2fb21235 42 float zone; // zone threshold around target position, given in [m]
Appalco 0:351a2fb21235 43 };
Appalco 0:351a2fb21235 44
Appalco 0:351a2fb21235 45 #endif /* TASK_MOVE_TO_H_ */
Appalco 0:351a2fb21235 46