Commit Graph

3876 Commits

Author SHA1 Message Date
Randy Mackay
6969ab573d Copter: configurable max lean angle
ANGLE_MAX parameter allows limiting the roll and pitch angles during
manual and auto flight modes to anywhere from 10 to 80 degrees
2013-08-11 12:53:22 +09:00
Randy Mackay
c7464f635c AC_Sprayer: turn on/off the spinner with the pump 2013-08-05 21:12:28 +09:00
Randy Mackay
e4ca7d2fdf AC_Sprayer: first implementation 2013-08-05 21:11:09 +09:00
Andrew Tridgell
9cb6c987d4 AP_Math: fixed example build 2013-08-05 12:37:51 +10:00
Andrew Tridgell
0d36832b82 AP_AHRS: use const reference not pointers for locations
this makes life easier for the new AP_Mission library

Pair-Programmed-With: Brandon Jones <brnjones@gmail.com>
2013-08-05 10:24:12 +10:00
Andrew Tridgell
f3b3e23bbc AP_Camera: fix for new AP_Math API
Pair-Programmed-With: Brandon Jones <brnjones@gmail.com>
2013-08-05 10:24:09 +10:00
Andrew Tridgell
6b5ee80b70 AP_InertialNav: fix for new AP_Math API
Pair-Programmed-With: Brandon Jones <brnjones@gmail.com>
2013-08-05 10:24:06 +10:00
Andrew Tridgell
cf4a74cfb8 AP_L1_Control: fix for new AP_Math API
Pair-Programmed-With: Brandon Jones <brnjones@gmail.com>
2013-08-05 10:24:02 +10:00
Andrew Tridgell
612ede81f4 AP_Limits: fix for new AP_Math API
Pair-Programmed-With: Brandon Jones <brnjones@gmail.com>
2013-08-05 10:23:57 +10:00
Andrew Tridgell
1d75b52411 AP_Math: use const references not pointers for location functions
this makes life a bit easier for the new AP_Mission library

Pair-Programmed-With: Brandon Jones <brnjones@gmail.com>
2013-08-05 10:23:40 +10:00
Randy Mackay
47f5c9b7a4 AC_Fence: remove unused gps pointer 2013-08-03 19:04:59 +09:00
Andrew Tridgell
b7e3851ef8 AP_Scheduler: prevent a divide by zero 2013-08-02 22:07:00 +10:00
Andrew Tridgell
a7cbebbeba APM_Control: rename 'stabilize' to 'disable_integrator'
this better reflects what it does
2013-08-02 21:54:48 +10:00
Paul Riseborough
0c64c800b3 AP_L1_Control : Fixed bug in track capture angle limit 2013-08-02 21:47:45 +10:00
Paul Riseborough
34f0af25cc AP_TECS : Improvements and bug fixes to feed-forward throttle demand
This fixes a bug in the feed-forward throttle that prevented the bank to throttle compensation from working properly during descents.
It also adds bank to throttle compensation to the non-airspeed sensor throttle algorithm.
2013-08-02 21:47:01 +10:00
Randy Mackay
8d26fb5581 Copter Motors: by default spin motors at 65 when armed 2013-07-28 18:18:52 +09:00
Randy Mackay
fe412437c2 Copter: add flags for upper and lower throttle limits
Freeze desired altitude when motors hit a limit
2013-07-28 18:18:39 +09:00
Randy Mackay
de59ea3ddc Copter Fence: reduce circle @Range to 30m 2013-07-27 10:28:33 +09:00
Andrew Tridgell
57752df68e APM_Control: set a small D value by default
0.02 may help with some planes that have slow response

Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
2013-07-26 16:07:00 +10:00
Andrew Tridgell
a192b9ee46 AP_Scheduler: added load_average() function
useful to give a load average in SYS_STATUS mavlink message
2013-07-26 16:07:00 +10:00
Andrew Tridgell
fef6a76078 RC_Channel: rename 'Manual' to RCPassThru
this should make it clearer what it does
2013-07-26 16:07:00 +10:00
Randy Mackay
f3a2db195e Copter Motors: remove old style stability patch 2013-07-25 15:34:04 +09:00
Andrew Tridgell
2874ec67c7 DataFlash: slight efficiency improvement
fixes issue #314

