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
gimbal.cpp@6:2ffa254e8f6e, 2018-03-06 (annotated)
- Committer:
- MikeGray92
- Date:
- Tue Mar 06 21:44:07 2018 +0000
- Revision:
- 6:2ffa254e8f6e
- Parent:
- 4:89ebfa37663b
- Child:
- 7:950b3c3b5a2b
Added Comments; Changed the order of rosInput values (0 - neg, 1 -nothing, 2 - pos); Changed Roll limits
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 1 | |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 2 | #include <stdint.h> |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 3 | #include "mbed.h" |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 4 | #include <ros.h> |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 5 | #include <std_msgs/Empty.h> |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 6 | #include <std_msgs/Float32MultiArray.h> |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 7 | #include <BNO055.h> |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 8 | #include <initializations.h> |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 9 | #include <definitions.h> |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 10 | #include <prototypes.h> |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 11 | #include <Mx28.h> |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 12 | |
MikeGray92 | 6:2ffa254e8f6e | 13 | static int i = 0; //Variable to only update one servo each loop. |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 14 | |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 15 | void runGimbal(void){ |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 16 | switch(i){ |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 17 | case(0): |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 18 | gimbal.servo(YAWID, control.yaw, 30); |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 19 | i++; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 20 | break; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 21 | case(1): |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 22 | gimbal.servo(PITCHID, control.pitch, 30); |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 23 | i++; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 24 | break; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 25 | case(2): |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 26 | gimbal.servo(ROLLID, control.roll, 30); |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 27 | i = 0; |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 28 | break; |
MikeGray92 | 4:89ebfa37663b | 29 | } |
group-UVic-Assistive-Technolog | 0:3a767f41cf04 | 30 | } |