See discussion here:
https://github.com/ArduPilot/ardupilot/issues/7331
we were getting some uninitialised variables. While it only showed up in
AP_SbusOut, it means we can't be sure it won't happen on other objects,
so safest to remove the approach
Thanks to assistance from Lucas, Peter and Francisco
Also fix bug in do-mount-control so that do-mount-control can switch mount into retract mode
Also removes ability to set which axis are stabilized through
ardupilotmega mount_configure message
This commit changes the way libraries headers are included in source files:
- If the header is in the same directory the source belongs to, so the
notation '#include ""' is used with the path relative to the directory
containing the source.
- If the header is outside the directory containing the source, then we use
the notation '#include <>' with the path relative to libraries folder.
Some of the advantages of such approach:
- Only one search path for libraries headers.
- OSs like Windows may have a better lookup time.
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.