81 Commits

Author SHA1 Message Date
Daniel Agar
78b3d22471 lib/mixer_module: consume output_limit library 2022-01-10 11:59:55 +01:00
Daniel Agar
089c962d92 px4io: moving mixing to FMU side
Using mixers on the IO side had a remote benefit of being able to
override all control surfaces with a radio remote on a fixed wing.
This ended up not being used that much and since the original design
10 years ago (2011) we have been able to convince ourselves that the
overall system stability is at a level where this marginal benefit,
which is not present on multicopters, is not worth the hazzle.

Co-authored-by: Beat Küng <beat-kueng@gmx.net>
Co-authored-by: Daniel Agar <daniel@agar.ca>
2021-09-25 19:15:05 -04:00
Daniel Agar
cc7807c066 mixer: update to List<> container 2019-11-22 15:00:25 -05:00
Daniel Agar
79dc676c8f mixer: move MixerGroup out of Mixer hierarchy and delete mixer.h header 2019-11-22 15:00:25 -05:00
Beat Küng
3198610f85 src/platforms: move all headers to platforms/common/include/px4_platform_common
and remove the px4_ prefix, except for px4_config.h.

command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done

Transitional headers for submodules are added (px4_{defines,log,time}.h)
2019-10-30 11:48:47 +01:00
Beat Küng
a2ebbe9066 pwm_limit: rename to output_limit
As there is nothing pwm-specific about it.
2019-08-31 10:05:00 -04:00
mcsauder
9d67bbc328 Standardized/updated copyright file headers in the src/systemcmds/tests/ directory. 2019-01-30 14:25:18 -05:00
Daniel Agar
2ffb49b734 delete px4_includes.h header and update boards/ to use syslog 2019-01-23 18:25:18 -05:00
Daniel Agar
572d1cefe8 test_mixer remove <limits> usage
- <limits> isn't available in the NuttX c++ standard library
2019-01-21 09:27:10 -05:00
Julian Oes
5b9dea5604 Replacing usleep with px4_usleep
This is a step towards isolating time from the system.
2018-12-22 10:32:18 +01:00
Beat Küng
cf66656258 mixer multirotor: add unit-tests
To run:
cd src/lib/mixer
make tests

This will validate the C++ implementation by taking the python
implementation as ground-truth. It runs through various actuator control
command values for all airmode variations and several mixer types.

The python script also allows to prototype new mixer algorithms.

It is not integrated into the existing build system, because it's easier
to use that way, with less dependencies, and faster testing workflow.
It could however be a bit more integrated.

Reference: https://github.com/Auterion/Flight_Control_Prototyping_Scripts/tree/master/control_allocation
2018-12-13 09:50:07 +01:00
Beat Küng
c659d2bcc2 mixer: minor refactoring to reduce header include dependencies
- avoid including <px4_defines.h> from the math headers
- avoid driver include <drivers/drv_mixer.h> from the mixer
2018-12-13 09:50:07 +01:00
Daniel Agar
3e0a3559a9 cmake use standard mechanisms for settings flags 2018-11-26 14:40:14 -08:00
Mara Bos
e9fb17c51a Always use FILE* for standard output.
The threads running commands for clients through the Posix daemon used
to write to a char buffer through snprintf (etc.) which was then written
directly to the file descriptor, whereas in the other case printf
(etc.) was used to write to stdout (FILE*). Both versions used some
macro's and repeated code to have the same output.

This change unifies these two cases by using a FILE* in both cases. The
(line) buffering is done by the standard C library's implementation
(just like with stdout), and px4_log.c now uses the same code in all
cases (using fprintf, etc.) for printing (colored) output.
2018-11-23 12:15:41 +01:00
Beat Küng
5363aff879 fixes for integration and unit tests
Move ros logs dir so that .ulg files are not in the same directory
(mission_test.py:: get_last_log() fails otherwise)
2018-08-08 21:09:39 +02:00
Beat Küng
20f2303e8a test_mixer: fix resource leak (unclosed dp) 2018-06-13 16:19:34 +02:00
Daniel Agar
e468a9bbcc move systemlib/pwm_limit to standalone lib 2018-06-12 09:06:30 +02:00
Beat Küng
f2092dd690 mixer_test: use snprintf instead of strncpy to fix compiler warning
compiler warning:
../../src/systemcmds/tests/test_mixer.cpp: In member function ‘bool MixerTest::loadAllTest()’:
../../src/systemcmds/tests/test_mixer.cpp:202:18: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying 1 byte from a string of the same length [-Werror=stringop-truncation]
     (void)strncpy(&buf[strlen(MIXER_ONBOARD_PATH)], "/", 1);
