Commit Graph

358 Commits

Author SHA1 Message Date
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
Beat Küng 43fdcd7876 px4_middleware: remove that header and move px4::init to px4_init.h
delete include:
for i in $(grep -rl 'px4_middleware.h' src platforms); do sed -i '/#include <px4_middleware.h/d' $i; done
2019-08-30 07:59:44 +02:00
Julian Oes a7c541d7e2 version: more tests to check tags with - prefix 2019-08-23 13:18:52 +02:00
Daniel Agar 8f5b7de498 uORB::Subscription minor API cleanup
* the forceInit() method was combined with the existing subscribe()
 * delete unused last_update()
2019-08-06 10:28:49 -04:00
Beat Küng 72ddf3e0aa tune_control: use orb queue advertisement consistently 2019-07-25 10:38:57 -04:00
Daniel Agar a4a130fe53 tests free test containers in IntrusiveQueue and List 2019-06-13 10:47:27 -04:00
Daniel Agar aee8f13289 List fix remove() and update testing 2019-06-13 10:47:27 -04:00
Daniel Agar 1623de8bd0 IntrusiveQueue add remove method, iterators, and update test 2019-06-13 10:47:27 -04:00
Daniel Agar 2c63e335e9 uORB::Subscription subscribe directly to uORB device node object 2019-06-03 17:06:21 -04:00
Julian Oes 7b9562e3b1 hysteresis: move out of systemlib, move to gtest
This moves the hysteresis test out of the systemlib and makes it its own
small library. Since it still depends on hrt_absolute_time this does not
link yet. My attempt to get all link dependencies together failed.
2019-05-27 09:57:50 +02:00
Daniel Agar 162405479b device drivers lib add linux spi support 2019-05-20 12:18:56 -04:00
Daniel Agar edad4c40c3 containers add IntrusiveQueue and testing 2019-03-14 09:22:19 +01:00
Daniel Agar e2bf4b1894 List container improvements and testing
- support range based for loops
 - add remove() method to remove a node
 - add clear() to empty entire list and delete nodes
 - add empty() helper
