TrekkingPhoenix / Mbed 2 deprecated TrekkingControllerV1-4_WinterChallenge20

Dependencies:   mbed mbed-rtos MotionSensor EthernetInterface

Protocol/protocol.h

Committer:
drelliak
Date:
2016-04-23
Revision:
8:a1067fcde341
Parent:
0:88faaa1afb83

File content as of revision 8:a1067fcde341:

/*
Copyright 2016 Erik Perillo <erik.perillo@gmail.com>

This file is part of piranha-ptc.

This is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this. If not, see <http://www.gnu.org/licenses/>.
*/


#ifndef __PIRANHA_PROTOCOL_H__
#define __PIRANHA_PROTOCOL_H__

#define PI 3.141593

//pid values range
#define PID_PARAMS_MIN -100.0
#define PID_PARAMS_MAX 100.0

//ground velocity range
#define GND_VEL_MIN -100.0
#define GND_VEL_MAX 100.0

//angle reference range (in radians)
#define ANG_REF_MIN -PI
#define ANG_REF_MAX PI

//jogging speed period (in seconds)
#define JOG_VEL_PERIOD_MIN 0.0
#define JOG_VEL_PERIOD_MAX 300.0

//jogging speed ratio
#define JOG_VEL_RATIO_MIN 0.0
#define JOG_VEL_RATIO_MAX 1.0

//messages to send via protocol
enum
{
    //do nothing
    NONE,
    //brake the robot
    BRAKE,
    //reset angle measure
    ANG_RST,
    //set new angle reference
    ANG_REF,
    //set new ground velocity for robot
    GND_VEL,
    //set new jogging speed for robot
    JOG_VEL,
    //send pid control parameters
    PID_PARAMS
};

#endif