UVic Assistive Technology Lab / Mbed 2 deprecated DSLR_Camera_Gimbal

Dependencies:   mbed ros_lib_kinetic

Committer:
MikeGray92
Date:
Wed Mar 14 19:33:08 2018 +0000
Revision:
7:950b3c3b5a2b
Parent:
6:2ffa254e8f6e
Child:
10:836e701d00a6
Tested with ROS; Added Initialized ROS Inputs to avoid errors at start up; Limit the roll movement, to allow greater pitch movement; In Bed Chatting mode changed to rosInput.mode = 4 and Standing Chatting mode changed to rosInput.mode = 2.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
group-UVic-Assistive-Technolog 0:3a767f41cf04 1 #ifndef __DEFINITIONS_H__
group-UVic-Assistive-Technolog 0:3a767f41cf04 2 #define __DEFINITIONS_H__
group-UVic-Assistive-Technolog 0:3a767f41cf04 3
group-UVic-Assistive-Technolog 0:3a767f41cf04 4 #include "mbed.h"
group-UVic-Assistive-Technolog 0:3a767f41cf04 5 #include <BNO055.h>
group-UVic-Assistive-Technolog 0:3a767f41cf04 6 #include <Mx28.h>
group-UVic-Assistive-Technolog 0:3a767f41cf04 7
group-UVic-Assistive-Technolog 0:3a767f41cf04 8 // Generic definitions
group-UVic-Assistive-Technolog 0:3a767f41cf04 9 #define TRUE 1
group-UVic-Assistive-Technolog 0:3a767f41cf04 10 #define FALSE 0
group-UVic-Assistive-Technolog 0:3a767f41cf04 11
group-UVic-Assistive-Technolog 0:3a767f41cf04 12 // ROS definitions
group-UVic-Assistive-Technolog 0:3a767f41cf04 13 #define ROSDATALENGTH 5
MikeGray92 7:950b3c3b5a2b 14 #define ROSYAW 2
MikeGray92 7:950b3c3b5a2b 15 #define ROSPITCH 1
MikeGray92 7:950b3c3b5a2b 16 #define ROSROLL 0
MikeGray92 7:950b3c3b5a2b 17 #define ROSHEIGHT 3
MikeGray92 7:950b3c3b5a2b 18 #define ROSMODE 4
group-UVic-Assistive-Technolog 0:3a767f41cf04 19
group-UVic-Assistive-Technolog 0:3a767f41cf04 20 // Gimbal definitions
group-UVic-Assistive-Technolog 0:3a767f41cf04 21 #define YAWID 1
group-UVic-Assistive-Technolog 0:3a767f41cf04 22 #define PITCHID 2
group-UVic-Assistive-Technolog 0:3a767f41cf04 23 #define ROLLID 3
group-UVic-Assistive-Technolog 0:3a767f41cf04 24 #define YAWZERO 2015
group-UVic-Assistive-Technolog 0:3a767f41cf04 25 #define PITCHZERO 2350
group-UVic-Assistive-Technolog 0:3a767f41cf04 26 #define ROLLZERO 2302
group-UVic-Assistive-Technolog 0:3a767f41cf04 27 #define YAWMIN 0 // -177 degrees.
group-UVic-Assistive-Technolog 0:3a767f41cf04 28 #define YAWMAX 4063 // +177 degrees.
group-UVic-Assistive-Technolog 0:3a767f41cf04 29 #define PITCHMIN 1326 // -90 degrees.
MikeGray92 7:950b3c3b5a2b 30 #define PITCHMAX 3000 // +90 degrees is at 3374
MikeGray92 7:950b3c3b5a2b 31 #define ROLLMIN 2100 // -90 degrees is at 1278
MikeGray92 7:950b3c3b5a2b 32 #define ROLLMAX 2500 // +90 degrees is at 3374
group-UVic-Assistive-Technolog 0:3a767f41cf04 33
group-UVic-Assistive-Technolog 0:3a767f41cf04 34 // Lift definitions
group-UVic-Assistive-Technolog 0:3a767f41cf04 35 #define LIFTUP 0
group-UVic-Assistive-Technolog 0:3a767f41cf04 36 #define LIFTDOWN 1
MikeGray92 4:89ebfa37663b 37 #define LIFTHEIGHTMAX 3000 // 119.6 cm should be 3000
MikeGray92 3:527f0b949839 38 #define LIFTHEIGHTMIN 5 //51.6 cm
MikeGray92 3:527f0b949839 39 // Delta Height for Lift is 68cm
group-UVic-Assistive-Technolog 0:3a767f41cf04 40
group-UVic-Assistive-Technolog 0:3a767f41cf04 41 // Classes
MikeGray92 7:950b3c3b5a2b 42 struct fields{
MikeGray92 7:950b3c3b5a2b 43 volatile int yaw;
MikeGray92 7:950b3c3b5a2b 44 int yawSpeed;
MikeGray92 7:950b3c3b5a2b 45 volatile int pitch;
MikeGray92 7:950b3c3b5a2b 46 int pitchSpeed;
MikeGray92 7:950b3c3b5a2b 47 volatile int roll;
MikeGray92 7:950b3c3b5a2b 48 int rollSpeed;
MikeGray92 7:950b3c3b5a2b 49 volatile int height;
MikeGray92 7:950b3c3b5a2b 50 bool stabilize;
MikeGray92 7:950b3c3b5a2b 51 bool masterOn;
MikeGray92 7:950b3c3b5a2b 52 bool liftRun;
MikeGray92 7:950b3c3b5a2b 53 bool gimbalRun;
MikeGray92 7:950b3c3b5a2b 54 bool shutdown;
MikeGray92 7:950b3c3b5a2b 55 bool initialize;
MikeGray92 7:950b3c3b5a2b 56 volatile int mode;
group-UVic-Assistive-Technolog 0:3a767f41cf04 57 };
group-UVic-Assistive-Technolog 0:3a767f41cf04 58
group-UVic-Assistive-Technolog 0:3a767f41cf04 59 extern struct fields control;
group-UVic-Assistive-Technolog 0:3a767f41cf04 60 extern struct fields rosInput;
MikeGray92 1:1ac7d472cfa2 61 extern volatile int currentPosition;
MikeGray92 1:1ac7d472cfa2 62 extern int prevPosition;
MikeGray92 4:89ebfa37663b 63 extern bool stall;
MikeGray92 4:89ebfa37663b 64 extern bool rosFlag;
MikeGray92 4:89ebfa37663b 65 extern int stallcount;
group-UVic-Assistive-Technolog 0:3a767f41cf04 66 extern Ticker hallInt;
MikeGray92 1:1ac7d472cfa2 67 extern Timer filter_hall1;
MikeGray92 4:89ebfa37663b 68 extern Timer rosMode_Delay;
group-UVic-Assistive-Technolog 0:3a767f41cf04 69 extern PwmOut liftSpeed;
group-UVic-Assistive-Technolog 0:3a767f41cf04 70 extern DigitalOut liftDirection;
group-UVic-Assistive-Technolog 0:3a767f41cf04 71 extern DynamixelClass gimbal;
group-UVic-Assistive-Technolog 0:3a767f41cf04 72
group-UVic-Assistive-Technolog 0:3a767f41cf04 73 #endif