UVic Assistive Technology Lab / Mbed 2 deprecated DSLR_Camera_Gimbal

Dependencies:   mbed ros_lib_kinetic

Committer:
MikeGray92
Date:
Thu Feb 08 22:23:40 2018 +0000
Revision:
2:0537a8007a39
Parent:
0:3a767f41cf04
Child:
3:527f0b949839
Code ready to be tested with ROS. ; -Tested external interrupt positioning for the lift; -remove unnecessary flags and functions

Who changed what in which revision?

UserRevisionLine numberNew 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
group-UVic-Assistive-Technolog 0:3a767f41cf04 13 static int i = 0;
group-UVic-Assistive-Technolog 0:3a767f41cf04 14
group-UVic-Assistive-Technolog 0:3a767f41cf04 15 void runGimbal(void){
group-UVic-Assistive-Technolog 0:3a767f41cf04 16
group-UVic-Assistive-Technolog 0:3a767f41cf04 17 // At 1ms update the gimbal.
MikeGray92 2:0537a8007a39 18 if (control.gimbalRun){
group-UVic-Assistive-Technolog 0:3a767f41cf04 19 switch(i){
group-UVic-Assistive-Technolog 0:3a767f41cf04 20 case(0):
group-UVic-Assistive-Technolog 0:3a767f41cf04 21 gimbal.servo(YAWID, control.yaw, 30);
group-UVic-Assistive-Technolog 0:3a767f41cf04 22 i++;
group-UVic-Assistive-Technolog 0:3a767f41cf04 23 break;
group-UVic-Assistive-Technolog 0:3a767f41cf04 24 case(1):
group-UVic-Assistive-Technolog 0:3a767f41cf04 25 gimbal.servo(PITCHID, control.pitch, 30);
group-UVic-Assistive-Technolog 0:3a767f41cf04 26 i++;
group-UVic-Assistive-Technolog 0:3a767f41cf04 27 break;
group-UVic-Assistive-Technolog 0:3a767f41cf04 28 case(2):
group-UVic-Assistive-Technolog 0:3a767f41cf04 29 gimbal.servo(ROLLID, control.roll, 30);
group-UVic-Assistive-Technolog 0:3a767f41cf04 30 i = 0;
group-UVic-Assistive-Technolog 0:3a767f41cf04 31 break;
group-UVic-Assistive-Technolog 0:3a767f41cf04 32 }
group-UVic-Assistive-Technolog 0:3a767f41cf04 33 control.gimbalRun = FALSE;
group-UVic-Assistive-Technolog 0:3a767f41cf04 34 }
group-UVic-Assistive-Technolog 0:3a767f41cf04 35 }