Commit Graph

3645 Commits

Author SHA1 Message Date
Andrew Tridgell e656928c01 AP_Param: added a set_and_save_ifchanged() method
this can be used to avoid the scan() in more frequenctly saved
variables, such as the MAVLink stream rates in APM
2012-02-18 10:51:57 +11:00
Andrew Tridgell 6f080742b8 AP_Param: added an initialised() method
this will be used by the compass code
2012-02-18 10:51:57 +11:00
Jason Short 677df0fe1c added Rate_D tuning value 2012-02-17 15:23:59 -08:00
Jason Short 0d5f7ca072 upped rate loop to 250hz 2012-02-17 15:23:59 -08:00
justinbeech 5255512bf9 Found free extra 256 bytes of RAM eliminate _clz use from libgcc
Believe it or not, changing / 2^31 to >>31 saved 256 bytes in the "d" segment.

The reason is that GCC version prior to 4.3.5 does not have a count_leading_zeros (clz) assembler macro, so it uses a 256 byte lookup table called _clz
The _clz table gets pulled in if you do 64 bit division.
This tiny change is the only place that we do long long division.
Changing to a shift saves 256 bytes of ram.
2012-02-17 09:46:05 +00:00
Michael Oborne d0c67debee APM Planner 1.1.37
fix misc errors
update polish
fix linux/mac bug. - seems alot more stable
2012-02-17 17:09:27 +08:00
Jason Short 03aa28224b re-implemented WII Dampening filter for Marco. 2012-02-16 22:38:23 -08:00
Jason Short 9c7b8586d5 Adjusted gains to move closer to Marco's tests 2012-02-16 22:19:39 -08:00
Jason Short 560985b509 made I term return in same pattern as D term 2012-02-16 22:09:22 -08:00
Jason Short 75919436ac added extra gain logging 2012-02-16 22:09:22 -08:00
Jason Short cbe297b634 scaled X velocity 2012-02-16 22:09:22 -08:00
Jason Short 6732f0934a cast to float 2012-02-16 22:09:21 -08:00
Jason Short 6913400221 cast D term to float just in case 2012-02-16 22:09:21 -08:00
Jason Short 43e695b1ac removed some unused vars,
formatting, made loop speed same as PIDT1 to eliminate variable.
2012-02-16 22:09:21 -08:00
Andrew Tridgell 3fbb5a2d6c ADC: on channel overflow we should not zero last_ch6_micros
this happens every 64 seconds because of unused channels on the
ADC. Zeroing this creates a bad delta_t value for the DCM code.
2012-02-16 17:48:36 +11:00
Phil f8ed9f0e8d APM: Fix rudder in elevon mode.
elevon planes can have rudders too
2012-02-16 14:43:24 +11:00
Jason Short b070225366 CH 6 Range setup 2012-02-15 11:47:54 -08:00
Jason Short bb4c02fbff Added acro_p to the params 2012-02-15 11:29:25 -08:00
Jason Short f2b6b86265 allow auto-land if failsafe is triggered 2012-02-15 10:53:54 -08:00
Jason Short efb451e475 Marco's updated Motor testing code 2012-02-15 10:49:35 -08:00
Jason Short f9296796fd Added lengthy note about motor testing 2012-02-15 10:49:11 -08:00
Jason Short 0b011e3cd3 added option in code for Loiter specific gains 2012-02-15 09:10:15 -08:00
Jason Short 101979ed7b AP slew rate 2012-02-15 09:10:15 -08:00
Jason Short f20952df49 new defaults for params 2012-02-15 09:10:15 -08:00
Jason Short 11d1973abd Added Acro_P 2012-02-15 09:10:14 -08:00
Jason Short 67892cd8df synced params 2012-02-15 09:10:14 -08:00
Jason Short c916a87a78 added RTL_land_enabled
added auto_pilot slew rate
2012-02-15 09:10:14 -08:00
Jason Short eee43608de Added new params for CH6 Tuning
moved enums to give more room for additional PIDs for Loiter
added new Acro_P gain
added auto_land_enabled option
added pi_loiter_lon and pi_loiter_lat for separate tuning of loiter
2012-02-15 09:10:14 -08:00
Jason Short 4ecbb19dcd Added range setting via a parameter for CH6 tuning 2012-02-15 09:10:14 -08:00
Jason Short 8e88d9e19e change constant to float 44330.0 2012-02-15 09:10:14 -08:00
Michael Oborne b020a87c13 eedump ap param in perl 2012-02-15 21:31:58 +08:00
Andrew Tridgell bc89b53bdc SITL: adjust the SITL compass code to have saner z values 2012-02-15 22:34:16 +11:00
Andrew Tridgell 63d768143d Compass: enable compass offsets for HIL compass
this makes the null_offsets algorithm have an effect for the HIL
compass that is used for SITL, which makes for easier testing of
compass calibration
2012-02-15 22:33:50 +11:00
Andrew Tridgell 7d21692301 fixed dump size 2012-02-15 10:44:09 +11:00
Andrew Tridgell d2cc6740f0 show group_element too 2012-02-15 10:42:21 +11:00
Andrew Tridgell aaba4db144 AP_Param: added eeprom_aaparam.c dump utility 2012-02-15 10:41:06 +11:00
Andrew Tridgell 2dcb594f4a APM: changed hold_course for landing to be based on yaw_sensor
when we are in the final stages of a landing (less than 2 seconds from
landing waypoint, or less than 3m above landing altitude) we switch
the navigation to use a fixed course. The code previously used the
crosstrack_bearing for this, but this can lead to a large nav_roll in
this final stage of the approach, which can put a wing into the
runway. In autotest we were seeing a nav_roll value of -45 degrees as
we crossed the transition point for the landing, which often led to a
crash.