thanks Dongfang!
2013-07-23 09:46:02 +10:00
Andrew Tridgell
63873d6af3 HAL_AVR: fixed example build 2013-07-23 09:42:51 +10:00
Paul Riseborough
ba009e55e3 AP_Baro : Fixed bug in temperature units in AP_Baro_HIL 2013-07-22 12:50:02 +10:00
Andrew Tridgell
ebebee4f06 AP_Baro: extend the atmospheric model to higher altitudes 2013-07-22 12:50:02 +10:00
Paul Riseborough
5a68c515dc AP_Airspeed: Altitude Calibration - added constrain on P matrix diagonals 2013-07-22 12:50:02 +10:00
Andrew Tridgell
3ba0dec4b3 AP_Airspeed: fixed typo 2013-07-22 12:50:02 +10:00
Paul Riseborough
d1805f4349 AP_Airspeed: Airspeed Calibration computational efficiency improvement 2013-07-22 12:50:02 +10:00
Andrew Tridgell
0c6725f289 AP_Baro: improved the accuracy of the barometer model 2013-07-22 12:50:01 +10:00
Andrew Tridgell
c5028c04da APM_Control: scale controllers for altitude
this allows the attitude controllers to better handle a wider range of
altitudes

Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
2013-07-22 12:50:01 +10:00
Andrew Tridgell
097718e833 AP_L1_Control: scale loiter and wp radius with altitude
this should keep the aircraft stable in loiter at very high altitudes

Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
2013-07-22 12:50:01 +10:00
Andrew Tridgell
e6d9d14fad AP_Airspeed: added example sketch for airspeed calibration 2013-07-22 12:50:01 +10:00
Andrew Tridgell
620d067ee1 AP_TECS: use ahrs EAS2TAS for true airspeed 2013-07-22 12:50:01 +10:00
Andrew Tridgell
ec73fadc45 AP_AHRS: added true airspeed support in AHRS
use true airspeed for wind calculations, and allow other drivers to
ask for the current ratio
2013-07-22 12:50:01 +10:00
Andrew Tridgell
3c66cb8af1 AP_Airspeed: added EAS2TAS in airspeed driver
this keeps the true airspeed ratio in the airspeed driver, which seems
the most logical place
2013-07-22 12:50:01 +10:00
Andrew Tridgell
893d2da6f6 AP_Airspeed: added auto-calibration support
This uses a Kalman filter to calculate the right ARSPD_RATIO at runtime

Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
2013-07-22 12:50:01 +10:00
Andrew Tridgell
01c124d5f5 AP_GPS: added velocity_vector() method 2013-07-22 12:50:00 +10:00
Andrew Tridgell
468e55d425 AP_Math: added two new vector/matrix ops for kalman airspeed filter 2013-07-22 12:50:00 +10:00
Randy Mackay
e2fbc00b52 LeadFilter: removed this unused library
This was used to project the GPS position forward to compensate for lag
but this has become unnecessary with the introduction of the inertial
nav in x and y axis.
2013-07-21 14:30:49 +09:00
Randy Mackay
43379f20c3 Copter Motors: replace limit bitmask with structure 2013-07-21 13:58:24 +09:00
Randy Mackay
0325ad5d0d AP_AHRS: use rotateXY for speed
Saves 0.1ms at 100hz
2013-07-20 18:00:36 +09:00
Randy Mackay
540ca25b84 AP_Math: add rotateXY 2013-07-20 17:59:06 +09:00
Robert Lefebvre
c812d07993 TradHeli: Creating motor_runup_complete bool which is to confirm that the heli motor is running. This will be used for advanced features in the future. 2013-07-19 16:16:08 +09:00
Robert Lefebvre
957cb094ea TradHeli: Remove unused RSC Mode 3. 2013-07-19 16:16:06 +09:00
Andrew Tridgell
c691e16139 HAL_AVR: fixed example build 2013-07-18 17:36:38 +10:00
Andrew Tridgell
3e21d0594c APM_Control: pass in aircraft parameters and expose coordinate rate offset
this will make it possible to do rate based pitch control without
having a coordinated turn, for in ACRO mode

Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
2013-07-18 14:53:26 +10:00
Andrew Tridgell
fb0e48a25d AP_TECS: adapt for new airspeed variable names 2013-07-18 14:53:23 +10:00
Andrew Tridgell
42d107b0d9 AP_SpdHgtControl: rename flybywire_airspeed to airspeed
this variable applies to any automatic throttle mode, not just FBW
modes.

Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
2013-07-18 14:53:20 +10:00
Andrew Tridgell
5901b8b22a APM_Control: allow for a wider range of P values for roll/pitch
values above 1.0 are sometimes needed
2013-07-18 09:05:17 +10:00
Randy Mackay
336357fbaf Copter: ensure _spin_when_armed is not higher than _min_throttle 2013-07-16 15:25:57 +09:00
Randy Mackay
62f3eed4e0 Copter: fix to SPIN_ARMED parameter desciption 2013-07-16 12:59:38 +09:00
Randy Mackay
b709b90a59 Copter: implement safety spin for Tricopters 2013-07-16 12:48:01 +09:00
Randy Mackay
6477c746cd Copter: renamed MOT_UNSAFE_THR to MOT_SPIN_ARMED
Removed special purpose spin_unsafe function
renamed _throttle_unsafe to _spin_when_armed and changed to an AP_Int8
2013-07-16 12:47:59 +09:00
Jonathan Challinger
2725f219cb Copter: Warn user with motors while copter is arming 2013-07-16 12:47:51 +09:00
Jonathan Challinger
ae2b1e3b7e AP_Motors: Added MOT_UNSAFE_THR parameter - Throttle setting used to signal that the copter is armed or otherwise unsafe to approach 2013-07-16 12:47:49 +09:00
Andrew Tridgell
2ee43a694c APM_Control: fixed YAW2SRV_IMAX handling
thanks to Steven G for noticing this!
2013-07-16 09:44:23 +10:00
Andrew Tridgell
032cc513ca DataFlash: fixed example build 2013-07-15 14:10:58 +10:00
Andrew Tridgell
206ed04e76 AP_Mount: fixed example build 2013-07-15 14:10:50 +10:00
Andrew Tridgell
47450a9b40 AP_InertialNav: fixed example build 2013-07-15 14:10:40 +10:00
Andrew Tridgell
98d6331387 AP_Airspeed: fixed example build 2013-07-15 14:10:27 +10:00
Andrew Tridgell
1bd6849d00 AP_AHRS: fixed example build 2013-07-15 14:10:17 +10:00
Andrew Tridgell
82152c058e AC_WPNav: disabled broken example build
this test doesn't actually do anything yet
2013-07-15 14:09:48 +10:00
Andrew Tridgell
04835b095f AC_Fence: fixed examples build 2013-07-15 14:09:18 +10:00
Andrew Tridgell
c7141c4851 AP_GPS: fixed examples build 2013-07-15 14:09:07 +10:00
Andrew Tridgell
0f72eae216 AP_Camera: removed 3 camera trigger types that do not work
the trigger by wp distance, trigger with throttle off and trigger a
transistor all don't work, and are not structured correctly, plus are
dangerous.

The existing relay support can (correctly!) handle the resistor case
without hard-wiring a pin. The "turn off throttle to trigger" idea is
badly broken, it would crash a copter if it worked. We can make it
work properly on planes if there is demand. As it was it didn't work
anyway. 

The triggger by wp distance method was broken, and had no way to
initiate a trigger anyway
2013-07-15 09:55:38 +10:00
Randy Mackay
bd6a60f28b AP_Math: add M_PI_2 definition
Required when building under arduino
2013-07-14 15:57:26 +09:00
Randy Mackay
8545071a21 GCS_MAVLink: include AP_Math.h
Required because mavlink_conversions's mavlink_dcm_to_euler function
uses atan2
2013-07-14 15:56:58 +09:00
Randy Mackay
9b40ba98d7 GCS_MAVLink: regenerated messages 2013-07-14 15:52:55 +09:00
Randy Mackay
6bcbcc0382 GCS_MAVLink: add DO_SET_ROI to common.xml 2013-07-14 15:49:17 +09:00
Andrew Tridgell
d9f13b6b8c GCS_MAVLink: merge in changes from upstream mavlink repo 2013-07-14 16:02:29 +10:00
Andrew Tridgell
b1202ccbff GCS_MAVLink: merge in latest upstream XML changes 2013-07-14 15:41:25 +10:00
Andrew Tridgell
9d66adae13 AP_Airspeed: added get_airspeed_ratio() and set_airspeed_ratio()
This is to help Paul develop an automatic tuning system for airspeed
ratio
2013-07-13 21:53:38 +10:00
Andrew Tridgell
cc778a68ae APM_Control: changed attitude controllers to take angular error not angle
this makes it easier for ACRO mode
2013-07-13 21:45:58 +10:00
Andrew Tridgell
b721bcc129 AP_AHRS: removed get_roll_rate_earth() and get_pitch_rate_earth()
these are not used any more
2013-07-13 21:45:58 +10:00
Andrew Tridgell
21859f9364 RC_Channel: fixed dead_zone for range channels
The dead_zone was being used inconsistently, used in PWM space in one
place, and in control output space in another.

The fix required us to move the index number of the RC channel eeprom
value for RCn_DZ, as users will have a throttle deadzone of 3 set in
their eeprom due to a bug that Randy just fixed that caused the value
to always be saved to eeprom. In plane we then need to fix the
deadzone for the throttle to be 30

this fixes issue #303

Thanks to Soren Kuula for spotting this!
2013-07-13 13:18:54 +10:00
Andrew Tridgell
086e8f80dc AP_AHRS: fixed spin rate gain conversion from degrees to radians
fixes issue #433

