Disable Cam Stabelize in Acro

Hi. I have a stabilized tilt on my tricopter where i have my gopro and FPV Cam mounted.
it is adjusted so that when i give full forward in stabilize mode (aprox 55deg) the tilt compensates so that the camera is pointing almost level (minus about 40deg). i tuned it that way so i have some indication of the actual angle of the craft in the fpc and gopro video.

This is a very nice way to fly fast around trees and other obstacles in stabilize mode and still get a feel for the tricopter pitch angle without only getting the ground in the video.

However when i want to do some acro stuff like flipps and diving from waaay up i would like to turn off the stabilization of the tilt platform. (so that the cameras is aligned forward with the frame) tilt at 0deg always.

i have my own github fork of the apm code with some small changes that i would like to incorporate this inn to.

i dont have a full overview of the apm code and would like to get some hints on where to change this.
i do have some programming skills from Arduino, PHP, C# and VB

I think it should be a simple task to implement. but i don’t know the function to set the camera mode (and it might be overwritten by some other function or a mavlink message if i use the ground station.

in arducopter system.pde
switch(mode) {
case ACRO:
success = true;
set_yaw_mode(ACRO_YAW);
set_roll_pitch_mode(ACRO_RP);
set_throttle_mode(ACRO_THR);
set_nav_mode(NAV_NONE);
[color=#FF0000]SET Mount mode to Retract???[/color]
break;

    case STABILIZE:
        success = true;
        set_yaw_mode(STABILIZE_YAW);
        set_roll_pitch_mode(STABILIZE_RP);
        set_throttle_mode(STABILIZE_THR);
        set_nav_mode(NAV_NONE);

[color=#FF0000]Re enable Cam Stabelization???[/color]
break;

alternatively this could be implemented with a chan7/8 option to retract the Camera mount

Could someone point me in the right direction?
I want to change this in my private fork only for the time.

Update:
The parameter i want to change is MNT_STAB_TILT in acro i want this set to 0 and in Stabilize i want it to be 1

I might end up setting this to 1 in loiter or alt hold so i can still have the camera un stabilized in Stabilize mode

Simplest, hackish way is to just go into AP_Mount.h and move the parameter you want (in this case _stab_tilt) to the public section. Then you can call camera_mount._stab_tilt = 0 where you have those comments.

Thanks man that solved it :slight_smile: