Manual control of camera servo gimbal
GoogleCodeExporter opened this issue · comments
Google Code Exporter commented
For controlling the tilt/roll (or tilt/pan) of a servo gimbal via RC channel(s)
ot sure if this is already handled in the beta versions/forks, but I have found
this works well, with or with out cam stabiisation:
In config.h
#define SERVO_TILT // Existing code
#define CAM_TILT_CHAN AUX4 // Select RC channel to control gimbal tilt
#define CAM_ROLL_CHAN YAW // Select RC channel to control gimbal roll
In Output.cpp
#if defined(SERVO_TILT) // Existing code
servo[0] = get_middle(0);
servo[1] = get_middle(1);
if (rcOptions[BOXCAMSTAB]) {
servo[0] += ((int32_t)conf.servoConf[0].rate * att.angle[PITCH]) /50L;
servo[1] += ((int32_t)conf.servoConf[1].rate * att.angle[ROLL]) /50L;
}
// Direct camera tilt/pan, additive - new code
#ifdef CAM_PITCH_CHAN
servo[0] += constrain(rcData[CAM_PITCH_CHAN],900,2100)-MIDRC;
#endif
#ifdef CAM_ROLL_CHAN
servo[1] += constrain(rcData[CAM_ROLL_CHAN],900,2100)-MIDRC;
#endif
Original issue reported on code.google.com by pwbec...@hotmail.com
on 8 Feb 2015 at 8:03
Google Code Exporter commented
Not getting any movement of servos on s1 (aux3) or s2 (aux4). Dump attached.
Original comment by ElderChe...@gmail.com
on 17 Apr 2015 at 11:35
Attachments:
- [150417 Blackout Mini-H Dump.txt](https://storage.googleapis.com/google-code-attachments/multiwii/issue-19/comment-1/150417 Blackout Mini-H Dump.txt)