Commit Graph

108 Commits

Author SHA1 Message Date
Iampete1 8618b085be PID: params always use set method 2022-08-03 13:43:48 +01:00
Iampete1 66a5a289d7 PID: use set and defualt 2022-07-20 17:59:59 +10:00
Peter Barker a10ed0e87f PID: stop libraries including AP_Logger.h in .h files
AP_Logger.h is a nexus of includes; while this is being improved over
time, there's no reason for the library headers to include AP_Logger.h
as the logger itself is access by singleton and the structures are in
LogStructure.h

This necessitated moving The PID_Info structure out of AP_Logger's
namespace.  This cleans up a pretty nasty bit - that structure is
definitely not simply used for logging, but also used to pass pid
information around to controllers!

There are a lot of patches in here because AP_Logger.h, acting as a
nexus, was providing transitive header file inclusion in many (some
unlikely!) places.
2022-04-08 19:18:38 +10:00
murata 8f1369f065 PID: Change from division to multiplication 2022-03-16 18:41:52 +11:00
Leonard Hall 157f786adf Global: rename desired to target in PID info 2019-07-25 17:38:15 +09:00
Peter Barker b47733142f GLOBAL: rename DataFlash_Class to AP_Logger 2019-01-18 18:08:20 +11:00
Michael du Breuil ca28a01bbf PID: Remove examples/keywords
This was needed to accomplish the RC_Channels changeover, and the PID
library is on it's way out of the system so removal of examples rather
then maintainance made more sense.
2018-04-11 21:47:07 +01:00
Michael du Breuil f8ac4efb1d PID: Add a full reset method 2017-10-17 14:37:11 -07:00
Pierre Kancir 720edc0fde PID: example fix travis warning
missing function declaration
implicit cast
some style fix
2017-04-13 19:56:16 +01:00
murata 9de6318b77 PID: Unify from print or println to printf. 2017-01-27 18:20:22 +11: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
Lucas De Marchi ae53920e5b build: don't build examples with old build system
We currently check examples are buildable with waf which doesn't need
the libraries to be specified in a make.inc file.  Having the makefiles
there is misleading since people try to build and realize the build is
broken.
2016-10-11 13:03:08 +11:00
Fernandes Pinheiro, Daker 51bf638ad3 PID: Remove unused method get_pid_4500 2016-07-06 08:45:01 +09:00
Grant Morphett 944541b287 PID: Added PID_Info to class for PID logging 2016-05-31 08:44:52 +10:00
Andrew Tridgell abe850c397 PID: fixed example build 2016-05-31 08:36:14 +10:00
Ricardo de Almeida Gonzaga 287eb69502 PID: Fix typos 2016-05-13 19:20:05 -03:00
Ricardo de Almeida Gonzaga 5bd034a5a8 Global: start using cmath instead of math.h 2016-04-05 21:06:19 -07:00
Lucas De Marchi 96c30aea39 PID: replace header guard with pragma once 2016-03-16 18:40:44 +11: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 d387deb2f5 PID: fix example using wrong type
pid.imax() has type int16_t

../../libraries/PID/examples/pid/pid.cpp:36:53: warning: format ‘%f’ expects argument of type ‘double’, but argument 6 has type ‘int’ [-Wformat=]
             pid.kP(), pid.kI(), pid.kD(), pid.imax());
                                                     ^