Thanks Jurgen!
2013-07-13 12:36:25 +10:00
Randy Mackay
effc829790 INS: relax accel offset check to 3.5 m/s/s
One user, Dusty, has found that even with offsets of 3.1 m/s/s
successful alt hold and loiter are possible
2013-07-13 10:43:07 +09:00
Randy Mackay
110966c186 AP_TECS: compile error fix for size_of(log_tuning) 2013-07-12 11:45:02 +09:00
Randy Mackay
fb5ada38c0 RC: example sketch uses set_default_dead_zone 2013-07-12 11:44:58 +09:00
Randy Mackay
47437b9ddf RC: set dead zone only if parameter has not been set by user 2013-07-12 11:44:16 +09:00
Randy Mackay
012d7b0c0a OptFlow: initialisation fix
Thanks to DongFang (aka Soren) for finding the issue and the solution
2013-07-11 14:14:37 +09:00
Andrew Tridgell
131aa53e42 AP_Relay: update for new PX4 relay pin 2013-07-11 13:50:23 +10:00
Andrew Tridgell
83b13c3d88 HAL_PX4: fixed definition of relay and piezo pins 2013-07-11 13:50:23 +10:00
Andrew Tridgell
0916388ab5 HAL_PX4: retry opening UARTs up to 5 times
this seems to help a lot with the USB port on PX4
2013-07-11 13:50:23 +10:00
Marco Bauer
72d0721721 AP_Relay: setup pin for PX4 relay support 2013-07-11 13:50:22 +10:00
Marco Bauer
a3b216bce3 HAL_PX4: added GPIO driver 2013-07-11 13:50:22 +10:00
Randy Mackay
bf5a50f738 WPNav: stopping point projection uses wp_leash 2013-07-11 11:39:44 +09:00
Andrew Tridgell
f2316747f5 APM_Control: re-work to allow for rate based control 2013-07-11 09:10:41 +10:00
Randy Mackay
345924ddec WPNav: replace LOITER_ACCEL_MAX with parameter
Also removed unused _lean_angle_max variable
2013-07-10 20:00:32 +09:00
Randy Mackay
204f613467 WPNav: bug fix to reported distance to target
This value is for reporting purposes only
2013-07-10 18:21:08 +09:00
Randy Mackay
518eba0729 WPNav: bug fix to loiter accel calculation
Contribution from Leonard Hall
2013-07-10 17:52:12 +09:00
Randy Mackay
c4f17b3235 WPNav: rounding error fix in loiter
Contributed by Leonard Hall
2013-07-10 16:24:37 +09:00
Randy Mackay
5d23d5aaa7 WPNav: reduce loiter speed used to correct pos error
Contributed by Leonard Hall
This should reduce the aggressiveness of the response when we experience
a GPS glitch
2013-07-10 15:52:18 +09:00
Randy Mackay
7860d06b91 AHRS: typo fix for ORIENTATION param description 2013-07-10 14:56:48 +09:00
Andrew Tridgell
0f72401d8d AP_Baro: added GND_ALT_OFFSET parameter
used for automatic barometric adjustment by a ground station equipped
with a barometer
2013-07-10 14:38:57 +10:00
Andrew Tridgell
469736e6bc DataFlash: changes for GPS field changes 2013-07-10 14:04:22 +10:00
Andrew Tridgell
279f6d00f0 AP_AHRS: changes for GPS field changes 2013-07-10 14:04:22 +10:00
Andrew Tridgell
7dbb898264 AP_GPS: switch fields to add units suffix
altitude -> altitude_cm
ground_speed -> ground_speed_cm
ground_course -> ground_course_cd

this helps prevent unit mixups
2013-07-10 14:04:22 +10:00
Paul Riseborough
66d60953df TECS: added height update_pitch call 2013-07-10 14:04:22 +10:00
Andrew Tridgell
9959f6b2df AP_Camera: removed incorrect mavlink sends
these sends did nothing, as MAVLINK_COMM_3 is not connected to
anything. If it was connected they would be dangerous, as a blocking
serial write could cause the stabilization of a copter not to run. If
the serial port was non-blocking it would corrupt the packet.

If we needed something like this it would have to use the MAVLink
packet queueing logic we use elsewhere
2013-07-10 11:51:40 +10:00
Craig@3DR
f5154d9e7a AP_Camera: changed update_location() to return true for camera trigger
Makes the main vehicle code responsible for taking a photo so logging can occur
2013-07-10 08:39:56 +10:00
Andrew Tridgell
7fa1fe8590 AP_Param: use 0xFFFF not __UINT16_MAX__
MacOS doesn't have __UINT16_MAX__
2013-07-09 20:51:06 +10:00
Paul Riseborough
2c5db9a165 TECS: added support for throttle nudging 2013-07-09 20:50:37 +10:00
Paul Riseborough
9c431b4a04 TECS: use altitude supplied by mainline code
this allows for use of ALT_OFFSET and ALT_MIX
2013-07-09 09:25:53 +10:00
Paul Riseborough
d8fedf994a AP_SpdHgtControl: added height above field parameter 2013-07-09 09:05:22 +10:00
Tobias
4a75351bd3 AP_Param: fixed a compiler warning with -Wsign-conversion 2013-07-08 14:57:33 +10:00
Tobias
27a5c28851 AP_Param: fixed some compiler warnings
* added comment
* replaced "~0" with the appropriate macro
* resolved -Wconversion
* saved some space by modifying AP_Param::add_vector_suffix (writing
behind buffer could happen, if buffer_size is almost uint16_max but this
can surely be ignored)

further reading:
http://stackoverflow.com/questions/809227/is-it-safe-to-use-1-to-set-all-bits-to-true
2013-07-08 14:57:33 +10:00
Tobias
ab311d1dd4 AP_Compass: removed comparison out of range compiler warning
uint_ >= 0 (-Wtype-limits)
2013-07-08 14:57:25 +10:00
Tobias
c95072ea25 AP_GPS: added explicit cast to omit [-Wconversion] warning 2013-07-08 14:53:20 +10:00
Andrew Tridgell
8c49ed78a5 AP_Math: make the rotation numbers easier to find 2013-07-08 12:17:59 +10:00
Andrew Tridgell
a6c7bd3612 AP_Compass: fixed rotations for COMPASS_ORIENT
this matches AHRS_ORIENTATION again
2013-07-08 12:17:59 +10:00
Tobias
338c054da2 Filter: validity of array index was checked AFTER accessing the element.
(correction decreased Program size by 12 bytes)
2013-07-08 12:17:59 +10:00
Tobias
d3ea88e8c7 AP_HAL: resolved -Woverloaded-virtual warning
the function:
virtual size_t AP_HAL::Print::write(const uint8_t *buffer, size_t size);

was hidden in all derived classes by their
virtual size_t write(uint8_t) = 0; implementations.

To solve this, a non-virtual write(const uint8_t *, size_t) that calls a
virtual write_implementation was added.

This isn't necessary atm, because the derived classes don't call
write(const uint8_t *, size_t), BUT this decreases the apm2-quad Program
size by 40 bytes :D and removes warnings.
2013-07-08 12:17:34 +10:00
tobias
1bf135b36f AP_AHRS: make some more functions const 2013-07-08 12:07:50 +10:00
Tobias
ce6529734c HAL_AVR: reorder parameters to remove a warning with -Wreorder 2013-07-08 12:07:50 +10:00
tobias
4e7fea787b HAL_AVR: corrected includes to replace #include "$HEADER" with #inlcude "utility/$HEADER"
adding -I for EVERY DIRECTORY isn't desirable

