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 * TaskMoveToWaypoint.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_WAYPOINT_H_
Appalco 0:351a2fb21235 8 #define TASK_MOVE_TO_WAYPOINT_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 waypoint.
Appalco 0:351a2fb21235 16 */
Appalco 0:351a2fb21235 17 class TaskMoveToWaypoint : 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
Appalco 0:351a2fb21235 23 TaskMoveToWaypoint(Controller& controller, float x, float y);
Appalco 0:351a2fb21235 24 TaskMoveToWaypoint(Controller& controller, float x, float y, float velocity);
Appalco 0:351a2fb21235 25 virtual ~TaskMoveToWaypoint();
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 static const float PI;
Appalco 0:351a2fb21235 31 static const float K;
Appalco 0:351a2fb21235 32
Appalco 0:351a2fb21235 33 Controller& controller; // reference to the controller object to use
Appalco 0:351a2fb21235 34 float x; // x coordinate of target position, given in [m]
Appalco 0:351a2fb21235 35 float y; // y coordinate of target position, given in [m]
Appalco 0:351a2fb21235 36 float velocity; // maximum translational velocity, given in [m/s]
Appalco 0:351a2fb21235 37 float initialDistance; // initial distance to waypoint, given in [m]
Appalco 0:351a2fb21235 38 };
Appalco 0:351a2fb21235 39
Appalco 0:351a2fb21235 40 #endif /* TASK_MOVE_TO_WAYPOINT_H_ */
Appalco 0:351a2fb21235 41