835 Commits

Author SHA1 Message Date
Lorenz Meier
70e597bd9a Update ECL to include fw controller limit improvements and side slip filter improvements 2016-11-27 16:08:53 +01:00
Beat Küng
9230f419e5 DriverFramework: update submodule 2016-11-24 14:43:22 +01:00
Roman
912ed98a28 updated ecl 2016-11-21 07:29:21 +01:00
Roman
9f57ee8564 updated ecl for updated gps reset logic
Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-21 07:29:21 +01:00
Roman
ae7f61b0bf tecs: added method to handle ekf height resets
Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-21 07:29:21 +01:00
Roman
896118281c TECS: remove logic which shifts or limits integrator during large transients
- during large transients in pitch demand the pitch integrator value
was shifted such that the final demanded pitch did not violate given
limits. Since this strategy can cause large knock-backs of the pitch
integrator we remove this logic completely. We already have logic in place
which reduces the integrator at the pitch time constant in case the
pitch limits are exceeded so we don't need to limit it further. This
has the advantage that spikes in the specific energy balance error
signal does not lead to integrator knock-back.

Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-14 22:43:33 +11:00
Paul Riseborough
9221c74e46 tecs: improvements to pitch integration limiting
Constrain the specific energy balance integrator input to prevent increasing saturation of pitch demand.
Decay the specific energy balance integrator state if the pitch demand is saturated to reduce saturation to zero and do so at the same tome constant as the control loop
Relax the clipping threshold on the specific energy balance integrator to allow the input constraint and decay functions to do more of the work
Improve variable naming and commenting
2016-11-14 22:43:33 +11:00
Roman
7106881cbc tecs: fix limiting of pitch integrator input, better comments and structure
- when limiting the pitch integrator input the value was related to
a quantity with different units (specific energy error rate vs delta pitch)
- once the unconstrained pitch demand is larger / smaller than the max/min
allowed pitch angle the integrator input should only be allowed to drag
the integrator into the direction leading to less pitch demand violation

Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-14 22:43:33 +11:00
Roman
12ddf9d25e TECS: better handling of the constraint for the pitch integrator
- if the specific energy balance correction term produced a demanded
pitch value which exceeded the aircraft pitch limits then the pitch
integrator was shifted such that the pitch demand violation was prevented.
However, this meant that the exceeding pitch was just unloaded into the
integrator and caused unexpected behavior of the pitch loop.
In an underspeed condition e.g. this has lead to the plane pulling up it's
nose very quickly shorty after the underspeed condition kicked in.

Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-14 22:43:33 +11:00
Roman
eec55a0918 TECS: run underspeed detection method before calculating speed demand
- the method in TECS for detecting an underspeed condition was run after
the method which calculated the airspeed demand. As a result the specific
engergy balance error signal showed a spike when TECS detected an underspeed
condition.

Signed-off-by: Roman <bapstroman@gmail.com>
2016-11-14 22:43:33 +11:00
Carlo Wood
ebeb187522 Move #pragma once outside #ifdef's.
In this particular case it does no harm,
but since in other cases it can lead to
problems I didn't want to add an exception
for this case to fix_headers.sh, that currently
chokes on this because it doesn't know better
than that it's a bad thing.

Note on how #pragma once works: when encountered
(aka the #ifdef that it is inside has to
be true), the compiler marks the whole
file as "seen" (this is implementation
defined, but most implementations store
the inode of the file). Subsequent #include's
of that file/inode are then completely skipped.
Hence it doesn't matter if the #pragma is at
the beginning, at the end or in the middle,
but it should be encountered every #include,
usually, and thus not be inside an #if... #endif
construct.
2016-11-13 19:36:27 +01:00
Carlo Wood
04aa2bb3a4 Add missing header files.
These headers files were missing from the header files that
I added them to; the fact that they were missing didn't
lead to compile errors because by coincidence the missing
headers are included in the source files before including
these headers. But, after the reordering of header inclusions
by Tools/fix_headers.sh, these cases will give rise to compiler
errors.
2016-11-13 19:36:27 +01:00
Benoit3
83e9e1c382 The goal of this patch is to allow compatibility with GR12/GR16/GR24 graupner receiver by :
- allowing decoding of SUMD frame with failsafe bit set
- updating stack failsafe state with the sumd failsafe info

