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.
Dependencies: mbed mbed-rtos MotionSensor EthernetInterface
Protocol/protocol.h@13:f7a7fe9b5c00, 2016-04-30 (annotated)
- Committer:
- drelliak
- Date:
- Sat Apr 30 21:28:27 2016 +0000
- Revision:
- 13:f7a7fe9b5c00
- Parent:
- 0:88faaa1afb83
- Child:
- 8:a1067fcde341
minor fixes
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| drelliak | 0:88faaa1afb83 | 1 | /* |
| drelliak | 0:88faaa1afb83 | 2 | Copyright 2016 Erik Perillo <erik.perillo@gmail.com> |
| drelliak | 0:88faaa1afb83 | 3 | |
| drelliak | 0:88faaa1afb83 | 4 | This file is part of piranha-ptc. |
| drelliak | 0:88faaa1afb83 | 5 | |
| drelliak | 0:88faaa1afb83 | 6 | This is free software: you can redistribute it and/or modify |
| drelliak | 0:88faaa1afb83 | 7 | it under the terms of the GNU General Public License as published by |
| drelliak | 0:88faaa1afb83 | 8 | the Free Software Foundation, either version 3 of the License, or |
| drelliak | 0:88faaa1afb83 | 9 | (at your option) any later version. |
| drelliak | 0:88faaa1afb83 | 10 | |
| drelliak | 0:88faaa1afb83 | 11 | This is distributed in the hope that it will be useful, |
| drelliak | 0:88faaa1afb83 | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| drelliak | 0:88faaa1afb83 | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| drelliak | 0:88faaa1afb83 | 14 | See the GNU General Public License for more details. |
| drelliak | 0:88faaa1afb83 | 15 | |
| drelliak | 0:88faaa1afb83 | 16 | You should have received a copy of the GNU General Public License |
| drelliak | 0:88faaa1afb83 | 17 | along with this. If not, see <http://www.gnu.org/licenses/>. |
| drelliak | 0:88faaa1afb83 | 18 | */ |
| drelliak | 0:88faaa1afb83 | 19 | |
| drelliak | 0:88faaa1afb83 | 20 | |
| drelliak | 0:88faaa1afb83 | 21 | #ifndef __PIRANHA_PROTOCOL_H__ |
| drelliak | 0:88faaa1afb83 | 22 | #define __PIRANHA_PROTOCOL_H__ |
| drelliak | 0:88faaa1afb83 | 23 | |
| drelliak | 0:88faaa1afb83 | 24 | #define PI 3.141593 |
| drelliak | 0:88faaa1afb83 | 25 | |
| drelliak | 0:88faaa1afb83 | 26 | //pid values range |
| drelliak | 0:88faaa1afb83 | 27 | #define PID_PARAMS_MIN -100.0 |
| drelliak | 0:88faaa1afb83 | 28 | #define PID_PARAMS_MAX 100.0 |
| drelliak | 0:88faaa1afb83 | 29 | |
| drelliak | 0:88faaa1afb83 | 30 | //ground speed range |
| drelliak | 0:88faaa1afb83 | 31 | #define GND_SPEED_MIN -100.0 |
| drelliak | 0:88faaa1afb83 | 32 | #define GND_SPEED_MAX 100.0 |
| drelliak | 0:88faaa1afb83 | 33 | |
| drelliak | 0:88faaa1afb83 | 34 | //angle reference range (in radians) |
| drelliak | 0:88faaa1afb83 | 35 | #define ANG_REF_MIN -PI |
| drelliak | 0:88faaa1afb83 | 36 | #define ANG_REF_MAX PI |
| drelliak | 0:88faaa1afb83 | 37 | |
| drelliak | 0:88faaa1afb83 | 38 | //messages to send via protocol |
| drelliak | 0:88faaa1afb83 | 39 | enum |
| drelliak | 0:88faaa1afb83 | 40 | { |
| drelliak | 0:88faaa1afb83 | 41 | //do nothing |
| drelliak | 0:88faaa1afb83 | 42 | NONE, |
| drelliak | 0:88faaa1afb83 | 43 | //brake the robot |
| drelliak | 0:88faaa1afb83 | 44 | BRAKE, |
| drelliak | 0:88faaa1afb83 | 45 | //reset angle measure |
| drelliak | 0:88faaa1afb83 | 46 | ANG_RST, |
| drelliak | 0:88faaa1afb83 | 47 | //set new angle reference |
| drelliak | 0:88faaa1afb83 | 48 | ANG_REF, |
| drelliak | 0:88faaa1afb83 | 49 | //set new ground speed for robot |
| drelliak | 0:88faaa1afb83 | 50 | GND_SPEED, |
| drelliak | 0:88faaa1afb83 | 51 | //send pid control parameters |
| drelliak | 0:88faaa1afb83 | 52 | PID_PARAMS |
| drelliak | 0:88faaa1afb83 | 53 | }; |
| drelliak | 0:88faaa1afb83 | 54 | |
| drelliak | 0:88faaa1afb83 | 55 | #endif |