gugus

Dependencies:   mbed

Committer:
Brignall
Date:
Fri May 18 12:18:21 2018 +0000
Revision:
0:1a0321f1ffbc
lala;

Who changed what in which revision?

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