ROME_P5
Dependencies: mbed
TaskMoveTo.h@0:29be10cb0afc, 2018-04-27 (annotated)
- Committer:
- Inaueadr
- Date:
- Fri Apr 27 08:47:34 2018 +0000
- Revision:
- 0:29be10cb0afc
Hallo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Inaueadr | 0:29be10cb0afc | 1 | /* |
Inaueadr | 0:29be10cb0afc | 2 | * TaskMoveTo.h |
Inaueadr | 0:29be10cb0afc | 3 | * Copyright (c) 2018, ZHAW |
Inaueadr | 0:29be10cb0afc | 4 | * All rights reserved. |
Inaueadr | 0:29be10cb0afc | 5 | */ |
Inaueadr | 0:29be10cb0afc | 6 | |
Inaueadr | 0:29be10cb0afc | 7 | #ifndef TASK_MOVE_TO_H_ |
Inaueadr | 0:29be10cb0afc | 8 | #define TASK_MOVE_TO_H_ |
Inaueadr | 0:29be10cb0afc | 9 | |
Inaueadr | 0:29be10cb0afc | 10 | #include <cstdlib> |
Inaueadr | 0:29be10cb0afc | 11 | #include "Controller.h" |
Inaueadr | 0:29be10cb0afc | 12 | #include "Task.h" |
Inaueadr | 0:29be10cb0afc | 13 | |
Inaueadr | 0:29be10cb0afc | 14 | /** |
Inaueadr | 0:29be10cb0afc | 15 | * This is a specific implementation of a task class that moves the robot to a given pose. |
Inaueadr | 0:29be10cb0afc | 16 | */ |
Inaueadr | 0:29be10cb0afc | 17 | class TaskMoveTo : public Task { |
Inaueadr | 0:29be10cb0afc | 18 | |
Inaueadr | 0:29be10cb0afc | 19 | public: |
Inaueadr | 0:29be10cb0afc | 20 | |
Inaueadr | 0:29be10cb0afc | 21 | static const float DEFAULT_VELOCITY; /**< Default velocity value, given in [m/s]. */ |
Inaueadr | 0:29be10cb0afc | 22 | static const float DEFAULT_ZONE; /**< Default zone value, given in [m]. */ |
Inaueadr | 0:29be10cb0afc | 23 | |
Inaueadr | 0:29be10cb0afc | 24 | TaskMoveTo(Controller& controller, float x, float y, float alpha); |
Inaueadr | 0:29be10cb0afc | 25 | TaskMoveTo(Controller& controller, float x, float y, float alpha, float velocity); |
Inaueadr | 0:29be10cb0afc | 26 | TaskMoveTo(Controller& controller, float x, float y, float alpha, float velocity, float zone); |
Inaueadr | 0:29be10cb0afc | 27 | virtual ~TaskMoveTo(); |
Inaueadr | 0:29be10cb0afc | 28 | virtual int run(float period); |
Inaueadr | 0:29be10cb0afc | 29 | |
Inaueadr | 0:29be10cb0afc | 30 | private: |
Inaueadr | 0:29be10cb0afc | 31 | |
Inaueadr | 0:29be10cb0afc | 32 | static const float PI; |
Inaueadr | 0:29be10cb0afc | 33 | static const float K1; |
Inaueadr | 0:29be10cb0afc | 34 | static const float K2; |
Inaueadr | 0:29be10cb0afc | 35 | static const float K3; |
Inaueadr | 0:29be10cb0afc | 36 | |
Inaueadr | 0:29be10cb0afc | 37 | Controller& controller; // reference to the controller object to use |
Inaueadr | 0:29be10cb0afc | 38 | float x; // x coordinate of target position, given in [m] |
Inaueadr | 0:29be10cb0afc | 39 | float y; // y coordinate of target position, given in [m] |
Inaueadr | 0:29be10cb0afc | 40 | float alpha; // target orientation, given in [rad] |
Inaueadr | 0:29be10cb0afc | 41 | float velocity; // maximum translational velocity, given in [m/s] |
Inaueadr | 0:29be10cb0afc | 42 | float zone; // zone threshold around target position, given in [m] |
Inaueadr | 0:29be10cb0afc | 43 | }; |
Inaueadr | 0:29be10cb0afc | 44 | |
Inaueadr | 0:29be10cb0afc | 45 | #endif /* TASK_MOVE_TO_H_ */ |
Inaueadr | 0:29be10cb0afc | 46 |