Commit Graph

15 Commits

Author SHA1 Message Date
Randy Mackay c1708db208 AC_PID: add const and use is_positive in AC_PI_2D 2018-01-23 12:00:43 +09:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Randy Mackay 425caeabf7 AC_PI_2D: fix parameter description 2016-04-01 11:59:30 +09:00
dgrat 5148e41c1a AP_Math: Cleaned macro definitions
Moved Definitions into a separate header. Replaced PI with M_PI and
removed the M_PI_*_F macros.
2016-02-27 02:51:33 -03:00
Lucas De Marchi 2591261af6 Global: rename min and max macros to uppercase
The problem with using min() and max() is that they conflict with some
C++ headers. Name the macros in uppercase instead. We may go case by
case later converting them to be typesafe.

Changes generated with:

	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)max(/\1MAX(/g'
	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)min(/\1MIN(/g'
2015-12-01 16:28:09 -02:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Gustavo Jose de Sousa 286d084d83 AC_PID: standardize inclusion of libaries headers
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.
2015-08-11 16:28:41 +10:00
Tom Pittenger 9d74f57ed3 AP_PID: replace fabs() with fabsf() 2015-05-09 09:57:26 +10:00
Andrew Tridgell 33555b7f12 AC_PID: revert AP_Math class change 2015-05-05 13:27:05 +10:00
Tom Pittenger 01180d52c4 AP_PID: compiler warnings: apply is_zero(float) 2015-05-05 13:26:51 +10:00
Randy Mackay 67b0c6f5c4 AC_PID: replace is_equal with is_zero 2015-04-28 16:22:08 +09:00
dgrat 303cfd683a AC_PID: replace floating point '==' with is_equal
Also add div-by-zero check to fix calc_filt_alpha

Also get_i and get_shrink_i do not need to set values to zero in Vector2f
constructor because this is already done.
2015-04-28 16:21:46 +09:00
Randy Mackay a095a8c3a1 AC_PID: more protection against NaN and Inf 2015-04-09 20:19:55 +09:00
Randy Mackay cc0d5b9ced AC_PI_2D: replace set_filt_hz method with filt_hz
Thanks to Jonathan Challinger for spotting this bug
2015-03-11 17:28:36 +09:00
Leonard Hall 34a5bc8b33 AC_PI_2D: 2-axis PI controller 2015-03-06 14:01:56 +09:00