http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html
2013-07-08 12:07:50 +10:00
Randy Mackay
649cbf6b68 WPNav: reduce default WP_ACCEL and LOITER_SPEED 2013-07-07 16:00:13 -10:00
Randy Mackay
ded31582de AP_AHRS: add Roll90Yaw90 to parameter description
Thanks to Rainer Walther for spotting this
2013-07-07 13:06:40 -10:00
rmackay9
073e2c9f15 ACMotors: bug fix to yaw limit 2013-07-05 13:51:59 -10:00
John Boiles
bb2a6b8a22 HAL_SITL: Fixing SITL build for OSX. 2013-07-05 22:36:57 +10:00
Paul Riseborough
a694b781c7 AP_TECS: Add non airspeed sensor pitch to throttle mode lost during integration 2013-07-05 22:16:39 +10:00
Andrew Tridgell
25f8983383 HAL_AVR: don't initialise TWBR twice 2013-07-05 12:59:14 +10:00
Andrew Tridgell
87f6cc715d AP_TECS: fixed parameter doc formatting 2013-07-04 17:52:40 +10:00
Paul Riseborough
8082122053 TECS-WIP : Fixed bug in initialisation of DT value 2013-07-04 16:57:50 +10:00
Andrew Tridgell
904e6b5b8f AP_TECS: for _DT to at most 0.1 2013-07-04 16:56:57 +10:00
Andrew Tridgell
68232a10f9 AP_TECS: updates to use new aircraft parameter structure 2013-07-04 16:56:57 +10:00
Andrew Tridgell
89271b7774 AP_SpdHgtControl: added speed/height control interface
this will be used by TECS
2013-07-04 16:56:57 +10:00
Andrew Tridgell
80e0f8044c AP_AHRS: added airspeed_sensor_enabled() function 2013-07-04 16:56:57 +10:00
Paul Riseborough
5b0129e02b AP_TECS: first implemention of TECS altitude control library 2013-07-04 16:56:56 +10:00
Paul Riseborough
7bdb098e77 AP_Baro: added get_EAS2TAS()
this provides the scaling factor between equivalent and true airspeed
based on altitude
2013-07-04 16:56:56 +10:00
Andrew Tridgell
61361dac9b AP_Baro: added units to baro documentation 2013-07-04 16:56:56 +10:00
Paul Riseborough
3b98bbd159 AP_Baro: more precise altitude calculation on PX4
if not using an AVR CPU then use a more computationally expensive
altitude calculation, which is more precise at higher altitudes
2013-07-04 16:56:56 +10:00
Andrew Tridgell
fff777bda2 MAVLink: update to latest upstream message defintions XML
this adds new HIL support for airspeed, and common SIM_STATE and
RADIO_STATUS messages
2013-07-01 15:38:45 +10:00
Andrew Tridgell
6b7b69a048 RC_Channel: added secondary rudder support
this is used when nose wheel steering needs different reverse/range
from rudder
2013-06-29 17:31:03 +10:00
Randy Mackay
b16ce5e523 AVR I2C: bug fix
Fix provided by both Jason Short and lucafedechen independently
2013-06-28 07:09:05 -10:00
phokur
b00e5d95c9 Update AnalogIn.cpp
Fixed AnalogIn.cpp:42: undefined references

Full error msgs:
/cygdrive/c/MAVPRO~1/ardupilot/libraries/AP_HAL_Empty/AnalogIn.cpp:42: undefined reference to `Empty::EmptyAnalogSource::set_stop_pin(unsigned char)'
/cygdrive/c/MAVPRO~1/ardupilot/libraries/AP_HAL_Empty/AnalogIn.cpp:42: undefined reference to `Empty::EmptyAnalogSource::set_settle_time(unsigned short)'
2013-06-26 23:22:08 -10:00
Craig@3DR
1a3ed2d80b AP_Compass: Corrected COMPASS_ORIENT Parameter Description 2013-06-26 19:14:24 -07:00
Randy Mackay
6cd18868c2 AirSpeed: fix example sketch compile error 2013-06-25 22:45:30 +09:00
Randy Mackay
20ed00dcc9 AP_InertialSensor: relax accel offset sanity check 2013-06-25 14:19:42 +09:00
Andrew Tridgell
7d42a0562d AP_AHRS: cope better with large GPS yaw changes
this should cope better with bungee launches when using only GPS for
yaw.
2013-06-25 12:44:26 +10:00
Andrew Tridgell
169b5a30a5 AP_Camera: added CAM_TRIGG_DIST parameter
for triggering every N meters of GPS distance travelled
2013-06-25 12:44:26 +10:00
Andrew Tridgell
7902d57877 AP_Relay: added RELAY_PIN parameter
makes it easier to choose a pin
2013-06-24 22:39:18 +10:00
Paul Riseborough
2204b30e66 Plane: Added APM_Control integrator limits to table used to covert old PID values 2013-06-22 21:59:47 +10:00
Paul Riseborough
147856e73c APM_Control: Added integrator limiting adjustable by an advanced user parameter
this is compatible with the old IMAX settings
2013-06-22 21:55:27 +10:00
Paul Riseborough
d8dab7b5c7 APM_Control: Pitch Control - Reduced the speed below which the integrator is locked
This is to allow for slow speed flare manoeuvres in FBW modes
2013-06-22 21:49:40 +10:00
Randy Mackay
aa2b10f044 AP_Baro: TEMP parameter comment fix 2013-06-18 11:28:36 +09:00
Randy Mackay
dde19c9585 WPNav: add acceleration parameter
WP_ACCEL added to allow user control of acceleration during missions.
Loiter acceleration made to be half of loiter max speed
2013-06-16 11:40:51 +09:00
Randy Mackay
272f0e5032 Copter: reduce twitch when entering CIRCLE mode
Set loiter target and prev iterations velocity when circle mode is
started
Start circling from projected stopping point
2013-06-15 18:18:30 +09:00
Andrew Tridgell
d7d87f827e HAL_PX4: support voltage monitoring on multi-connector pin 5 2013-06-05 08:24:20 +10:00
Paul Riseborough
3ad35363be Plane : APM_Control : Removed scaler incorrectly applied to the integrator path 2013-06-04 18:09:06 +10:00
Andrew Tridgell
f44f7308e8 AP_Param: we don't need to avoid writes in AP_Param now
now handled in the HAL
2013-06-04 14:02:49 +10:00
Andrew Tridgell
2316c3bd11 AP_HAL: make storage->write_block() take a const pointer 2013-06-04 14:02:13 +10:00
Andrew Tridgell
3c9d45d7d0 HAL_AVR: avoid writing bytes to EEPROM that are already correct
this speeds up writing of waypoint data, reducing latency
2013-06-04 13:33:41 +10:00
Andrew Tridgell
02252b5387 RC_Channel: removed reference to dip switches 2013-06-03 17:49:56 +10:00
Andrew Tridgell
aaaa5247e3 AP_AHRS: make it possible to setup board orientation at runtime 2013-06-03 16:52:28 +10:00
Andrew Tridgell
45b385cf81 AP_RCMapper: improved docs for RCMAP_* 2013-06-03 16:28:05 +10:00
Andrew Tridgell
c0058bbb03 RC_Channel: added output_trim() and read() functions
these make using rcmap in the plane code easier
2013-06-03 16:23:48 +10:00
Andrew Tridgell
033828aeb6 AP_Mount: make the code a bit easier to read 2013-06-03 16:23:48 +10:00
Andrew Tridgell
9076f6a1d0 AP_Mount: use RC_Channel::rc_channel() instead of rc_ch[] 2013-06-03 16:23:47 +10:00
Andrew Tridgell
0438952a8b RC_Channel: removed global rc_ch[] array
hide it as a object static instead
2013-06-03 16:23:47 +10:00
Randy Mackay
e9594c8b80 RCMapper: simple mapping object for primary input channels
allows arbitrary mapping of first 4 channels
2013-06-03 16:23:47 +10:00
Andrew Tridgell
68adeb041d AP_Airspeed: support ARSPD_PIN option for choosing source
this gives us support for arbitrary analog pins for the airspeed
sensor, plus support for the EagleTree airspeed driver on PX4
2013-06-03 11:51:09 +10:00
Andrew Tridgell
26b7de668a AP_Param: fixed parameter save bug
This bug affected parameters where the defaults are overridden in the
object constructor. For example, a PID object may have a default value
for PID_D of 0.0, but have a constructor based default of 0.2. If the
user tries to set the value to exactly 0.0, then the set wouldn't happen,
as the value matches the value in the object default var_info[]
table. 

