UVic Assistive Technology Lab / Mbed 2 deprecated DSLR_Camera_Gimbal

Dependencies:   mbed ros_lib_kinetic

definitions.h

Committer:
MikeGray92
Date:
2018-02-08
Revision:
2:0537a8007a39
Parent:
1:1ac7d472cfa2
Child:
3:527f0b949839

File content as of revision 2:0537a8007a39:

#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     ROSCONTROL      0
#define     ROSYAW          1
#define     ROSPITCH        2
#define     ROSROLL         3
#define     ROSHEIGHT       4
#define     ROSMODE         5

// 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        3374    // +90 degrees.
#define     ROLLMIN         1278    // -90 degrees.
#define     ROLLMAX         3326    // +90 degrees.

// Lift definitions
#define     LIFTUP          0
#define     LIFTDOWN        1
#define     LIFTHEIGHTMAX   3000 
#define     LIFTHEIGHTMIN   5


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

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

#endif