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