This change ensures we force a save to eeprom if the value is changing
from the current value, regardless of the var_info[] default.

Thanks to Tom Coyle for finding this bug!
2013-06-02 14:49:34 +10:00
Andrew Tridgell
05889391e5 APM_Control: cope with zero integrator or tconst
if the user zeros the integrator tuning factor, we need to zero the
integrator
2013-06-01 22:29:38 +10:00
Andrew Tridgell
512d3d811d APM_Control: neaten up code formatting 2013-06-01 22:29:38 +10:00
Randy Mackay
7a2afb7443 Copter Nav: add accessor for waypoint speed 2013-06-01 18:21:29 +09:00
Randy Mackay
8b87849acd Math: add wrap_PI 2013-06-01 18:21:29 +09:00
Andrew Tridgell
c82caeeba1 HAL_AVR: configure analog inputs as INPUT without pullup
not all pins were defaulting to this, which led to some strange
readings on some devices. First noticed by Andi on a LM335 temperature
sensor
2013-06-01 12:19:02 +10:00
Randy Mackay
89bbf5844f Copter WPNav: remove unused variable 2013-05-31 21:41:32 +09:00
Randy Mackay
8c4a7ec094 Copter WPNav: Leonard's improved speed fix
Also pass in althold gain from main code
2013-05-31 21:03:27 +09:00
Andrew Tridgell
14c8c1bdfc APM_Control: tweak code layout and param descriptions 2013-05-31 17:24:55 +10:00
Randy Mackay
76028fc9d3 Copter Motors: use _min_throttle in output_test 2013-05-31 15:16:04 +09:00
Randy Mackay
28f2f87b26 Copter Motors: minor formatting change 2013-05-31 15:16:04 +09:00
Andrew Tridgell
f4efa92d3b APM_Control: fixed parameter names 2013-05-31 15:31:25 +10:00
Andrew Tridgell
3e8af05d15 APM_Control: match parameter names with old PID controllers
this will make upgrading easier
2013-05-31 14:06:56 +10:00
Andrew Tridgell
53d3ce7d2c APM_Control: fixed some documentation (old parameter names) 2013-05-31 07:58:29 +10:00
Andrew Tridgell
38e414db33 AP_Progmem: fixed type of strncmp_P() 2013-05-31 07:58:29 +10:00
Andrew Tridgell
ad2f6e1217 AP_Param: add support for converting between old and new parameters
this allows for a conversion table between old parameters and new
parameters, making firmware upgrades with moved parameters much easier
for users
2013-05-31 07:58:29 +10:00
Paul Riseborough
716c124f73 APM_control: Modified gain definitions for roll and pitch controllers so PID gains behave like previous servo PIDS
Gain definitions in roll and pitch controllers were updated previously
so that the old PID tuning values could be transferred across.
Updated tuning guide for revised gain definition.
2013-05-31 07:58:20 +10:00
Randy Mackay
a1926441da Copter: use fast tan for accel to lean angle calcs
Committed on behalf of Leonard
2013-05-30 18:25:04 +09:00
Randy Mackay
d81b7b507d Math: add Leonard's fast tan function 2013-05-30 18:24:32 +09:00
Randy Mackay
d203f0295b Copter: bug fix for vertical speed during missions 2013-05-30 11:52:04 +09:00
Andrew Tridgell
3dcdc15201 AP_Navigation: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
Andrew Tridgell
ac2db516b4 APM_PI: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
Andrew Tridgell
941a2c483a AP_LeadFilter: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
Andrew Tridgell
86db955ac9 AP_L1_Control: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
Andrew Tridgell
9da13f3775 AP_InertialNav: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
Andrew Tridgell
e391c34d1e AP_HAL_PX4: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
Andrew Tridgell
e2eca3e273 AP_HAL_AVR_SITL: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
Andrew Tridgell
82aec0ef6c AP_Declination: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
Andrew Tridgell
8f4d4465af AP_Curve: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
Andrew Tridgell
fb7ae8c764 AP_Camera: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
Andrew Tridgell
e75253d019 AP_AHRS: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
Andrew Tridgell
8c25a504c3 AC_PID: fixed indent-tabs-mode 2013-05-30 09:54:53 +10:00
Andrew Tridgell
918a3d46f5 AP_Buffer: fixed indent-tabs-mode 2013-05-30 09:53:15 +10:00
Andrew Tridgell
6c5718a63b APM_Control: fixed indent-tabs-mode 2013-05-30 09:53:02 +10:00
Andrew Tridgell
933088b95a AP_Common: fixed indent-tabs-mode 2013-05-30 09:52:38 +10:00
Andrew Tridgell
4007b7b1e9 AP_Compass: fixed indent-tabs-mode 2013-05-30 09:52:30 +10:00
Andrew Tridgell
edfebc1f29 AP_GPS: fixed indent-tabs-mode 2013-05-30 09:52:21 +10:00
Andrew Tridgell
c92069644d AP_InertialSensor: fixed indent-tabs-mode 2013-05-30 09:52:12 +10:00
Andrew Tridgell
c28ef033a2 AP_Limits: fixed indent-tabs-mode 2013-05-30 09:52:00 +10:00
Andrew Tridgell
5024da2695 AP_Math: fixed indent-tabs-mode 2013-05-30 09:51:51 +10:00
Andrew Tridgell
5fdf6ff4f7 AP_Menu: fixed indent-tabs-mode 2013-05-30 09:51:43 +10:00
Andrew Tridgell
81f7ae9108 AP_Motors: fixed indent-tabs-mode 2013-05-30 09:51:34 +10:00
Andrew Tridgell
1cc02836a0 AP_Mount: fixed indent-tabs-mode 2013-05-30 09:51:24 +10:00
Andrew Tridgell
e69e4a5695 AP_RangeFinder: fixed indent-tabs-mode 2013-05-30 09:51:11 +10:00
Andrew Tridgell
91a60be758 GCS_MAVLink: fixed indent-tabs-mode 2013-05-30 09:50:57 +10:00
Andrew Tridgell
6862791d66 PID: fixed indent-tabs-mode 2013-05-30 09:50:37 +10:00
Andrew Tridgell
c96ac5edbb RC_Channel: fixed indent-tabs-mode 2013-05-30 09:48:45 +10:00
Randy Mackay
4ce4b7aef9 OptFlow: minor commenting and format changes 2013-05-28 22:56:11 +09:00
Andrew Tridgell
15a84972d1 SITL: added SIM_MAG_ERROR parameter
this is a compass yaw error in degrees, used for testing navigation
with a bad compass
2013-05-27 13:37:34 +10:00
Randy Mackay
ec7ee47099 Copter: scaling stability patch 2013-05-27 11:21:31 +09:00
Randy Mackay
dbd6524f9f Copter: WPNav consolidate acceleration #defines 2013-05-27 10:36:24 +09:00
Randy Mackay
e3dffb920b Copter: initialise target vel in loiter 2013-05-25 14:07:04 +09:00
Randy Mackay
a474b97291 Copter: resolve compiler warning re unused vars 2013-05-25 13:32:15 +09:00
Randy Mackay
916f241fff Copter: Leonard's improved Loiter 2013-05-24 23:45:03 +09:00
Andrew Tridgell
14628990e6 AP_AHRS: make wind estimation configurable
rover doesn't want it
2013-05-24 11:21:42 +10:00
Andrew Tridgell
807dbf9786 AP_InertialSensor: fixed a build warning 2013-05-24 11:21:42 +10:00
Randy Mackay
46d65150af Copter: lengthen loiter stopping point
This will make stops less aggressive when entering loiter at very high
speeds (more 7.5m/s)
2013-05-22 17:35:20 +09:00
Randy Mackay
400c1bd7b7 Copter: smooth waypoint transitions
Speed of intermediate point is initialised and constrained based on
current speed vector vs direction to the next waypoint.
This means the copter does not slow if the previous segment and next
segment are in line and also the intermediate point is not advanced
towards the next waypoint if the copter is moving quickly in the
opposite direction.
2013-05-22 14:17:26 +09:00
Andrew Tridgell
59b6118a1d AP_InertialSensor: fixed parameter markup 2013-05-21 17:02:13 +10:00
Randy Mackay
b27ddf0f63 AP_AHRS: add parameter descriptions 2013-05-21 15:39:03 +09:00
Randy Mackay
6a65a32de2 CopterMotors: add formatting info to top of files 2013-05-20 10:48:42 +09:00
Randy Mackay
5235f4cacd Copter: allow Tri copters to init ESCs through APM/PX4 2013-05-19 17:28:39 +09:00
Randy Mackay
b914f9ba06 SITL: use SIM_ENGINE_MUL to simulate motor failure 2013-05-19 14:29:08 +09:00
Andrew Tridgell
c08c084191 AP_AHRS: added get_projected_position()
this is used to project the position forward by the GPS lag
2013-05-17 08:32:21 +10:00
Andrew Tridgell
2c149bac8e HAL_PX4: added new arming ioctls 2013-05-16 16:43:38 +10:00
Randy Mackay
cb795ea536 WPNav: divide by zero checks 2013-05-15 11:51:26 +09:00
Randy Mackay
610edd8f9a ACMotors: small formatting change 2013-05-14 19:01:53 +09:00
Randy Mackay
cd5795a4ac ACMotors: make a few more functions non-virtual
Saves at least 22 bytes of RAM
2013-05-14 18:23:36 +09:00
Randy Mackay
ad00e0ee1e ACMotors: make test_order uint_8 2013-05-14 18:03:34 +09:00
Randy Mackay
88893f4209 ACMotors: make a few functions non-virtual 2013-05-14 17:41:12 +09:00
Randy Mackay
bd07b1e57b ACMotors: remove unused get_num_motors function
Saves about 4 bytes of RAM
2013-05-14 17:35:27 +09:00
Randy Mackay
5bb0582854 ACMotors: ESC Calibration only for enabled motors 2013-05-14 17:07:36 +09:00
Randy Mackay
33d1129904 Copter: remove unused TB_RATIO parameter 2013-05-14 16:56:55 +09:00
Randy Mackay
7a81c41689 AP_Motors: motor_enabled array to bool
Also increased the default MAX_THROTTLE from 850 to 1000 but this number
is always overwritten by the main code anyway so should have no
functional impact.
2013-05-14 16:05:22 +09:00
Andrew Tridgell
411e940342 DataFlash: prevent the dataflash erase problem
only allow writes to dataflash block devices once StartNewLog() has
been called
2013-05-14 16:31:45 +10:00
Andrew Tridgell
119ffb0fc0 SITL: fixed simulated airspeed value 2013-05-13 15:42:38 +10:00
Andrew Tridgell
a5b20b4dfc AP_HAL: removed scaling factor on analog sources
these are not use anymore, as voltage_average() is used instead
2013-05-13 15:29:42 +10:00
Andrew Tridgell
48cfdac6f0 AP_ADC_AnalogSource: added voltage_average_ratiometric() 2013-05-13 15:13:59 +10:00
Andrew Tridgell
cec08be9cb AP_Rangefinder: use ratiometric analog input for analog sonar 2013-05-13 15:13:43 +10:00
Andrew Tridgell
dfb98490f4 AP_Airspeed: use rationmetric analog input for airspeed sensor 2013-05-13 15:13:19 +10:00
Andrew Tridgell
589b8cdb58 AP_HAL: added voltage_average_ratiometric() call to AnalogIn
this is for ratiometric sensors such as the 3DR airspeed sensor and
the Maxbotix analog sonar
2013-05-13 15:12:43 +10:00
Andrew Tridgell
a17b85c661 AP_AHRS: use vectors for ground vector complimentary filter 2013-05-13 11:27:55 +10:00
Paul Riseborough
9f309a2aa6 AP_L1_Control: Remove potential nan errors
If WP A and B were the same or ground speed was exactly zero, then the
previous code would produce a nan output.  Protection against these
two cases has been added.

