Zürcher Eliteeinheit / Mbed 2 deprecated ROME2_P6

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TaskMoveToWaypoint.h Source File

TaskMoveToWaypoint.h

00001 /*
00002  * TaskMoveToWaypoint.h
00003  * Copyright (c) 2018, ZHAW
00004  * All rights reserved.
00005  */
00006 
00007 #ifndef TASK_MOVE_TO_WAYPOINT_H_
00008 #define TASK_MOVE_TO_WAYPOINT_H_
00009 
00010 #include <cstdlib>
00011 #include "Controller.h"
00012 #include "Task.h"
00013 
00014 /**
00015  * This is a specific implementation of a task class that moves the robot to a given waypoint.
00016  */
00017 class TaskMoveToWaypoint : public Task {
00018     
00019     public:
00020         
00021         static const float  DEFAULT_VELOCITY;   /**< Default velocity value, given in [m/s]. */
00022         
00023                     TaskMoveToWaypoint(Controller& controller, float x, float y);
00024                     TaskMoveToWaypoint(Controller& controller, float x, float y, float velocity);
00025         virtual     ~TaskMoveToWaypoint();
00026         virtual int run(float period);
00027         
00028     private:
00029         
00030         static const float  PI;
00031         static const float  K;
00032         
00033         Controller& controller;         // reference to the controller object to use
00034         float       x;                  // x coordinate of target position, given in [m]
00035         float       y;                  // y coordinate of target position, given in [m]
00036         float       velocity;           // maximum translational velocity, given in [m/s]
00037         float       initialDistance;    // initial distance to waypoint, given in [m]
00038 };
00039 
00040 #endif /* TASK_MOVE_TO_WAYPOINT_H_ */
00041