UVic Assistive Technology Lab / Mbed 2 deprecated DSLR_Camera_Gimbal

Dependencies:   mbed ros_lib_kinetic

definitions.h

Committer:
MikeGray92
Date:
2018-03-14
Revision:
7:950b3c3b5a2b
Parent:
6:2ffa254e8f6e
Child:
10:836e701d00a6

File content as of revision 7:950b3c3b5a2b:

#ifndef __DEFINITIONS_H__
#define __DEFINITIONS_H__

#include "mbed.h"
#include <BNO055.h>
#include <Mx28.h>

// Generic definitions
#define     TRUE            1
#define     FALSE           0

// ROS definitions
#define     ROSDATALENGTH   5
#define     ROSYAW          2
#define     ROSPITCH        1
#define     ROSROLL         0
#define     ROSHEIGHT       3
#define     ROSMODE         4

// Gimbal definitions
#define     YAWID           1
#define     PITCHID         2
#define     ROLLID          3
#define     YAWZERO         2015
#define     PITCHZERO       2350
#define     ROLLZERO        2302
#define     YAWMIN          0       // -177 degrees.
#define     YAWMAX          4063    // +177 degrees.
#define     PITCHMIN        1326    // -90 degrees.
#define     PITCHMAX        3000    // +90 degrees is at 3374
#define     ROLLMIN         2100    // -90 degrees is at 1278
#define     ROLLMAX         2500   // +90 degrees is at 3374 

// Lift definitions
#define     LIFTUP          0
#define     LIFTDOWN        1
#define     LIFTHEIGHTMAX   3000 // 119.6 cm should be 3000
#define     LIFTHEIGHTMIN   5 //51.6 cm
// Delta Height for Lift is 68cm

// Classes
struct fields{
volatile int        yaw;
int                 yawSpeed;
volatile int        pitch;
int                 pitchSpeed;
volatile int        roll;
int                 rollSpeed;
volatile  int       height;
bool                stabilize;
bool                masterOn;
bool                liftRun;
bool                gimbalRun;
bool                shutdown;
bool                initialize;
volatile int        mode;
};

extern struct           fields          control;
extern struct           fields          rosInput;
extern volatile int     currentPosition;
extern int              prevPosition;
extern bool             stall;
extern bool             rosFlag;
extern int              stallcount;
extern Ticker           hallInt;
extern Timer            filter_hall1;
extern Timer            rosMode_Delay;
extern PwmOut           liftSpeed;
extern DigitalOut       liftDirection;
extern DynamixelClass   gimbal;

#endif