183 Commits

Author SHA1 Message Date
Daniel Agar
6f1f5e0325 clang-tidy: partially fix readability-redundant-declaration 2019-10-28 10:50:31 -04:00
Daniel Agar
967446af4c clang-tidy: enable readability-simplify-boolean-expr and fix 2019-10-27 19:19:07 -04:00
Matthias Grob
d60e1e2774 ControlMath: switch to gtest for unit tessting 2019-10-23 17:33:47 +02:00
Julian Oes
8e625285fc platforms: initialize strings
This might fix a warning about argv being a TAINTED_SCALAR further down.
2019-10-17 08:44:53 -04:00
Daniel Agar
3687677095 cmake: show sitl_gazebo build output and improve rebuild 2019-10-01 14:22:30 -04:00
Daniel Agar
86dc4c5a00 cmake generate vscode launch.json 2019-09-21 13:06:49 -04:00
Daniel Agar
fb7521eb5e cmake px4_base -> px4_parse_function_args 2019-09-15 14:36:38 -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
Beat Küng
f32abe8534 src/platforms: move remaining source files to platforms/common 2019-08-30 07:59:44 +02:00
Beat Küng
f8e0441e7b src/platforms/common: move to platforms/common
Script to update include paths:
for i in $(grep -rl 'include <px4_work_queue' src platforms); do sed -i 's/#include <px4_work_queue/#include <px4_platform_common\/px4_work_queue/' $i; done
2019-08-30 07:59:44 +02:00
Beat Küng
5d0e72040c src/platforms/posix: move to platforms/posix/src/px4/common and src/drivers/driver_framework_wrapper 2019-08-30 07:59:44 +02:00
Beat Küng
fa8165a1c3 platforms/posix/src: move to platforms/posix/src/px4/common 2019-08-30 07:59:44 +02:00
Beat Küng
f3fccf53f6 src/drivers/{kinetis,stm32}: move to arch-specific directories 2019-08-30 07:59:44 +02:00
Beat Küng
ab43a83bed platform: restructure (NuttX) architecture-specific code
updated: tone_alarm, px4io_serial, px4_micro_hal
2019-08-30 07:59:44 +02:00
roangel
e50dd7c364 replay: close replay log file after replay is finished, then exit (#11264) 2019-08-28 08:13:50 +02:00
Julian Kent
d70b024ec7
GTest functional tests that include parameters and uORB messaging (#12521)
* Add kdevelop to gitignore

* Add test stubs

* Rename px4_add_gtest to px4_add_unit_gtest

* Add infrastructure to run functional tests

* Add example tests with parameters and uorb messages

* Fix memory issues in destructors in uORB manager and CDev

* Add a more real-world test of the collision prevention
2019-08-09 15:10:09 +02:00
Anthony Lamping
5d986f2030 posix: add argument to change the CWD (#12482) 2019-08-01 12:25:35 -04:00
Julian Oes
35074aaffd posix: remove segfault handler
I could not get a core dump without removing the segfault handler, hence
this change.
2019-06-05 08:16:19 +02:00
Julian Oes
f3620f7018 Remove all leftover PX4_BACKTRACE calls 2019-06-05 08:16:19 +02:00
Beat Küng
6e2b70cbcd posix: restore original SEGV signal handler upon first entry of our handler
The current SEGV handling on posix is not useful: as soon as our handler
is left, it's triggered again, infinitely.
This patch changes to restore the original handler, so the OS can create
a core dump, etc.
2019-05-29 08:30:52 +02: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
e9ca5d5aba PX4 general work queue 2019-05-24 12:58:55 -04:00
Beat Küng
f58079bc5d pxh.cpp: fix invalid reference if words is empty
This can happen for example if 'line' is a space.
2019-05-24 11:06:41 -04:00
Julian Oes
7a768dbab3 lockstep_scheduler: always use the same code
This define was not set anyway, and in my opinion we should
not use different code for tests anyway.
2019-05-20 12:39:02 -04:00
Julian Oes
52099f5792 cmake: include lockstep_scheduler test
This makes sure we add the lockstep_scheduler_test even if the
ENABLE_LOCKSTEP_SCHEDULER is not set to yes. This means the
lockstep_scheduler is not used for SITL but the CMakeLists.txt file
still used and the test added.
2019-05-20 12:39:02 -04:00
Julian Oes
8d8799097d lockstep_scheduler: convert test to gtest 2019-05-20 12:39:02 -04:00
Daniel Agar
162405479b
device drivers lib add linux spi support 2019-05-20 12:18:56 -04:00
Matthias Grob
cbd230e34e Testing: Clean up unit_test target because test_results does all tests now 2019-05-09 09:42:46 +02:00
Matthias Grob
542f61f04b testing build: add possibility to filter tests with ctest regex 2019-05-09 09:42:46 +02:00
Matthias Grob
5a90382cb8 sitl_tests: add prefix "sitl-" for regex test filtering 2019-05-09 09:42:46 +02:00
Matthias Grob
5020dfdc3d Testing: switch unit tests to BUILD_TESTING 2019-05-09 09:42:46 +02:00
Beat Küng
2448a84c36 SITL: add if750a model 2019-05-03 13:32:48 +02:00
Daniel Agar
b9516d7e38 mixer move test_mixer_multirotor into cmake 2019-04-07 16:12:17 -04:00
Nico van Duijn
b7784a1439 Add MAVLink stream and cmake sitl target 2019-04-02 08:17:13 +02:00
Daniel Agar
b35d048566 cmake enable -Wcast-align and disable per module 2019-03-16 11:47:15 -04:00
Julian Oes
b54ca67de9 lockstep_scheduler: check if mutex is still valid
It turns out that we can fix the unit tests of the lockstep_scheduler
just by checking if `passed_lock` is not `nullptr`.

Without this check, the unit tests segfaulted.
2019-03-15 13:38:11 +01:00
Daniel Agar
edad4c40c3 containers add IntrusiveQueue and testing 2019-03-14 09:22:19 +01:00
Beat Küng
505b1aca2c lockstep_scheduler: work around a potential dead-lock for canceled threads 2019-03-08 12:22:45 -05:00
Beat Küng
e999075ac7 lockstep_scheduler: fix system_sleep -> system_usleep
The effect was that threads that tried to exit were unnecessarily kept
running.
This did not cause problems except for increased resource usage.
2019-03-08 12:22:45 -05:00
Beat Küng
08298ab3d0 drv_hrt: make lockstep_scheduler a pointer
This solves a potential dead-lock when trying to shutdown: a call to exit()
stops all threads and calls all destructors for static objects.
The destructor of LockstepScheduler takes a lock. However this is not
safe, as the lock could already be taken (by any thread).
2019-03-08 12:22:45 -05: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
7a1c8ea8cb Update platforms/posix/src/lockstep_scheduler/CMakeLists.txt
Co-Authored-By: MaEtUgR <maetugr@gmail.com>
2019-02-04 21:31:06 +01:00
Matthias Grob
ffb8bb6066 lockstep_scheduler: correct cmake target includes 2019-02-04 21:31:06 +01:00
Matthias Grob
bda60ecfd6 posix main: hotfix for px4 application not exiting anymore
Some threads do not exit and are still running when
trying to exit SITL running under Windows in Cygwin.

This problem was introduced with:
- posix shell #10173 because of strating a child process
for the startup script and mixing up the signal handling
(only Ctrl+C broken)
- lockstep #10648 because of simulator threads not
stopping gracefully anymore with timing race conditions
(no graceful exit possible anymore)

I leave the SIGINT handler on its default implementation for
Cygwin which kills the process and all its threads when pressing
Ctrl+C.

This hotfix at least allows the usage of Ctrl+C again instead
of forcing the user to use the task manager to shut down
px4.exe going crazy on CPU load instead of exiting
everytime.
2019-01-28 09:38:49 +01:00
Beat Küng
74a3c378b2 drv_hrt: inline hrt_elapsed_time
GCC did not do that.
2019-01-25 07:53:37 +01: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
3a7deefe6e IO firmware: Run critical timing operations as atomic
This is required as we might be in interrupt context on this bare-metal target.
2019-01-22 23:52:57 +01:00
Lorenz Meier
c6718a5bca Posix: Add initial stub for atomic HRT
The actual implementation is not atomic, as the value on the application layer would be limited.
2019-01-22 23:52:57 +01:00
Daniel Agar
320d2e9383
create PX4 platform layer initialization helper (#11269)
- starts requirements for PX4 modules (hrt, param, etc)
2019-01-22 14:13:20 -05:00