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@3:527f0b949839, 2018-02-08 (annotated)
- Committer:
- MikeGray92
- Date:
- Thu Feb 08 22:55:15 2018 +0000
- Revision:
- 3:527f0b949839
- Parent:
- 2:0537a8007a39
- Child:
- 4:89ebfa37663b
Just addd/removed comments. See last commit notes for changes
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 YAWID 1 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 23 | #define PITCHID 2 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 24 | #define ROLLID 3 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 25 | #define YAWZERO 2015 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 26 | #define PITCHZERO 2350 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 27 | #define ROLLZERO 2302 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 28 | #define YAWMIN 0 // -177 degrees. |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 29 | #define YAWMAX 4063 // +177 degrees. |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 30 | #define PITCHMIN 1326 // -90 degrees. |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 31 | #define PITCHMAX 3374 // +90 degrees. |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 32 | #define ROLLMIN 1278 // -90 degrees. |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 33 | #define ROLLMAX 3326 // +90 degrees. |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 34 | |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 35 | // Lift definitions |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 36 | #define LIFTUP 0 |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 37 | #define LIFTDOWN 1 |
MikeGray92 | 3:527f0b949839 | 38 | #define LIFTHEIGHTMAX 3000 // 119.6 cm |
MikeGray92 | 3:527f0b949839 | 39 | #define LIFTHEIGHTMIN 5 //51.6 cm |
MikeGray92 | 3:527f0b949839 | 40 | // Delta Height for Lift is 68cm |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 41 | |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 42 | // Classes |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 43 | struct fields{ |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 44 | int yaw; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 45 | int yawSpeed; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 46 | int pitch; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 47 | int pitchSpeed; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 48 | int roll; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 49 | int rollSpeed; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 50 | int height; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 51 | bool stabilize; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 52 | bool masterOn; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 53 | bool liftRun; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 54 | bool gimbalRun; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 55 | bool shutdown; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 56 | bool initialize; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 57 | bool mode; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 58 | }; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 59 | struct fields_float{ |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 60 | float yaw; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 61 | float yawSpeed; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 62 | float pitch; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 63 | float pitchSpeed; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 64 | float roll; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 65 | float rollSpeed; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 66 | float height; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 67 | bool stabilize; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 68 | bool masterOn; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 69 | bool liftRun; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 70 | bool gimbalRun; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 71 | bool shutdown; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 72 | bool initialize; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 73 | bool mode; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 74 | }; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 75 | |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 76 | extern struct fields control; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 77 | extern struct fields rosInput; |
MikeGray92 | 1:1ac7d472cfa2 | 78 | extern volatile int currentPosition; |
MikeGray92 | 1:1ac7d472cfa2 | 79 | extern int prevPosition; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 80 | extern bool stall; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 81 | extern Ticker hallInt; |
MikeGray92 | 1:1ac7d472cfa2 | 82 | extern Timer filter_hall1; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 83 | extern PwmOut liftSpeed; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 84 | extern DigitalOut liftDirection; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 85 | extern DigitalOut LED; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 86 | extern DynamixelClass gimbal; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 87 | |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 88 | #endif |