Refer to #5817 issue
2016-11-12 14:28:57 +01:00
Julian Oes
ab76a37910 DriverFramework: update of cmake_hexagon 2016-11-10 07:56:28 +01:00
Julian Oes
6bdca1053c Next cmake_hexagon in Firmware and DriverFramework 2016-11-10 07:56:28 +01:00
Julian Oes
88e81aa58e cmake_hexagon: rpcmem and linking fix
This updates cmake_hexagon and cmake_hexagon inside DriverFramework
which fixes somethine about rpcmem.a and the double linking issue.
2016-11-10 07:56:28 +01:00
Paul Riseborough
08a380ae2d ecl: update library reference
Enables optimum setting of sensor data buffer lengths using specified data delays and min arrival interval.
2016-11-08 11:17:07 +01:00
Beat Küng
223595e978 ecl: update submodule to master 2016-11-06 14:48:20 +01:00
David Sidrane
d77e107e31 Crazyflie uses the board common interface to provide board name
Removed #ifdef in version.h
2016-11-05 11:06:43 +01:00
Mark Whitehorn
03beeb2e55 update matrix submodule 2016-11-05 11:05:25 +01:00
Carlo Wood
90f3e3b5d3 Do not include headers inside __BEGIN_DECLS ... __END_DECLS blocks.
We don't have C++ unsafe headers (anymore).

I added a test to fix_headers.sh that checks if certain "unsafe"
headers are ONLY included inside a __BEGIN_DECLS ... __END_DECLS
(because after all, they are unsafe), as well as checking that
no other header files are included inside such a block. The rationale
of the latter is that if a file is a C header and it declares
function prototypes (otherwise it doesn't matter) and is sometimes
included outside a __BEGIN_DECLS ... __END_DECLS block (from a C++
source file) then it has to be C++ safe and doesn't ever to be
included from inside such a block; while if a file is a C++ header
then obviously it should never be included from such a block.

fix_headers.sh subsequently found several safe headers to be
included from inside such a block, and those that were (apparently
in the past) unsafe were included only sometimes inside such a
block and often outside it. I had a look at those files and saw
that at least an attempt has been made to make them C++ safe,
but especially because they already are included OFTEN outside
a __BEGIN_DECLS ... __END_DECLS (from C++ source files) the
best decision seems to treat them as safe.

This is not risky: .c files that define such functions still
generate C-linkage for their functions. If a C++ unsafe C header
is included outside a __BEGIN_DECLS ... __END_DECLS block then
the only possible result would be an undefined reference to
a function with C++-linkage that will not exist. Aka, when
something links after this commit, then the commit was correct.
I did build all targets and they all linked.
2016-10-28 11:57:08 +02:00
Carlo Wood
baf89f4398 Clean up of px4_defines.h (remove math.h)
This patch reorders px4_defines.h to make it more readable (I think)
but more importantly, cleans up the #include <math.h>/<cmath>
and [std::]isfinite stuff.

My main goal was to completely get rid of including math.h/cmath,
because that doesn't really belong in a header that is supposed to
define macro's and is included in almost every source file (if not
all).

I'm not sure what it did before ;) (pun intended), but now it does
the following:

PX4_ISFINITE is only used in C++ code (that was already the case,
but hereby is official; for C code just use 'isfinite()') and is
defined to be std::isfinite, except on __PX4_QURT because that uses
the HEXAGON toolset which (erroneously) defines isfinite as macro.

I would have liked to remove PX4_ISFINITE completely from the code
and just use std::isfinite whereever that is needed, but that would
have required changing the libecl submodule, and at the moment I'm
getting tired of changing submodules... so maybe something for the
future.

Also, all includes of <math.h> or <cmath> have been removed except
for __PX4_NUTTX. Like the HEXAGON toolset NuttX currently defines
isfinite as macro for C++. So, we could have solved this in the
same was as __P4_QURT; but since we can fix NuttX ourselves I chose
to add a kludge to px4_defines.h instead that fixes this problem,
until the time that NuttX can be fixed (again postponing changing
a submodule). The kludge still demands including <cmath>, thus.

After removal of the math header file, it needed to be included
in source files that actually need it, of course.

Finally, I had a look at the math macro's (like M_PI, M_PI_F,
M_DEG_TO_RAD etc). These are sometimes (erroneously) defined in
certain math.h header files (like both, hexagon and nuttx).
This is incorrect: neither the C nor the C++ standard defines
math constants (neither as macro nor otherwise). The "problem"
here was that px4_defines.h defined some of the M_*_F float
constants in terms of the M_* double constant, which are
sometimes not defined either thus. So, I cleaned this up by
defining the M_*_F math constants as float literals in px4_defines.h,
except when they are defined in math.h for that platform.
This means that math.h has to be always included when using those
constants, but well; not much difference there as those files
usually also need/use the macro NAN (which *is* a standard macro
defined by math.h).

Finally finally, DEFAULT_PARAM_FILE was removed as it isn't
used anymore.

All in all I think the resulting px4_defines.h is nice, giving me
much less the feeling of a nearly unmaintainable and over time
slowly growing collection of kludges and hacks.
2016-10-28 08:41:30 +02:00
Lorenz Meier
f9abe39c3a DSM parser: Keep local copy of channel data 2016-10-23 19:58:52 +02:00
Beat Küng
7c6d99d30f BlockParam: remove _extern_address and create a new class BlockParamExt for this
In most cases, _extern_address was unused, thus wasting cycles & RAM. This
adds a separate class BlockParamExt with the field and uses it in ekf2_main

