Commit Graph

92 Commits

Author SHA1 Message Date
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
James Bielman 5631f865b2 Update floating point calculations to use floats instead of doubles.
- Allows use of hardware floating point on the Cortex-M4.
- Added "f" suffix to floating point literals.
- Call floating point versions of stdlib math functions.
2013-01-16 13:52:01 +11:00
Andrew Tridgell 374af1cd14 build: change from Arduino.mk to apm.mk 2013-01-02 17:29:37 +11:00
Andrew Tridgell a1187519a8 AP_HAL: use AP_HAL_BOARD_DRIVER in remaining test sketches 2012-12-20 14:52:37 +11:00
Pat Hickey eb530b86e8 move Arduino.mk to /mk/Arduino.mk 2012-12-20 14:52:35 +11:00
Andrew Tridgell 7d27e420ae AP_HAL: remove unnecessary Arduino.h includes 2012-12-20 14:52:30 +11:00
Andrew Tridgell 69af1add15 Declination: fixes for AP_HAL progmem interface 2012-12-20 14:51:38 +11:00
Pat Hickey 475da4eca4 CONFIG_HAL_BOARD - test sketches fixed up, build all passes 2012-12-20 14:51:37 +11:00
Pat Hickey a4f1f6a5db AP_Progmem: fix dependencies for all sketches touched by AP_HAL_AVR 2012-12-20 14:51:28 +11:00
Pat Hickey 9aada26e34 AP_Declination: translated to AP_HAL 2012-12-20 14:51:26 +11:00
Pat Hickey 3f1d9d7f69 AP_Param: #include <AP_Param.h> fixups for libraries & sketches
* I mostly went through with grep and added an #include <AP_Param.h> below
  every #include <AP_Common.h>. Not all of these example sketches might
  strictly need AP_Param.
2012-12-20 14:51:19 +11:00
rmackay9 56f88821e9 AP_AHRS: fix example sketch
AP_Airspeed: fix example sketch
AP_Baro: fix example sketch
AP_Declination: fix example sketch
AP_Math: fix example sketch
2012-11-08 00:08:18 +09:00
uncrustify d6d51e4116 uncrustify libraries/AP_Declination/AP_Declination.h 2012-08-21 19:01:34 -07:00
uncrustify bcfff533f0 uncrustify libraries/AP_Declination/AP_Declination.cpp 2012-08-21 19:01:34 -07:00
uncrustify 6f4533c8a8 uncrustify libraries/AP_Declination/examples/AP_Declination_test/AP_Declination_test.pde 2012-08-21 19:01:34 -07:00
Andrew Tridgell 927834106d AP_Declination: save some more memory by putting the declination keys in progmem
there was a comment saying this was too slow, but it actually costs
about 30 usec extra, which is trivial given the full auto declination
call costs 680 usec and its only called once per boot
2012-03-30 14:25:27 +11:00
Andrew Tridgell 70d4280935 AP_Declination: added timing information to declination test 2012-03-30 14:25:27 +11:00
Andrew Tridgell 175352845c AP_Declination: fixed build under SITL 2012-03-30 14:25:27 +11:00
Adam M Rivera ca82350f17 AP_Declination_test: Updated test with better print messages. 2012-03-30 14:25:26 +11:00
Adam M Rivera 01b1e58f7d AP_Declination: Update LUT based on the changes that I made in the LUT generation code. This LUT is the final version that has no truncation. 2012-03-30 14:25:26 +11:00
Adam M Rivera 23f6093f05 AP_Declination: Updated comments to reflect new LUT size. 2012-03-30 14:25:06 +11:00
Adam M Rivera 50791a8b0f AP_Declination: Removed trailing zero deltas as they have no impact on the final value and only take up extra bytes. 2012-03-30 14:21:58 +11:00
Adam M Rivera f35e447927 AP_Declination: Updated compressed lookup value table. Located 9 more failure points due to truncation on the packed LUT. 2012-03-30 14:21:58 +11:00
Adam M Rivera 72b70c394c AP_Declination: Found 7 of the 22 failure points and fixed them. The issue with those 7 was the way I originally packed the value array. The last delta values on some rows were getting truncated. The new number of failures is down to 15 - WIP. 2012-03-30 14:21:58 +11:00
Adam M Rivera 076192db51 AP_Declination: Updated test to run in 5 degree increments. Changed to only print failures and also print total pass vs total fail. 2012-03-30 14:21:58 +11:00
Adam M Rivera 230ca1ddca AP_Declination: Moved check for y index of zero to after the y index is properly transformed. 2012-03-30 14:21:58 +11:00
Adam M Rivera e0fa053c79 AP_Declination: The exception signs unpacking logic was incorrect. I was shifting a 1 value left y%8 which would have needed a the signs to be packed right to left. My packed signs byte was packed left to right (left most being the 0 position) so I needed to reverse the shifting. 2012-03-30 14:21:58 +11:00
Adam M Rivera f66c6e16e4 AP_Declination: In order for the bitwise & operation to work, negative signs need to be represented by 1s instead of 0s. Changed so that negative signs are represented by a 1 in the packed signs array. Updated lookup logic to reflect this change. 2012-03-30 14:21:58 +11:00
Adam M Rivera d88b9e8ffc AP_Declination: Updated packed exception signs array. I had the signs packed incorrectly. 2012-03-30 14:21:57 +11:00
Adam M Rivera 036da88174 AP_Declination: Changed test to run in increments of 10 degrees. 1 was too granular. 2012-03-30 14:21:57 +11:00
Adam M Rivera 580b274bde AP_Declination: Added original array to test sketch. Added loop to validate new compressed array against original in 1 degree steps. 2012-03-30 14:21:57 +11:00
Adam M Rivera efefc3e4f4 AP_Declination: Moved rows with large spikes in delta to their own unsigned exception rows. The signs are in a separate packed array. 2012-03-30 14:21:57 +11:00
Adam M Rivera 0dcc4e8307 AP_Declination: Implemented Delta Encoding and Run-Length Encoding. Added method to traverse the compressed array and return the lookup value based on the same lat_index/lon_index that was used before. 2012-03-30 14:21:57 +11:00
Adam M Rivera 3a849771bc AP_Declination: Changed PROGMEM read function to pgm_read_word_far to support the int16_t datatype. 2012-03-30 14:21:57 +11:00
Adam M Rivera 370e56c00a AP_Declination: Changed datatype to int16_t to support the -90 <-> 90 latitude range. 2012-03-30 14:21:57 +11:00
Adam M Rivera ae257ad42b AP_Declination: Reduced the size of the lookup table to support -75 <-> 70 latitude range. This allows the datatype to remain int8_t. 2012-03-30 14:21:57 +11:00
Andrew Tridgell c08fd50542 AP_Declination: fixed build of test sketch 2012-03-12 17:33:15 +11:00
Andrew Tridgell c1b945018b AP_Declination: fixed usage of headers 2012-03-11 20:59:47 +11:00
Adam M Rivera b9be6ed290 AP_Declination: Updated comment.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2012-03-11 20:59:47 +11:00
Adam M Rivera e08b50ee91 AP_Declination: Increased range of supported latitude coordinates.
Fixed incorrect type usage to save stack space.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2012-03-11 20:59:47 +11:00
Adam M Rivera e22da153ec Added AP_Declination test sketch. I will be improving the test sketch soon.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2012-03-11 20:59:47 +11:00
Adam M Rivera d2a07b1603 Added AP_Declination library. It contains the lookup table (lat/lng -> declination) as well as a method that performs the lookup.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2012-03-11 20:59:47 +11:00