TrekkingPhoenix / Mbed 2 deprecated TrekkingControllerV1-4_WinterChallenge20

Dependencies:   mbed mbed-rtos MotionSensor EthernetInterface

Committer:
drelliak
Date:
Sat Apr 23 03:55:39 2016 +0000
Revision:
8:a1067fcde341
Parent:
0:88faaa1afb83
Updated what we did last weekend

Who changed what in which revision?

UserRevisionLine numberNew 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 8:a1067fcde341 30 //ground velocity range
drelliak 8:a1067fcde341 31 #define GND_VEL_MIN -100.0
drelliak 8:a1067fcde341 32 #define GND_VEL_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 8:a1067fcde341 38 //jogging speed period (in seconds)
drelliak 8:a1067fcde341 39 #define JOG_VEL_PERIOD_MIN 0.0
drelliak 8:a1067fcde341 40 #define JOG_VEL_PERIOD_MAX 300.0
drelliak 8:a1067fcde341 41
drelliak 8:a1067fcde341 42 //jogging speed ratio
drelliak 8:a1067fcde341 43 #define JOG_VEL_RATIO_MIN 0.0
drelliak 8:a1067fcde341 44 #define JOG_VEL_RATIO_MAX 1.0
drelliak 8:a1067fcde341 45
drelliak 0:88faaa1afb83 46 //messages to send via protocol
drelliak 0:88faaa1afb83 47 enum
drelliak 0:88faaa1afb83 48 {
drelliak 0:88faaa1afb83 49 //do nothing
drelliak 0:88faaa1afb83 50 NONE,
drelliak 0:88faaa1afb83 51 //brake the robot
drelliak 0:88faaa1afb83 52 BRAKE,
drelliak 0:88faaa1afb83 53 //reset angle measure
drelliak 0:88faaa1afb83 54 ANG_RST,
drelliak 0:88faaa1afb83 55 //set new angle reference
drelliak 0:88faaa1afb83 56 ANG_REF,
drelliak 8:a1067fcde341 57 //set new ground velocity for robot
drelliak 8:a1067fcde341 58 GND_VEL,
drelliak 8:a1067fcde341 59 //set new jogging speed for robot
drelliak 8:a1067fcde341 60 JOG_VEL,
drelliak 0:88faaa1afb83 61 //send pid control parameters
drelliak 0:88faaa1afb83 62 PID_PARAMS
drelliak 0:88faaa1afb83 63 };
drelliak 0:88faaa1afb83 64
drelliak 8:a1067fcde341 65 #endif