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 * TaskMove.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_H_
Appalco 0:351a2fb21235 8 #define TASK_MOVE_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 with given velocities.
Appalco 0:351a2fb21235 16 */
Appalco 0:351a2fb21235 17 class TaskMove : public Task {
Appalco 0:351a2fb21235 18
Appalco 0:351a2fb21235 19 public:
Appalco 0:351a2fb21235 20
Appalco 0:351a2fb21235 21 static const float DEFAULT_DURATION; /**< Default duration, given in [s]. */
Appalco 0:351a2fb21235 22
Appalco 0:351a2fb21235 23 TaskMove(Controller& controller, float translationalVelocity, float rotationalVelocity);
Appalco 0:351a2fb21235 24 TaskMove(Controller& controller, float translationalVelocity, float rotationalVelocity, float duration);
Appalco 0:351a2fb21235 25 virtual ~TaskMove();
Appalco 0:351a2fb21235 26 virtual int run(float period);
Appalco 0:351a2fb21235 27
Appalco 0:351a2fb21235 28 private:
Appalco 0:351a2fb21235 29
Appalco 0:351a2fb21235 30 Controller& controller; // reference to controller object to use
Appalco 0:351a2fb21235 31 float translationalVelocity; // translational velocity, given in [m/s]
Appalco 0:351a2fb21235 32 float rotationalVelocity; // rotational velocity, given in [rad/s]
Appalco 0:351a2fb21235 33 float duration; // duration to move the robot, given in [s]
Appalco 0:351a2fb21235 34 float time; // current time, given in [s]
Appalco 0:351a2fb21235 35 };
Appalco 0:351a2fb21235 36
Appalco 0:351a2fb21235 37 #endif /* TASK_MOVE_H_ */
Appalco 0:351a2fb21235 38