I am working on a VTOL quadrotor in which I am trying to change the board orientation in flight from 0 to 34 to avoid a roll inversion. I am able to do this in flight by moving the ahrs.set() in the ArduCopter.pde outside of the if(!motors.armed) section. I can accomplish this in flight using telemetry and a python script using Script.ChangeParam("AHRS_ORIENTATION", 34).
During flight I will not have access to telemetry. Is there a way to change this in a flight mode? I tried ahrs.set_orientation(34) and the code won't compile. Any ideas or suggestion on how to change my reference frame during flight? is there a way to use aparam.<>?