Frees roughly 0.5KB of RAM on Pixracer
2016-10-23 15:25:20 +02:00
Paul Riseborough
6a3b147477 ecl: update library reference
Adds reporting of IMU coning and high frequency vibration levels
2016-10-22 12:03:05 +02:00
Lorenz Meier
f7f406c45d Expand RC test to 2nd receiver with 12 channels 2016-10-19 15:31:54 +02:00
Julian Oes
af5d2c488c st24: fix RC lost detection based on error count
The packet_count was actually an error_count, therefore we should
process RC input only when the error_count since the last packet is 0.

Also, this commit fixes the RSSI scaling for st24.
2016-10-19 09:22:57 +02:00
Roman
a978d61d9a attitude message cleanup: more cleanup
Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-18 20:46:08 +02:00
Lorenz Meier
526fb8f515 Remove q_valid flag from attitude topic 2016-10-18 20:46:08 +02:00
tumbili
5e0e522903 adapted to new vehicle attitude message 2016-10-18 20:46:08 +02:00
Julian Oes
b5b077ae04 DriverFramework: update submodule once again 2016-10-18 08:07:14 +02:00
Julian Oes
0a4ca7c77f cmake/DriverFramework: update submodules again 2016-10-18 08:07:14 +02:00
Julian Oes
f8a1631077 DriverFramework/cmake_hexagon: use defines with DF
This changes the following defines:

__QURT -> __DF_QURT
__RPI -> __DF_RPI
__EDISON -> __DF_EDISON
__BEBOP -> __DF_BEBOP
__LINUX -> __DF_LINUX
2016-10-18 08:07:14 +02:00
Lorenz Meier
e4398c7088 Update ECL to include a fix for height reset 2016-10-18 08:00:13 +02:00
Lorenz Meier
c6015e65d0 Update ECL to include a reset fix 2016-10-12 08:55:36 +02:00
Lorenz Meier
b4e85d1273 Update ECL to include a status reporting fix 2016-10-12 08:53:00 +02:00
Paul Riseborough
ad65e56f47 ecl: update submodule reference 2016-10-11 08:52:35 +02:00
Michael Schaeuble
6bb03f3665 Add pitch angle to AK8963 for Bebop 2016-10-05 09:56:54 +02:00
Julian Oes
763d2d0447 ecl: point to interim branch for now 2016-09-30 09:25:26 +02:00
Julian Oes
7f8f6c3879 ecl: updated submodule again 2016-09-30 08:11:51 +02:00
Julian Oes
8ff237c69f Remove size optimization for individual modules
It makes more sense to set the optimization flags on a platform basis
instead of individually for each module. This allows for different
optimization options for SITL, NuttX, Snapdragon, etc.
2016-09-30 08:11:51 +02:00
Lorenz Meier
65e3ae70dd DF update 2016-09-27 11:56:49 +02:00
Lorenz Meier
5b674ffe48 Update DF to include Travis CI fix for DF
DF Update: Use common CMake version so Darwin handling is correct in PX4

Update DF to use proper constants

Update DF
2016-09-27 11:56:49 +02:00
Lorenz Meier
f49eabdb9d Update DF to have 10.11 and 10.12 support in parallel 2016-09-27 11:56:49 +02:00
Lorenz Meier
398d9642cb Update DF for XCode 8 2016-09-27 11:56:49 +02:00
Daniel Agar
fb75240ee9 FW init TECS with PSP_OFF and constrain TAS error 2016-09-27 08:49:45 +02:00
Michael Schaeuble
57fee8b9de Update DF submodule 2016-09-07 08:24:08 +02:00
Tim Dyer
b65ff53b00 Initial build for Crazyflie 2.0
Working crazyflie firmware build

* Console on USART3
* Could not disable building PX4IO firmware, currently commented out

Don't build PX4IO firmware if the board doesn't ask for it

Added crazyflie motor driver

Fixed wrong register

CLK_SEL is in PWR_MGMT_1

Initial I2C/SPI MPU9250 device

* Tested with I2C
* Need to add error checking
* Intermittent crash on stop call

Working ak8963 mag driver

Functional lps25h driver. Work in progress.

Works well enough to probe and allow sensors task to start.

Added serial port test module

HACK! Get sensors module working

Set crazyflie PWM range

Extend baudrate for Crazyflie's NRF radio

Added dummy tone alarm to allow for init

Added autostart script for Crazyflie
2016-09-04 19:12:08 +02:00
Lorenz Meier
f511d49cc2 Improvements to SITL to make paths more flexible. (#5181) (#5255)
* Path cleanup for SITL.

* Restructured sitl scripts dir.

* Set integration tests to use ekf2 for vtol.

* Fix sitl paths for mac.
2016-08-25 21:47:45 +02:00
Julian Oes
62297c3d86 DriverFramework: updated submodule (#5351)
- Fix if _retries variable is not set to prevent "UINT_MAX-1"
  retries.
- Update for the cmake_hexagon submodule.
2016-08-19 22:17:13 +02:00