cameraManager.c
Go to the documentation of this file.
23 int gimbalOffset = 240;//was MIDDLE_PWM -42; 300 at current config gets the camera pointed towards the ground
24 int goProgimbalOffset = 325;//gets the gimbal arm horizontal to the ground at current configuration
25 int verticalOffset = -100;//at current calibration of servos, -100 gets us looking face down; 400 gives 20 degrees from straight down in case we want to look forward ish
32 unsigned int cameraPollingRuntime(long double latitude, long double longitude, long int time, unsigned int* pictureCount, int rollAngle, int pitchAngle){
41 if (((( (rollAngle <= rollLimit || rollAngle >= -rollLimit) && (pitchAngle <= rollLimit || pitchAngle >= -rollLimit)))|| overrideTrigger) && resting){// && pitch <= 20 && pitch >= -20 && roll >= -20 && roll <= 20){
76 return gimbalOffset - 675/GIMBAL_MOTION_RANGE * rollAngle;//1024 is the same as GIMBAL_PWM_RANGE; 675 for some reason gives better stabiization with motion range at 30
77 //compared to 1024 with range at 60. This is being used for all of the stabilization codes (camera, GoPro, vertical)
78 //note: when moving the gimbal code over from an older version of the code, the gimbals stabilized backwards for an unkown reason.
79 //to remedy this, the + 675 in the above code was changed to -675. The other stabilization codes were changed like this too
102 }// there is a plus because the servo is facing the opposite way in terms of the camera gimbal servo
float getDistance(long double lat1, long double lon1, long double lat2, long double lon2)
Definition: Common.c:33
int cameraGimbalStabilization(float rollAngle)
Definition: cameraManager.c:68
#define RIGHT_GIMBAL_GOPRO_MOTION_LIMIT
Definition: cameraManager.h:20
unsigned int cameraPollingRuntime(long double latitude, long double longitude, long int time, unsigned int *pictureCount, int rollAngle, int pitchAngle)
Definition: cameraManager.c:32
int goProVerticalstabilization(float pitchAngle)
Definition: cameraManager.c:109