Copter: cleanup some bit if tests to be clearer

Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
AP_Common: added BIT_IS_SET() macro

makes bit mask testing safer on PX4

Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
Copter: use BIT_IF_SET()

this should fix the problem with simple mode on PX4

Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
AP_Limits: fixed return of AP_Int8 parameters from object

we should return the base type, not the parameter, or callers could
use set on the result
build-PX4: changed the PX4 build to use CONFIG_C99_BOOL8

this fixes bool behaviour to match C99, which some of the APM code
assumed, including simple mode in ArduCopter
Rover: made a bit test clearer
TradHeli: change coll_out to int16_t

was incorrectly defined as an AP_Int16 parameter
autotest: added unpack_mp.sh script

used to generated
http://firmware.diydrones.com/Tools/MissionPlanner/upgrade
autotest: added APMVERSION to firmware.diydrones.com version
Plane: mark 2.72beta version
Rover: mark new beta version
gitignore: add more files produced by sitl testing
Copter: move update_commands to run_autopilot fn

update_commands was being run in the medium_loop counter but it is
easier to understand the flow of the code if it is consolidated along
with other autopilot calls.
APM_Control: ROLL and PITCH controllers

These changes reduce height variation in turns and improve
robustness. the specific changes are:

1) Linked roll and pitch integrator protection to the final output
value so that if final output is on upper limit, the integrator is
prevented from increasing and vice-versa. This improves wind-up
protection.

2) Modified rate feedback in roll and pitch controllers to use body
rates rather than Euler or earth rates.

3) Changed the roll to pitch compensation to use measured roll angle
and estimated airspeed to calculate the component of turn rate
(assuming a level coordinated turn) around the pitch axis. This a
mathematically correct calculation and will work over a range of bank
angles and aircraft with minimal (if any) tuning required.

4) The integrator in the roll and pitch loop is clamped when the
estimated speed is below the minimum FBW speed

5) The noise filter in the pitch and roll loop has been changed to use
a FOH discretisation. This gives improved noise rejection and less
phase loss when compared to the previous filter that used a ZOH or
equivalent discretisation.

This has been flown on the rascal in the SITL and on a X-8 with
limited flight testing. Initial results have been encouraging with
reduced height variation in turns.  Compare to standard PIDS, the
revised pitch and roll controllers allow the use of rate feedback
(effectively the same as the old D term) without beating the servos to
death.  The bank angle compensation in the pitch loop works
effectively over a much larger range of bank angles and requires
minimal tuning compared to the old calculation.

YAW CONTROLLER

Currently testing the a 3-loop acceleration autopilot topology for the
yaw loop with feed forward yaw rate for turn compensation. This 3-loop
topology is commonly used in tactical skid to to turn missiles and is
easy to tune. The following block diagram shows the general signal
flow

Note that the acceleration measurement has to pass through an
integrator before it gets to the actuator. This is a important feature
as it eliminates problems of high frequency noise and potential
coupling with structural modes associated with direct feedback of
measured acceleration to actuator.

The high pass filter has been inserted to compensate for airspeed and
bank angle measurement errors which will cause steady state errors in
the calculation of the turn yaw rate.

The yaw controller flies SITL well, but hasn't been flight tested
yet. It can be configured either as a simple yaw damper, or the
acceleration and integral term can be turned on to allow feedback
control of lateral acceleration/sideslip.

TO DO:

Need to reduce number of tuning parameters and provide consistent
naming Need to provide guidance on tuning these loops with definitions
for all the gain terms.  Need to check signs and units into and out of
lateral loops.

DESIGN DECISIONS PENDING:

1) Can we remove the noise filters? Provided the mpu6k noise filter is
running they are of limited benefit given the 25Hz Nyquist frequency

2) If we do remove them and rely on the mpu6k noise filter, what is
the apprporiate default cutoff frequency for plane use. 20Hz is
probably OK for most setups, but some noisy/high vibration setups
would require as low as 10Hz

3) The inverted flight logic looks like a crash waiting to
happen. It's problematic to test and even if implemented correctly
would still crash a plane with poor inverted flight capability. We
should either implement it properly and fully tested or delete it.
Plane: use new APM_Control API
Plane: rename APM_Control parameters

this groups the parameters more logically
Plane: enable APM_CONTROL in APM_Config.h
APM_Control: fixed shadowing of _last_out variables
Plane :APM_Control : Added tuning guide readme
Plane : APM_Control : Removed 20Hz low-pass filters on rate gyro inputs. These are not required due to MPU 6000 filtering.