If WP A and B are equal, we track directly to the target waypoint
2013-05-13 11:27:51 +10:00
Randy Mackay
55235630b6 Copter: bug fix for slow loiter repositioning 2013-05-12 14:51:02 +09:00
Andrew Tridgell
9bdbd6bfbd MAVLink: update to latest common.xml from upstream 2013-05-11 21:07:27 +10:00
Randy Mackay
61288fcb90 WPNav: make get_stopping_point method public 2013-05-11 16:05:42 +09:00
Randy Mackay
80bd458f29 Compass: update parameter description
We do not want people modifying the COMPASS_MOTCT manually
2013-05-11 14:50:36 +09:00
Andrew Tridgell
172faeea26 HAL_PX4: moved rc.APM to new ROMFS directory 2013-05-10 06:16:54 +10:00
Andrew Tridgell
b3e21c6add HAL_PX4: include visibility.h
needed for new nuttx structure
2013-05-10 06:16:53 +10:00
Andrew Tridgell
220e7b019c SITL: use PACKED attribute in fdm structure 2013-05-09 20:10:31 +10:00
Andrew Tridgell
416fef73a8 AP_Param: use PACKED attribute in examples 2013-05-09 20:10:31 +10:00
Andrew Tridgell
ed918dc6bc SITL: use PACKED attribute instead of pragma pack 2013-05-09 20:10:31 +10:00
Andrew Tridgell
06b6f4b04e AP_GPS: use PACKED attribute instead of pragma pack 2013-05-09 20:10:31 +10:00
Andrew Tridgell
62b9a580e8 AP_Common: make PACKED depend on architecture
this will remove lots of warnings when building with arduino
2013-05-09 20:10:31 +10:00
Randy Mackay
ed5ddfd9db WPNav: initialise desired roll, pitch
bug-fix to resolve 1/10th second twitch when loiter or waypoint
controller are first engaged
2013-05-09 18:32:02 +09:00
Andrew Tridgell
fefbeacf86 AP_InertialSensor: use SEVERITY_USER_RESPONSE for accel cal messages
thanks to the suggestion from Kevin
2013-05-09 09:28:25 +10:00
Andrew Tridgell
11bf6f40f7 GCS_MAVLink: moved gcs_severity to library header 2013-05-09 09:27:58 +10:00
Andrew Tridgell
9a87b3f3c1 AP_Compass: use const on more functions and remove old calculate_heading()
the calculate_heading() based on roll/pitch is not needed anywhere
2013-05-09 09:24:06 +10:00
Andrew Tridgell
f78de63a09 AP_Compass: more efficient calculate_heading() implementation
Thanks to piersh for this improvement. See

