Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed ros_lib_kinetic
definitions.h@0:3a767f41cf04, 2018-01-31 (annotated)
- Committer:
- group-UVic-Assistive-Technolog
- Date:
- Wed Jan 31 05:24:12 2018 +0000
- Revision:
- 0:3a767f41cf04
- Child:
- 1:1ac7d472cfa2
Initial commit
Who changed what in which revision?
User | Revision | Line number | New 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 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 14 | #define ROSCONTROL 0 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 15 | #define ROSYAW 1 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 16 | #define ROSPITCH 2 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 17 | #define ROSROLL 3 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 18 | #define ROSHEIGHT 4 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 19 | #define ROSMODE 5 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 20 | |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 21 | // Gimbal definitions |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 22 | #define DYNASCALE 11.377777777777 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 23 | #define DYNASCALE2 13 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 24 | #define DYNASCALE3 17 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 25 | #define DYNAPROPCONST 0.1 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 26 | #define DYNASTEPSIZE 3 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 27 | #define IMUBUFFER 10 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 28 | #define YAWID 1 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 29 | #define PITCHID 2 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 30 | #define ROLLID 3 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 31 | #define YAWZERO 2015 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 32 | #define PITCHZERO 2350 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 33 | #define ROLLZERO 2302 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 34 | #define YAWMIN 0 // -177 degrees. |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 35 | #define YAWMAX 4063 // +177 degrees. |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 36 | #define CW 1 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 37 | #define CCW 0 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 38 | #define PITCHMIN 1326 // -90 degrees. |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 39 | #define PITCHMAX 3374 // +90 degrees. |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 40 | #define ROLLMIN 1278 // -90 degrees. |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 41 | #define ROLLMAX 3326 // +90 degrees. |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 42 | |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 43 | // Lift definitions |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 44 | #define LIFTUP 0 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 45 | #define LIFTDOWN 1 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 46 | #define ROSCHECKTIME 0.01 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 47 | #define HALLCHECKTIME 100 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 48 | #define STALLTIME 200 //Was 250 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 49 | #define LIFTSCALE 4400 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 50 | #define LIFTPROPCONST 0.01 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 51 | #define LIFTRAMPCONST 0.002f |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 52 | #define LIFTHEIGHTMAX 2640 // 2640/4400 = 0.6m was 2640 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 53 | #define LIFTHEIGHTMIN 132 // 132/4400 = 0.05m |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 54 | |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 55 | |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 56 | // Classes |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 57 | struct fields{ |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 58 | int yaw; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 59 | int yawSpeed; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 60 | int pitch; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 61 | int pitchSpeed; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 62 | int roll; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 63 | int rollSpeed; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 64 | int height; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 65 | bool stabilize; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 66 | bool masterOn; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 67 | bool liftRun; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 68 | bool gimbalRun; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 69 | bool shutdown; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 70 | bool initialize; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 71 | bool mode; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 72 | }; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 73 | struct fields_float{ |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 74 | float yaw; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 75 | float yawSpeed; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 76 | float pitch; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 77 | float pitchSpeed; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 78 | float roll; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 79 | float rollSpeed; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 80 | float height; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 81 | bool stabilize; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 82 | bool masterOn; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 83 | bool liftRun; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 84 | bool gimbalRun; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 85 | bool shutdown; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 86 | bool initialize; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 87 | bool mode; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 88 | }; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 89 | |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 90 | extern struct fields control; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 91 | extern struct fields rosInput; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 92 | extern int currentPosition; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 93 | extern bool stall; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 94 | extern bool liftFlag; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 95 | extern bool motorFlag; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 96 | extern bool imuFlag; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 97 | extern bool rosFlag; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 98 | extern float tempyaw; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 99 | extern float temppitch; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 100 | extern float temproll; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 101 | extern float tempheight; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 102 | extern Ticker hallInt; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 103 | extern Ticker dynaInt; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 104 | extern Ticker imuInt; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 105 | extern Ticker rosInt; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 106 | extern PwmOut liftSpeed; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 107 | extern DigitalOut liftDirection; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 108 | extern DigitalIn hallSensor1; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 109 | extern DigitalIn hallSensor2; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 110 | extern DigitalOut LED; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 111 | extern BNO055 IMU; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 112 | extern DynamixelClass gimbal; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 113 | |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 114 | #endif |