2019-03-01 21:01:04 -05:00
Daniel Agar e4b3c8bcc6 tests enable bezier and search_min 2019-02-22 16:23:57 -05:00
Daniel Agar 184aa2861a PX4_ISFINITE use builtin everywhere 2019-02-21 14:56:08 -05:00
mcsauder 31f23c1e76 Rename tune_control_s strength to volume to match Nuttx and Linux standard nomenclature for audio (loudness) control. 2019-02-19 10:07:53 +01:00
mcsauder 2fa70fca80 Added audio tune signals for unit tests passing and failing. 2019-02-10 17:47:16 -05:00
mcsauder 0032df3e87 Update the test_tone() unit test to use orb_advertise() and orb_publish() instead of IOCTL() and alphabetize tests_main.h. 2019-02-10 17:47:16 -05:00
mcsauder 6dc840ac6a Break test_tone and test_ppm out of the test_hrt.cpp file into their own respective files. 2019-02-10 17:47:16 -05:00
David Sidrane c6edf41a74 test time: Fixed bad assumption about RAND_MAX (#11414)
usleep range was up to 2147 Seconds

   Per open group: The rand() function shall compute a
   sequence of pseudo-random integers in the range
   [0, {RAND_MAX}]  with a period of at least 2^32

   {RAND_MAX} Maximum value returned by rand();
   at least 32767.

   /* Maximum value returned by rand().  Must be a minimum of 32767. */

   #define RAND_MAX INT_MAX

  and

  #define INT_MAX     2147483647
2019-02-08 14:39:18 -05:00
mcsauder 9d67bbc328 Standardized/updated copyright file headers in the src/systemcmds/tests/ directory. 2019-01-30 14:25:18 -05:00
mcsauder dc5f18bdcd ToneAlarm class refactoring to implement an interface for hardware specific methods and a single ToneAlarm class. 2019-01-28 18:58:04 -08:00
Daniel Agar 2ffb49b734 delete px4_includes.h header and update boards/ to use syslog 2019-01-23 18:25:18 -05:00
Lorenz Meier f21bc89a90 Unit tests: Retain atomic operation
This ensures we get absolutely accurate timing.
2019-01-22 23:52:57 +01: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
Daniel Agar 60f2a92e3d replace <cfloat> with <float.h>
- <cfloat> isn't available in the NuttX c++ library
2019-01-06 19:20:57 -05:00
Julian Oes d70b0f1c8c Replace sleep with px4_sleep
This is another step to isolate time from the system.
2018-12-22 10:32:18 +01: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 d4e06e517a delete drv_gpio.h, modules/gpio_led, and fmu GPIO ioctls 2018-12-03 16:30:39 +01:00
Daniel Agar 93802c2710 hysteresis test increase time on cygwin (#10958) 2018-12-03 09:39:43 -05:00
Daniel Agar fecdfe5fbc move posix/tests/hrt_test to systemcmds/tests/hrt_test 2018-11-26 14:40:14 -08:00
Daniel Agar 3e0a3559a9 cmake use standard mechanisms for settings flags 2018-11-26 14:40:14 -08:00
Daniel Agar ec4c9da253 remove BOARD_NAME from board_config.h and set automatically 2018-11-26 14:40:14 -08:00
Daniel Agar f692ad04d0 boards organization 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
Roman Bapst 90bfdb6f0a VTOL rate control architecture improvements (#10819)
* attitude and rate setpoint message: use 3D array for thrust demand
* FixedWingAttitudeControl: rework airspeed scaling
  * move airspeed and scaling calculation into separate method
  * if vtol in hover and airspeed disabled use minimum airspeed instead of trim airspeed
2018-11-21 20:32:40 -05:00
Daniel Agar 571364c617 delete baro_report (alias for sensor_baro_s) 2018-11-06 07:43:43 +08:00
Daniel Agar acc24da0c2 delete gyro_report (alias for sensor_gyro_s) 2018-11-06 07:43:43 +08:00
Daniel Agar 42f9aa6e43 delete drv_gyro.h GYROx_DEVICE_PATH 2018-11-06 07:43:43 +08:00
Daniel Agar f21f1a1357 delete drv_accel.h ACCELx_DEVICE_PATH 2018-11-06 07:43:43 +08:00
Daniel Agar 2a83a40491 delete accel_report (alias for sensor_accel_s) 2018-11-06 07:43:43 +08:00
Mara Bos 10c20b38ad Fix many format strings.
Fixes these invalid format strings:
- A `%d` for a pointer (replaced it by `%p`)
- A 0x%08x (and a 0x%0x8!) for a pointer (replaced by %p)
- 2 cases of `%d` for a `ssize_t` (replaced it by `%zi`)
- 1 case of a %u for an `int` (replaced by %i)
- 3 cases of %d for a `long` (replaced by %ld)
- 19 cases of `%d`, `%i`, `%u` or `%lu` for a `size_t` (replaced it by `%zu`)
- An unused formatting argument (removed it)
- A missing `%d` (added it)
- A missing `%s` (added it)
- 2 cases of `%llu` for a `uint64_t` (replaced it by `"%" PRIu64`)
- 6 cases of giving a string directly as format string (replaced it by `("%s", string)`)
- 2 cases of %*-s, which should probably have been %-*s.
  (Looks like NuttX accepts (the invalid) %*-s, but other platforms don't.)
- A %04x for a `uint32_t` (replaced by "%04" PRIx32)
2018-10-27 12:44:51 +02:00
MaEtUgR 4f0e090e88 drv_rc_input: replace useless rc_input_values define 2018-09-21 16:26:27 +02:00
David Sidrane 3022fdb240 test_file2:test fails due to missing slash 2018-09-13 12:15:03 -07:00
Daniel Agar 40a68624e5 tests command ignore -Wunused-variable (#10442) 2018-09-10 11:24:57 -04:00
Daniel Agar 060463e8a7 parameters lib convert to c++ (#10267) 2018-09-04 09:18:28 -04:00
Daniel Agar ab8bf09996 tests cmd remove unused stack module option 2018-09-02 15:31:54 -04:00
PX4 Build Bot cbd1636d8d Update submodule matrix to latest Fri Aug 31 21:31:02 UTC 2018
- matrix in PX4/Firmware (468f28463eabc30843e606546d642adc1a62fe10): https://github.com/PX4/Matrix/commit/b815fc97c4e686a93a8074f27d1830a031b0d38d
    - matrix current upstream: https://github.com/PX4/Matrix/commit/dc3af8097798881b9b2e72a029a3c6c10abd059b
    - Changes: https://github.com/PX4/Matrix/compare/b815fc97c4e686a93a8074f27d1830a031b0d38d...dc3af8097798881b9b2e72a029a3c6c10abd059b

dc3af80 2018-08-27 Daniel Agar - constructors use array size rather than pointers
f1bee77 2018-08-27 Daniel Agar - use default constructors and skip unnecessary initialization
1bcf48b 2018-08-30 Daniel Agar - Quaternion from_dcm don't pass by value
2018-08-31 18:48:58 -04:00