b5f0635455 (commitcomment-3171806)
2013-05-09 09:24:06 +10:00
Randy Mackay
9f735c8d03 WPNav: add fast waypoints flag
Waypoint is considered "reached" when the intermediate point reaches the
destination
2013-05-09 00:18:02 +09:00
Randy Mackay
4704b729c2 WPNav: reduce max acceleration to 2.5m/s
Also includes bug fix to ramp up of speed of intermediate point
2013-05-08 23:20:29 +09:00
Andrew Tridgell
095505129c DataFlash: hopefully fixed cause of frequent dataflash erase
Wait for 0.1s after erase and before we start writing parameters to
the log

Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
2013-05-08 17:00:36 +10:00
Andrew Tridgell
7fdf1b6f78 DataFlash: fixed example build 2013-05-08 16:45:40 +10:00
Andrew Tridgell
8f57b72e3f AP_InserialSensor: fixed example build 2013-05-08 16:45:31 +10:00
Andrew Tridgell
c3738ed344 AP_InertialNav: fixed example build 2013-05-08 16:45:21 +10:00
Andrew Tridgell
ed93f80ba9 AP_Baro: fixed example build 2013-05-08 16:45:07 +10:00
Andrew Tridgell
55d148abdd AC_WPNav: fixed example build 2013-05-08 16:44:59 +10:00
Andrew Tridgell
56694fd9b1 AC_Fence: fixed example build 2013-05-08 16:44:50 +10:00
Andrew Tridgell
2ddeaa7f4d AP_InertialSensor: show calibration offsets for success and failure
Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
2013-05-08 16:19:06 +10:00
Andrew Tridgell
f3f4b7205c AP_InsertialSensor: added support for MAVLink user interaction
allows APM to ask user to print enter to continue via MAVLink messages
during accel calibration
2013-05-08 16:18:40 +10:00
Andrew Tridgell
4bc53acbda SITL: support vsnprintf with %S on SITL 2013-05-08 16:17:36 +10:00
Andrew Tridgell
9cd0af1132 HAL_PX4: make PX4 snprintf support %S format
just maps it to %s for normal printf
2013-05-08 16:17:06 +10:00
Andrew Tridgell
223dfe4de5 AP_Rangefinder: added units for settle time 2013-05-08 14:21:32 +10:00
Randy Mackay
328d900647 WPNav: flexible loiter speed
Also includes bug fix to allow speeds > 10m/s during missions
2013-05-07 17:11:24 +09:00
Randy Mackay
1f8161b493 AC_WPNav: remove unnecessary speed constraint 2013-05-07 11:58:04 +09:00
priseborough
aee23361dd APM_Control: Corrected typographical error in APM_Control/TuningGuide.txt 2013-05-07 11:00:57 +10:00
Andrew Tridgell
6f1cee6406 AP_AHRS: fixed position estimate with 2D fix or low satellite count
we should still use the GPS for position fixes when we have a low
number of satellites, but we should stop using it for velocity
estimates and attitude correction.
2013-05-07 10:52:14 +10:00
Andrew Tridgell
055da3c4b6 SITL: added SIM_GPS_NUMSATS parameter
this allows testing of the DCM code with less than 6 satellites
2013-05-07 10:38:36 +10:00
Randy Mackay
ceda7d26b0 AHRS: add correct_centrifugal and flags structure 2013-05-06 15:32:06 +09:00
Andrew Tridgell
46c6aa8a9a APM_Control: tweak the parameter names 2013-05-05 21:51:09 +10:00
Andrew Tridgell
400777b059 APM_Control: support inverted flight in AP_PitchController
auto-reverse pitch control when inverted. This is useful not just for
inverted flight mode, but also for recovering from poor manual flight

Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
2013-05-05 21:51:09 +10:00
Andrew Tridgell
604bfd0700 APM_Control: adjust recommended ranges 2013-05-05 21:51:09 +10:00
Andrew Tridgell
7af3c667a5 APM_Control: added roll controller parameter docs 2013-05-05 21:51:09 +10:00
Andrew Tridgell
52c3f8841f APM_Control: added yaw parameter docs 2013-05-05 21:51:09 +10:00
Andrew Tridgell
b618d1d81f APM_Control: added inline docs to pitch controller 2013-05-05 21:51:09 +10:00
Andrew Tridgell
6c6c0079ee APM_Control: improved formatting of tuning guide
be a bit more web friendly
2013-05-05 21:51:09 +10:00
Andrew Tridgell
742df0ac05 APM_Control: rename to avoid spaces in filenames 2013-05-05 21:51:09 +10:00
Andrew Tridgell
23d9c31b0a APM_Control: fixed build and merge errors 2013-05-05 21:51:08 +10:00
Paul Riseborough
10ecffce01 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.
2013-05-05 21:51:08 +10:00
priseborough
205397d030 APM_Control: Modified calculation of bank compensation rate offset to prevent climb if speed > max fbw speed
The previous calculation constrained the speed used to calculate the
bank compensation rate offset between the min and max fbw speeds. This
would result in an unwanted climb if flown above the max fbw speed
(this could happen in fbw-a mode)
2013-05-05 21:51:08 +10:00
priseborough
e7736ed4e0 APM_Control: APM tuning guide.txt - Updated tuning instructions with numerical values for alternate method 2013-05-05 21:51:08 +10:00
Paul Riseborough
3034a9fab2 APM_Control: Added alternate tuning method for roll and pitch loops
The alternate tuning method for roll and pitch will give a better
results, but comes with more risk as it will result in a larger rate
feedback gain
2013-05-05 21:51:08 +10:00
priseborough
2c29186b03 APM_Control: APM tuning guide.txt - Minor editorial corrections 2013-05-05 21:51:08 +10:00
priseborough
d159d39037 APM_Control: APM tuning guide.txt - Added step by step tuning description. 2013-05-05 21:51:08 +10:00
priseborough
99f0fb6bd2 APM_Control : Removed 20Hz low-pass filters on rate gyro inputs.
These are not required due to MPU 6000 filtering.
2013-05-05 21:51:08 +10:00
priseborough
317b75f4cd APM_Control: Added tuning guide readme 2013-05-05 21:51:08 +10:00
Andrew Tridgell
9654546b5a AP_L1_Control: Cleaned up calculation of damping to reduce computations
also removed _cross2D, using math library instead
2013-05-05 21:51:08 +10:00
Randy Mackay
30faf87715 InertialNav: use AP_Math's longitude_scale 2013-05-05 14:32:25 +09:00
Randy Mackay
7c9d9b9800 AP_Math: use DEG_TO_RAD in longitude_scale
Also increased accuracy of RadiansToCentiDegrees although it is like the
compiler will throw away the extra digits anyway.
2013-05-05 14:31:24 +09:00
Andrew Tridgell
38fc0e61c6 AP_AHRS: optimise yaw drift correction
use new vector2 cross product, and factor out the z component of a dcm
mul_transpose() to reduce the number of floating point operations for
a yaw drift correction cycle
2013-05-05 13:51:45 +10:00
Andrew Tridgell
737f0305ef AP_Math: implement vector2 cross product
useful in DCM for faster yaw correction
2013-05-05 13:47:51 +10:00
Andrew Tridgell
f4189e083b AP_Math: added mulXY() for matrix3 and vector3
returns the XY components of the product
2013-05-05 13:47:23 +10:00
Randy Mackay
ee2daf25b6 AHRS: perf improvement by caching declination vector 2013-05-05 12:58:43 +10:00
Andrew Tridgell
943a1d8c8d AP_AHRS: added AHRS_GPS_MINSATS option
if the number of visible satellites is below AHRS_GPS_MINSATS then
don't use the GPS for acceleration correction for attitude
2013-05-05 12:48:01 +10:00
Randy Mackay
c20eac7a70 AP_InertialNav: use standard LATLON_TO_CM, DEG_TO_RAD constants 2013-05-04 15:04:55 +09:00
Andrew Tridgell
99d21854f9 SITL: fixed drift rate limit in simulator 2013-05-04 15:16:35 +10:00
Andrew Tridgell
53ebcfeba5 SITL: fixed compass vector to be based on yaw not GPS heading
Many thanks to Randy for noticing this, and apologies for the wasted time!
2013-05-04 14:28:08 +10:00
Randy Mackay
1cfd5900a8 Copter: add support for H-quad frame
H-quads are like X quads but the motors spin in the opposite direction.
Having the motors reversed seems to help with yaw authority because of
the slight flex in bodies
2013-05-03 23:13:40 +09:00
Randy Mackay
647a93e78e Copter: remove jerk when entering RTL or AUTO
Loiter target position was not being initialised properly.
Add a few more comments
2013-05-03 16:58:00 +09:00
Randy Mackay
bd75de6a22 AC_Fence: reduce to 150m radius and 100m high
100m high,
2013-05-03 14:57:37 +09:00
Andrew Tridgell
6cc9939891 AP_ADC: added dummy stop_pin and settle_time calls 2013-05-03 11:11:40 +10:00
Andrew Tridgell
0e66bac70b AP_RangeFinder: removed special case for APM1
the airspeed port doesn't have enough power for the sonar anyway
2013-05-03 10:09:54 +10:00
Andrew Tridgell
244a10aeb6 HAL_SMACCM: fixed build for new AnalogIn API 2013-05-03 10:09:14 +10:00
Andrew Tridgell
9bc48c9894 HAL_PX4: fixed build with new AnalogIn API
pin settle times not actually implemented on PX4 yet
2013-05-03 10:09:02 +10:00
Andrew Tridgell
5ac493908c SITL: fixed build with new AnalogIn API 2013-05-03 10:08:39 +10:00
Andrew Tridgell
09ca9d4283 AP_Rangefinder_analog: implement settle time and stop_pin 2013-05-03 09:45:19 +10:00
Andrew Tridgell
5d80a5619d HAL_Empty: add new API functions 2013-05-03 09:45:19 +10:00
Andrew Tridgell
912ed2c97c HAL_AVR: initialise settle time 2013-05-03 09:45:19 +10:00
Andrew Tridgell
e7a6b12ac1 HAL_AVR: support set_stop_pin() and set_settle_time() for analogin
useful for dual sonar support
2013-05-03 09:45:19 +10:00
Andrew Tridgell
0b6cfc7294 AP_HAL: added set_stop_pin() and set_settle_time() interfaces to analogin
this is for multiple sonars on one vehicle, to prevent them
interfering with each other
2013-05-03 09:45:19 +10:00
Andrew Tridgell
0242d50ad4 DataFlash: added Log_Write_Message()
useful for logging general messages
2013-05-03 09:18:14 +10:00
Andrew Tridgell
ccd38e58a1 HAL_PX4: fixed the scaling on the analog pins 2013-05-02 21:40:15 +10:00
Andrew Tridgell
500497f5fa AP_HAL: update AnalogIn test to show the first 16 pins 2013-05-02 21:31:55 +10:00
Andrew Tridgell
c90d44c121 AP_Compass_HIL: fixed indentation 2013-05-02 21:31:17 +10:00
Andrew Tridgell
26bf636541 AP_Baro: fixed a build warning 2013-05-02 21:31:04 +10:00
Andrew Tridgell
65183887e5 SITL: use new baro setHIL method 2013-05-02 15:27:27 +10:00
Andrew Tridgell
90cf1b0386 AP_ADC: removed unused setHIL method 2013-05-02 15:27:16 +10:00
Andrew Tridgell
7cec3caf19 AP_Baro: cleaned up setHIL method
move pressure calculation into library
2013-05-02 15:26:38 +10:00
Andrew Tridgell
c6c1fce2f1 AP_Baro: removed HIL constructor
this wasn't calling the parent class
2013-05-02 15:16:52 +10:00
Andrew Tridgell
811c2ccc11 libraries: fixes for AP_Baro_HIL 2013-05-02 15:09:05 +10:00
Andrew Tridgell
2d089174cd AP_Baro: rename AP_Baro_BMP085_HIL to AP_Baro_HIL
there is nothing specific to the BMP085 in it
2013-05-02 15:08:42 +10:00
Andrew Tridgell
a09c53a3ea SITL: use new HIL compass API 2013-05-02 15:01:47 +10:00
Andrew Tridgell
f72dd560cb AP_Compass: fixed the HIL sensors compass
this sets up good compass values for HIL sensors
2013-05-02 14:59:33 +10:00
Andrew Tridgell
86027f6e0f AP_Compass: fixed PX4 build 2013-05-02 13:00:52 +10:00
Andrew Tridgell
af50b652f8 AP_Compass: removed old orientation defines
we now use the rotations in libraries/AP_Math/rotations.h
2013-05-02 12:48:14 +10:00
Andrew Tridgell
261eb6d841 AP_Declination: fixed example build 2013-05-02 12:48:14 +10:00
Andrew Tridgell
54b826a583 AP_AHRS: update for new compass API 2013-05-02 12:48:14 +10:00
Andrew Tridgell
217f34e155 AP_Compass: added COMPASS_ORIENT parameter, to support external compasses
this allows the user to configure the compass for any orientation
supported by our rotation library
2013-05-02 12:48:14 +10:00
Andrew Tridgell
ba83950fc4 libraries: replace constrain() with constrain_float()
this makes the type much more obvious. Thanks to Tobias for the
suggestion.
2013-05-02 10:25:40 +10:00
Andrew Tridgell
813e767efb AP_Param: use const refs in a few more places
reduces code size by a couple of hundred bytes
2013-05-02 10:18:36 +10:00
Randy Mackay
4fcb189c97 GCS_MAVLink: typo in message definition 2013-05-01 17:07:18 +09:00
Randy Mackay
2d17688363 AC_Fence: add backup fence
Also includes fixes from code review with Tridge
2013-05-01 17:05:04 +09:00
Andrew Tridgell
0fce0eb488 AP_Compass_PX4: fixed handling of a saturated compass
a saturated compass is now marked unhealthy, rather than causing the
code to spin waiting for a valid sample. This fixes a problem with
strong magnets causing the main flight loop to stop
2013-05-01 08:54:53 +10:00
Andrew Tridgell
d7ec985029 AP_Baro_PX4: fixed baro driver to run at full rate
we were skipping samples due to a timer handling bug. It now checks
for new samples at 100Hz
2013-05-01 08:54:53 +10:00
Randy Mackay
ad01aeee44 Copter: increase max loiter overshoot to 8.12m 2013-04-30 18:07:48 +09:00
Randy Mackay
8122a32114 InertialNav: reduce XY TC to 2.5 (was 3)
More objective testing is required to arrive at the ideal number but 2.5
seem better than 3.0 at reducing "toiletbowling" and anecdotal evidence
does not show much downside.
2013-04-30 12:52:28 +09:00
Randy Mackay
c139134192 Copter: increase max loiter speed to 7.5m/s 2013-04-30 12:49:19 +09:00