2016-02-19 11:51:49 -02:00
Randy Mackay adfa03ce69 PID: add parameter descriptions
These actually aren't referred to from anywhere but it makes this class more consistent with other PID classes
2016-02-08 20:42:35 +09:00
Gustavo Jose de Sousa c2e3f05dbf waf: ardupilotwaf: prefix build context methods with ap_
It helps to distinguish between things from waf and things from ardupilotwaf.
2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa 3d22490397 waf: examples: use methods from bld instead of ardupilotwaf 2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa d281067bcc waf: make example binaries be placed in 'examples' dir
This commit makes examples' wscripts use ardupilotwaf.example() instead of
ardupilot.program().
2016-01-15 16:46:41 -02:00
Lucas De Marchi a096703b06 Global: don't link with AP_Progmem
AP_Progmem is not used anymore.
2015-12-27 15:58:12 -02:00
Caio Marcelo de Oliveira Filho 6e7b73610d waf: add waf support 2015-12-03 07:54:30 +11:00
Caio Marcelo de Oliveira Filho e839892524 PID: use millis/micros/panic functions 2015-11-20 12:35:42 +09:00
Andrew Tridgell 8f4ce7f20b build: removed all nocore.inoflag files
these were APM2 specific
2015-11-16 08:05:17 +11:00
Andrew Tridgell 1ffe899a18 PID: fixed example build 2015-11-16 08:04:44 +11:00
Lucas De Marchi 20c6ffc5e3 Replace use of UARTDriver::printf_P() with UARTDriver::printf()
This also starts to show warnings on places that were already using
wrong printf format strings.
2015-10-30 14:35:25 +09: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
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Caio Marcelo de Oliveira Filho e8d9c4dc9b PID: remove unnecessary includes from example 2015-10-21 09:16:10 +11:00
Caio Marcelo de Oliveira Filho ec52df991c build: compile only the HAL files needed by the board
Instead of requiring every program to specify the HAL related modules,
let the build system do it (in practice everything we compiled depended
on HAL anyway). This allow including only the necessary files in the
compilation.
2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho 2e464a53c2 AP_HAL: make code not depend on concrete HAL implementations
The switching between different AP_HAL was happening by giving different
definitions of AP_HAL_BOARD_DRIVER, and the programs would use it to
instantiate.

A program or library code would have to explicitly include (and depend)
on the concrete implementation of the HAL, even when using it only via
interface.

The proposed change move this dependency to be link time. There is a
AP_HAL::get_HAL() function that is used by the client code. Each
implementation of HAL provides its own definition of this function,
returning the appropriate concrete instance.

Since this replaces the job of AP_HAL_BOARD_DRIVER, the definition was
removed.

The static variables for PX4 and VRBRAIN were named differently to avoid
shadowing the extern symbol 'hal'.
2015-10-21 09:16:07 +11:00
Gustavo Jose de Sousa e925820d90 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:38:25 +10:00
Andrew Tridgell fce95178e7 PID: convert example from .pde to .cpp 2015-06-01 17:07:08 +10:00
Andrew Tridgell f449b34fdd PID: fix for HAL_SITL rename 2015-05-05 09:45:56 +10:00
Tom Pittenger f3d13656ba PID: fix compile warnings re float constants 2015-04-24 14:04:24 +09:00
Andrew Tridgell 184420355d PID: fixed example build 2014-08-13 22:12:24 +10:00
Kevin Hester c2184cb8e4 PID: fixup line endings 2014-04-15 15:57:56 +09:00
Andrew Tridgell 37ad9e3f82 PID: fixed example build 2013-09-24 11:57:21 +10:00
Andrew Tridgell 6862791d66 PID: fixed indent-tabs-mode 2013-05-30 09:50:37 +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 6123ea2dac PID: added get_pid_4500()
this is a version of get_pid() that returns an int16_t constrained to
-4500 to 4500. This will prevent overflow errors for large PID gains
in ArduPlane and Rover
2013-04-01 22:17:04 +11:00
Andrew Tridgell fe964fcda0 PID: change to float input/output
this makes the PID library a bit more flexible for smaller range
numbers. Note that this library is used on ArduPlane and Rover, not
Copter
2013-02-09 20:36:26 +11: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 62bfded26c PID: fixed example build 2012-12-20 14:52:36 +11:00
Pat Hickey eb530b86e8 move Arduino.mk to /mk/Arduino.mk 2012-12-20 14:52:35 +11:00