This has the added benefit of saving 60 bytes and simplifying Mission Planner gui.
Moved some code from RC_Channel_aux to AP_Mount class
The servos get written by the update_mount_position() function, this simplifies main()
PS: The beauty of using libraries: I did not have to touch a single line of ArduPlane's code!
set_roi_cmd modified to take a Location. I know the intention was for set_roi_cmd to interpret the MAVLink command directly but unfortunately in arduCopter missions are only made up of waypoints (which are Locations).
For now, angles red in are always of the range -45 deg ~ 45 deg which is consistent with the existing arducopter implementation but should be improved to scale the pilot's input to the mount's actual range.
Rename calculate() into stabilize()
Implement MAV_MOUNT_MODE_RC_TARGETING initialization
Document to make sure this radians/degrees mess up does not happen again
this enables MNT_* parameter control of the camera mount code. It also
fixes the conversion of calculated angles between degrees and
integers, and fixes stabilised mount control when yaw control is not
available.
It is fully configurable with the mission planner, there is no need to change
the source code to adapt to your setup.
It needs more testing, but the SIL is not working for me.