Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of ROME2_P3 by
TaskMove.h@6:67263dc2c2cf, 2018-04-26 (annotated)
- Committer:
- matajarb
- Date:
- Thu Apr 26 12:22:58 2018 +0000
- Revision:
- 6:67263dc2c2cf
s?mme du schluch
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
matajarb | 6:67263dc2c2cf | 1 | /* |
matajarb | 6:67263dc2c2cf | 2 | * TaskMove.h |
matajarb | 6:67263dc2c2cf | 3 | * Copyright (c) 2018, ZHAW |
matajarb | 6:67263dc2c2cf | 4 | * All rights reserved. |
matajarb | 6:67263dc2c2cf | 5 | */ |
matajarb | 6:67263dc2c2cf | 6 | |
matajarb | 6:67263dc2c2cf | 7 | #ifndef TASK_MOVE_H_ |
matajarb | 6:67263dc2c2cf | 8 | #define TASK_MOVE_H_ |
matajarb | 6:67263dc2c2cf | 9 | |
matajarb | 6:67263dc2c2cf | 10 | #include <cstdlib> |
matajarb | 6:67263dc2c2cf | 11 | #include "Controller.h" |
matajarb | 6:67263dc2c2cf | 12 | #include "Task.h" |
matajarb | 6:67263dc2c2cf | 13 | |
matajarb | 6:67263dc2c2cf | 14 | /** |
matajarb | 6:67263dc2c2cf | 15 | * This is a specific implementation of a task class that moves the robot with given velocities. |
matajarb | 6:67263dc2c2cf | 16 | */ |
matajarb | 6:67263dc2c2cf | 17 | class TaskMove : public Task { |
matajarb | 6:67263dc2c2cf | 18 | |
matajarb | 6:67263dc2c2cf | 19 | public: |
matajarb | 6:67263dc2c2cf | 20 | |
matajarb | 6:67263dc2c2cf | 21 | static const float DEFAULT_DURATION; /**< Default duration, given in [s]. */ |
matajarb | 6:67263dc2c2cf | 22 | |
matajarb | 6:67263dc2c2cf | 23 | TaskMove(Controller& controller, float translationalVelocity, float rotationalVelocity); |
matajarb | 6:67263dc2c2cf | 24 | TaskMove(Controller& controller, float translationalVelocity, float rotationalVelocity, float duration); |
matajarb | 6:67263dc2c2cf | 25 | virtual ~TaskMove(); |
matajarb | 6:67263dc2c2cf | 26 | virtual int run(float period); |
matajarb | 6:67263dc2c2cf | 27 | |
matajarb | 6:67263dc2c2cf | 28 | private: |
matajarb | 6:67263dc2c2cf | 29 | |
matajarb | 6:67263dc2c2cf | 30 | Controller& controller; // reference to controller object to use |
matajarb | 6:67263dc2c2cf | 31 | float translationalVelocity; // translational velocity, given in [m/s] |
matajarb | 6:67263dc2c2cf | 32 | float rotationalVelocity; // rotational velocity, given in [rad/s] |
matajarb | 6:67263dc2c2cf | 33 | float duration; // duration to move the robot, given in [s] |
matajarb | 6:67263dc2c2cf | 34 | float time; // current time, given in [s] |
matajarb | 6:67263dc2c2cf | 35 | }; |
matajarb | 6:67263dc2c2cf | 36 | |
matajarb | 6:67263dc2c2cf | 37 | #endif /* TASK_MOVE_H_ */ |
matajarb | 6:67263dc2c2cf | 38 |