2018-05-09 07:59:46 +02:00
Daniel Agar
d2abd53692 mixer lib remove custom constrain and cleanup includes 2018-04-12 00:14:50 -04:00
Daniel Agar
08cc963de3 px4iofirmware use std NAN instead of undefined 0.0f/0.0f
- closes #9277
2018-04-12 00:14:50 -04:00
Daniel Agar
45eb9cb518 fix typo PX4IO_MAX_MIXER_LENGHT -> PX4IO_MAX_MIXER_LENGTH 2018-04-09 02:23:26 -04:00
Julien Lecoeur
89642a9203 Move src/module/systemlib/mixer to src/lib/mixer 2017-11-15 09:56:10 +01:00
acfloria
3929afd617 Fix format in test_mixer.cpp 2017-10-12 12:03:22 +02:00
acfloria
9d2da611f6 Fix mixer issue with undefined return in callback and non value initialized variables. 2017-10-12 12:03:22 +02:00
Daniel Agar
26f00609ac multirotor_motor_limits only publish for MC 2017-09-19 02:25:30 +01:00
Daniel Agar
a02caff1bc unit_test inline implementation and remove module build 2017-08-23 08:06:55 +02:00
Beat Küng
5a2723ab9c test_mixer.cpp: remove bogus comments 2017-07-21 19:59:45 +02:00
Daniel Agar
0d0cbd8243 clang-tidy ignore cert-flp30-c only in tests 2017-06-02 19:35:18 -04:00
Daniel Agar
5d626bd940 clang-tidy remove redundant init 2017-06-02 19:35:18 -04:00
Daniel Agar
6631e72d6f clang-tidy modernize-redundant-void-arg 2017-02-01 22:15:50 -05:00
Daniel Agar
e927f3e040 clang-tidy modernize-use-nullptr 2017-02-01 22:15:50 -05:00
David Sidrane
93bc8f6467 Combined ifdess and made positive logic
We still allow CONFIG_ARCH_BOARD_SITL in the code base, but
  use positive logic and less #ifdefs
2017-01-21 11:45:36 +01:00
Beat Küng
e7db0ed098 test_mixer & mixer: use memmove instead of memcpy
Both, src & dst use the same array, thus potentially overlapping.
Behavior of memcpy in that case is undefined.
2017-01-18 18:23:42 +01:00
Lorenz Meier
b6e18a1479 Mixer test: More instrumentation to catch repro cases in CI 2017-01-14 20:42:54 +01:00
Lorenz Meier
b9e32d7a34 mixer test: Fix string handling
Some strings were not enforcing NUL termination.
2017-01-14 07:47:03 -08:00
Lorenz Meier
6927fcb5c0 Mixer test: Fix string termination corner case 2017-01-14 07:47:03 -08:00
Andreas Antener
35740b0b59 Mixer test: fix paths for nuttx 2017-01-03 20:32:33 -05:00
Lorenz Meier
3229c4183a Mixer test: Condition strncpy properly 2017-01-03 20:32:33 -05:00
Lorenz Meier
9e95d88574 Use system define for path length buffer 2017-01-03 20:32:33 -05:00
Lorenz Meier
0d5089e3bf Mixer test: Improve portability 2017-01-03 20:32:33 -05:00
Lorenz Meier
5247f17576 Mixer test: use real defines from IO firmware
We use the real defines now and test them against every mixer on the system. This means we should catch transfer errors now before even hitting master.
2017-01-03 20:32:33 -05:00
Lorenz Meier
d0dbddea1b Extend mixer test case with complex mixer 2017-01-03 20:32:33 -05:00
Lorenz Meier
0810bcfe8e Polish mixer test, remove any too verbose output 2017-01-03 20:32:33 -05:00
Lorenz Meier
c27728a7aa Test VTOL test mixers 2017-01-03 20:32:33 -05:00
Lorenz Meier
fb8243d5e1 Mixer test: Fix test, failing right now but showing the real issues 2017-01-03 20:32:33 -05:00
Mark Whitehorn
86252e19e6 clean up other build targets 2016-12-10 12:56:39 +01:00
Bartosz Wawrzacz
619efa7b45 [PX4IO/PWM driver] Added trim values to the PWM output drivers 2016-12-10 12:56:39 +01:00
Lorenz Meier
cf671b5134 Fix tests and re-introduce tests into build
Code style fix
2016-09-27 11:56:49 +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
Lorenz Meier
7b5917567a Fix Mixer test for OS X 2016-08-07 14:05:03 +02:00