This changes the code to use the current yaw_sensor value instead,
which is much less likely to lead to large rolls in the final landing
stages.
2012-02-15 08:50:45 +11:00
Andrew Tridgell c6b6320b43 APM: report the nav_bearing as hold_course when enabled
this gives a more accurate view of the navigation code, as when
hold_course is not -1 it overrides nav_bearing
2012-02-15 08:50:45 +11:00
Andrew Tridgell 252a2d0c9b APM: added some comments related to hold_course
hold_course is either -1 (for disabled) or a course to hold for
takeoff/landing. This makes the code a bit clearer.

It also resets hold_course in all non-auto modes, to ensure it isn't
used
2012-02-15 08:50:45 +11:00
Andrew Tridgell a4663c4b20 autotest: increase the rudder gain
this gives a bit better landing approach and turns in auto
2012-02-15 08:50:45 +11:00
Andrew Tridgell 812b7ae5ae SITL: catch floating point errors
if we get a FPE then log a message and exit
2012-02-15 08:50:45 +11:00
Andrew Tridgell c39914e734 DCM: added a SITL_debug() for DCM normalisation errors
I have seen normalisation errors during simulation runs, but have not
yet tracked down the cause. This log message may help track things
down.
2012-02-15 08:50:45 +11:00
Andrew Tridgell 7355f5613c added SITL_debug() macro
this can be used to print a message into the logs in the SITL
simulator. This will be used for critical conditions.
2012-02-15 08:50:45 +11:00
Andrew Tridgell 7ba65aecf3 RC_Channel_aux: fixed a uninitialied variable error, and save a bit of stack space 2012-02-15 08:50:45 +11:00
Michael Oborne eaf041dd8c APM Planner 1.1.36
add guided mode wp
fix setup setting save (if closed without switching tabs)
2012-02-14 22:13:11 +08:00
Andrew Tridgell c93dedc955 when setting airspeed and groundspeed in a mission, don't save to EEPROM
If you include airspeed, throttle or groundspeed changes in a mission
then those should not be saved to EEPROM, as otherwise if you restart
and re-fly the mission you will be starting with different parameters
to the ones you used for the first flight.

This is particularly important for setting the target airspeed when
coming in for a landing. You typically set a low target, but if you
fly again the next day I think it would be a real surprise to find
that your loiter airspeed has then changed to the value from the
landing part of your last mission.

This one can be argued either way, but I think that not saving these
changes is the more conservative choice, and better fits the
'principal of least surprise'
2012-02-14 15:20:44 +11:00
Andrew Tridgell b166fbff5a autotest: use more rudder for steering
this helps the landing a lot
2012-02-14 15:16:35 +11:00
Andrew Tridgell 6b33e48514 autotest: raise the target airspeed on landing
we were stalling the plane in the final meters of the approach
2012-02-14 12:30:46 +11:00
Andrew Tridgell 27fd4ca213 autotest: adjusted APM parameters
enable compass and tweak tuning
2012-02-14 11:26:42 +11:00
Andrew Tridgell c105645c57 autotest: added a lot more interal checking
check each of the sub-tests pass for overall pass
2012-02-14 11:26:42 +11:00