Commit Graph

345 Commits

Author SHA1 Message Date
Daniel Agar 0e9a4cc65f boards: px4/sitl sync all build variants and fix none default package 2020-09-15 21:13:04 -04:00
Beat Küng 809d05053b posix: add support for ROMFSROOT
- add missing ROMFS files to CMakeLists.txt
- rename genromfs to etc, so that it's clearer for SITL use
2020-09-15 09:30:16 +02:00
Daniel Agar 023f6d3983
NuttX cpuload monitoring optimization
- Nuttx only process all suspend & resume scheduling notes when top is running, otherwise only track IDLE
 - convert cpuload and print load to c++
 - delete unused fields from print_load struct
 - update hrt_store_absolute_time (previous unused)
2020-09-05 14:35:50 -04:00
oneWayOut 71f381ada9 add gazebo VTOL tiltrotor debug target for VSCode SITL 2020-09-02 11:41:01 -04:00
Daniel Leonard Robinson fa4818e467
vehicles: add new vehicle type: Airship (#14862)
Co-authored-by: Anton Erasmus <anton@flycloudline.com>
Co-authored-by: Beat Küng <beat-kueng@gmx.net>
2020-08-10 08:52:51 +02:00
Daniel Agar b6a17a6538
new IntrusiveSortedList container used for uORB, WorkQueues, and WorkItems
- new intrusive linked list container (c++ template) that sorts on insertion
 - primarily for convenience inspecting things in the system like uORB or WorkQueues
 - uorb status or top sorted alphabetically 
 - work_queue status threads sorted by priority, then items sorted alphabetically within each
2020-08-04 11:09:41 -04:00
Daniel Agar 6bdcca6a85 systemcmds/tests: add simple atomic microbenchmark 2020-07-10 10:59:50 -04:00
JaeyoungLim 692cb717b7
Add windy world target (#14737) 2020-07-02 15:49:09 +02:00
Beat Küng 5378d1468f lockstep_scheduler: add generic lockstep component API
allows components to register and ensure the lockstep cycle waits for
all components to be updated.
2020-06-23 11:53:55 -04:00
Beat Küng 55d06241b3 fix unit tests: do not stub pthread_cond_wait
and fix the tests instead.
Some unit tests depend on pthread_cond_wait to work as expected.
2020-06-23 11:53:55 -04:00
Beat Küng 283453b3a5 px4-alias.sh_in: allow for spaces in 'set' alias
Required for expressions like:
set LOGGER_ARGS "${LOGGER_ARGS} -f"
2020-06-23 11:53:55 -04:00
Daniel Agar 32887193d6
systemcmds/tests: remove autodeclination test (moving to PX4/ecl) 2020-06-23 10:34:25 -04:00
Daniel Agar 6b343c1f5e
cmake: sitl_gazebo build limit to 2 cores (-j2) 2020-06-18 20:10:25 -04:00
TSC21 6add0fff7f add iris_dual_gps config and the possibility of testing GPS blending through simulation 2020-06-16 09:57:05 +01:00
Daniel Agar 746a8f5cf9 commander: reboot/shutdown usability fixes
- always check with state machine before reboot/shutdown
 - respect BOARD_HAS_POWER_CONTROL (shutdown from command, low battery, power button)
 - px4_shutdown_request add optional delay and always execute from HPWORK
 - px4_shutdown_request split out px4_reboot_request
2020-05-06 13:53:54 -04:00
kritz 33dc0fd146
Add vision velocity integration test (#14818) 2020-05-05 11:14:30 +02:00
JaeyoungLim cae28cd59a
Add aion robotics r1 rover sitl target (#14652)
This adds a sitl target and aiframe configs for the r1_rover, which is a differential rover example for SITL rover. The model is based on the aion robotics r1 rover
2020-05-05 11:07:02 +02:00
Jakub Kákona dfa5ca1710
FlightGear simulator support (#14539)
- Add flightgear_bridge submodule.
- Add traget px4_sitl_nolockstep with disabled  LOCKSTEP simulation.
- Add flightgear viewer targets and startup scripts
- Add a few possible vehicles plane (rascal), autogyro (tf-g1), and rover (tf-r1))

Co-authored-by: Vit Hanousek <vithanousek@seznam.cz>
2020-04-29 08:46:59 +02:00
JaeyoungLim 75054f11df
Add px4vision sitl target
- Use px4vision parameters
2020-04-20 18:08:41 -04:00
JaeyoungLim 6e18cb85b1 Add plane lidar model
Add model that can test terrain estimated landing
2020-04-19 17:09:42 -04:00
mcsauder 6548fde024 Whitespace cleanup to quiet new blank line at EOF git hook. 2020-04-15 23:00:39 -04:00
Julian Oes 474c3c45f0 platforms: don't catch floating point errors
When this triggered it actually just kept printing
"floating point exception" and never recovered. By removing this we can
at least catch it with a core dump, in CI as well as locally.
2020-04-10 14:55:18 +02:00
JaeyoungLim a938410c15 Add world targets and update submodules
Add world names as make targets and include the worlds by updating the submodules
2020-03-29 13:29:07 +01:00
Daniel Agar efceccd91d posix: micro_hal.h add empty px4_arch_gpiosetevent to build new Invensense drivers on linux 2020-03-25 01:05:38 -04:00
JaeyoungLim e2d2ae29a9 Add sonoma raceway world 2020-03-24 19:32:12 +00:00
JaeyoungLim 2ef37cd065 Spawn models separately from gazebo models
Detach model spawning process from the world description file, so that the same model can be used with different worlds
2020-03-23 10:55:13 +01:00
SalimTerryLi b70289c536 move __PX4_LINUX out of px4_impl_os.cmake 2020-03-17 13:20:32 -04:00
Lorenz Meier 8a6d444467 Enable Gazebo mock optical flow 2020-03-14 17:50:40 +01:00
Lorenz Meier 76b3c18625 Add dedicated survey camera plane model
This is to allow us to test triggering properly in SITL
2020-03-14 17:50:40 +01:00
Daniel Agar 9585055e9e
uORB: add bitset for faster orb_exists check and remove uORB::Subscription lazy subscribe hack/optimization
- add PX4 bitset and atomic_bitset with testing
 - add uORB::Subscription constructor to take ORB_ID enum
 - move orb test messages into msg/
2020-03-11 09:06:33 -04:00
Beat Küng af15c7d945 i2c+spi: extend hw_description for I2C + SPI 2020-03-10 10:11:43 -04:00
JaeyoungLim e0d6f94318 Add boat(usv) sitl target 2020-02-21 00:30:15 -08:00
Daniel Agar 8cdbc4c593 px4iofirmware: add PX4IO_PERF define to completely disable perf counters 2020-02-10 09:40:39 +01:00
Daniel Duecker 36f836be79
add support for unmanned underwater vehicles (#14079)
* add support for unmanned underwater vehicles:
* airframe uuv_generic + uuv_hippocammpus including mav_type = 12 for submarines
* mixer for UUVs with X-shaped thruster setup similar to quadcopter
* add module  uuv_att_control for underwater robot attitude control
* add rc.uuv_defaults/apps for autostarting e.g. ekf2 and uuv_att_control app
2020-02-04 23:24:37 -05:00
JaeyoungLim 6dc3cbbd95
SITL add catapult plane target for new gazebo model (plane_catapult) 2020-02-02 11:59:17 -05:00
kritz 92e75452f5
Flow mockup (#14054)
* Add optical flow mockup model

* Update Tools.sitl_gazebo
2020-01-29 14:06:46 +01:00
Julian Oes 30188d2884 Revert "Simulation: Set scheduling policy RR for lockstep"
This reverts commit 742b1839d5.
2020-01-24 12:04:47 +01:00
Daniel Agar de4f594937 DriverFramework purge
The bulk of this change was tightly coupled and needed to be deleted in one pass. Some of the smaller changes were things that broke as a result of the initial purge and subsequently fixed by further eradicating unnecessary platform differences. Finally, I deleted any dead code I came across in the related files I touched while going through everything.

 - DriverFramework (src/lib/DriverFramework submodule) completely removed
 - added dspal submodule in qurt platform (was brought in via DriverFramework)
 - all df wrapper drivers removed
 - all boards using df wrapper drivers updated to use in tree equivalents
 - unused empty arch/board.h on posix and qurt removed
 - unused IOCTLs removed (pub block, priv, etc)
 - Integrator delete methods only used from df wrapper drivers
 - commander: sensor calibration use "NuttX version" everywhere for now
 - sensors: update to px4_{open, read, close} instead of DevMgr wrapper (adc open for analog differential pressure)
 - battery_status: update to px4_{open, read, close} instead of DevMgr wrapper (adc open for analog differential pressure)
 - cdev cleanup conflicting typedefs and names with actual OS (pollevent_t, etc)
 - load_mon and top remove from linux boards (unused)
 - delete unused PX4_MAIN_FUNCTION
 - delete unused getreg32 macro
 - delete unused SIOCDEVPRIVATE define
 - named each platform tasks consistently
 - posix list_devices and list_topics removed (list_files now shows all virtual files)
2020-01-13 14:07:03 -05:00
Daniel Agar 756b0148d6
platforms: split posix hrt for qurt
- this keeps the per platform libraries contained to their respective directories and minimizes the ifdef mess
2020-01-12 22:09:34 -05:00
Daniel Agar d19f18d40b linux boards (ocpoc, bbblue, navio2) replace custom adc drivers with simple px4_arch implementation 2020-01-07 14:04:13 -05:00
Julian Oes fc9df31653 platforms: link libatomic only on emlid navio2 (raspberry pi)
Linking to libatomic is only required for targets such as Raspberry Pi but not on for normal x86/x86_64 Linux builds.
2020-01-06 20:15:39 -05:00
Daniel Agar e29acea509 posix hrt add latency buckets 2020-01-06 16:26:56 +01:00
Daniel Agar 738b57c945 pxh: initialize all fields
- fixes Coverity CID 309151
2020-01-05 22:59:49 -05:00
Daniel Agar 44f9de5e37
delete parrot bebop board support
This target was never fully supported and is heavily dependent on a number of DriverFramework drivers that have no in tree equivalents (bebop bus, flow, rangefinder, etc). Deleting this will make it easier to fully drop DriverFramework shortly.
2020-01-05 19:46:51 -05:00
Daniel Agar aaf5670e7d
deprecate df_bmp280_wrapper and replace with in tree bmp280
- deprecate DriverFramework bmp280 driver (df_bmp280_wrapper)
 - update beaglebone blue and snapdragon flight eagle boards to use in tree bmp280
 - update posix (really just linux) and qurt I2C wrappers
 - tested on beaglebone blue
2020-01-05 13:33:12 -05:00
Daniel Agar b292b04ac1 platforms posix link atomic 2020-01-04 22:03:43 -05:00
Daniel Agar 1edfee4fdd mavsdk_tests: build should be independant of px4 2020-01-01 22:05:29 -05:00
Daniel Agar 9df06ffdea posix main wait_to_exit() fix and catch SIGTERM
- wait_to_exist() shouldn't depend on lockstep (px4_usleep)
2020-01-01 21:55:42 +01:00
Daniel Agar cc7a0cd69d beaglebone blue: build librobotcontrol with cmake 2019-12-29 17:32:06 -05:00
Daniel Agar 30a73416dc mavsdk SITL testing code coverage and upload to codecov.io 2019-12-26 14:31:33 -05:00
Lorenz Meier 742b1839d5 Simulation: Set scheduling policy RR for lockstep
This should ensure that all processes do still run at full load.
2019-12-26 10:16:58 +01:00
Julian Oes 16da8466e3 posix: exit if the startup script is not ok
In general, if anything goes wrong in the startup script, we
should fail entirely because things might not work as expected.

In particular, this prevents that we have to press Ctrl+C twice if the
simulator start call is hung waiting for the simulator to appear and
start communicating. We now press Ctrl+C once and exit straightaway
whereas before we would press it once to get the warning:
"Startup script returned with return value: 2",
and then finally exit on the second press.
2019-12-26 10:16:58 +01:00
Chris Lovett 01818b505f posix server: switch from fcntl(..., F_SETLK, ...) to flock(...) (#13718)
- Required for Windows
- Add better diagnostic output in some places.
- close the lock file descriptor where we don't need to keep it open
2019-12-18 09:53:07 +01:00
Daniel Agar 3d56f37606 vscode debug and ekf2 replay improvements
- create new px4_sitl_replay config specifically for replay
 - ekf2 replay don't launch gazebo
 - add px4_sitl_test cmake variant
 - px4_sitl_test bring into sync with px4_sitl_default
 - vscode replace hard coded build path with cmake setting
2019-12-17 10:19:56 -08:00
kamilritz 2a707cf669 Debug log replays with gdb in vscode 2019-12-15 10:28:04 -05:00
Matthias Grob 904ab16558 Fix trailing whitespace, EOF newline, indentation 2019-12-09 13:22:19 +01:00
Daniel Agar a859a6b57c
VSCode SITL debug improvements
- added gazebo VTOL tailsitter debug target
 - improved jmavsim debug target and helper tasks to work properly (build and launch directly instead of through the jmavsim_run.sh script)
 - improved output console handling for helper tasks (eg gazebo and jmavsim build and run, followed by cleanup after debug)
 - added miniterm.py as a task
2019-12-01 15:47:29 -05:00
Beat Küng 4b290c4903 voltage & current scaling: use px4_arch_adc_dn_fullcount() instead of 4096
Fixes the scaling on h7 boards (the ADC has 16 bits resolution).
2019-11-21 08:19:59 +01:00
TSC21 d4ddabdf52 SITL: adds 'iris_rtps' target 2019-11-13 18:24:11 +00:00
Daniel Agar 1c4e854f93 cmake don't build param "c" files and remove param defines
- these aren't actual source code
2019-11-11 10:25:42 -05:00
Daniel Agar 7f930f875e Jenkins store SITL unit test results 2019-11-04 14:04:40 -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
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
Beat Küng 4bc59092f4 lockstep_scheduler cmake: spaces -> tabs 2019-01-14 11:08:48 +01:00
Beat Küng 2a47715385 refactor lockstep_scheduler: fix class member naming convention 2019-01-14 11:08:48 +01:00
Beat Küng 828e31d3a9 lockstep_scheduler: optimize performance
- use a linked-list instead of std::vector. Insertion and removal are now
  O(1)
- avoid malloc and use a thread_local instance of TimedWait.
  It gets destroyed when the thread exits, so we have to add protection
  in case a thread exits too quickly. This in turn requires a fix to the
  unit-tests.
2019-01-14 11:08:48 +01:00
Beat Küng ecbe2a3e0b drv_hrt posix: improve performance for hrt_absolute_time()
Previously hrt_absolute_time() was at around 5% of the total CPU usage, now
it's around 0.35%.
2019-01-14 11:08:48 +01:00
Beat Küng ccefc640ac drv_hrt posix: remove unused code and remove locking from hrt_absolute_time 2019-01-14 11:08:48 +01:00
Beat Küng 5f0e6d70c5 lockstep_scheduler: use a static lock in usleep_until
less function calls
2019-01-14 11:08:48 +01:00
Beat Küng e8cbc49f7a lockstep_scheduler: remove timed_waits_iterator_invalidated_
Not required, since the lock is held during the whole loop iteration.
2019-01-14 11:08:48 +01:00
Beat Küng 8cdb65eed9 lockstep_scheduler: simplify LockstepScheduler::cond_timedwait & reduce locking
- the loop is not needed
- we optimize for the fast case and lock only if really needed
2019-01-14 11:08:48 +01:00
Beat Küng 318499f56e lockstep_scheduler: inline get_absolute_time()
This is a small method that is used a lot.
2019-01-14 11:08:48 +01:00
karliss 6a33b797ac drv_hrt restore dsp_offset and remove unused qurt code (#11139)
- Fixes #11134
2019-01-03 14:58:53 -05:00
Julian Oes 032e64aaf2 px4_sem: set errno, return -1 on any error
- Don't duplicate the ret variable to err.
- Return -1 on any error, 0 otherwise.
- Set errno to return value of pthread_cond_timedwait.
2019-01-01 20:35:42 +01:00
Julian Oes 23653f9f39 lockstep_scheduler: fix return value, remove errno
The API of cond_timedwait was wrong. It used return -1 and set errno
instead of returning the error as specified for pthread_cond_timedwait
which it tries to mock.
2019-01-01 20:35:42 +01:00
Lorenz Meier 0d0a556847 Fix usage of errno in POSIX semaphore error handling
Previous commit 98ae0186e9 changed the err variable to errno, which is not the return value we are looking for.
2019-01-01 20:35:42 +01:00
Julian Oes 8486b2b917 tests: properly disable shutdown test for Cygwin 2018-12-22 10:32:18 +01:00
Julian 0601214806 tests: disable shutdown and hysteresis for Cygwin
It seems that the hysteresis test fails every now and then, presumably
due to timing issues. The tests needs some improvements, e.g. isolating
it from the system time.
2018-12-22 10:32:18 +01:00
Julian Oes ffb73f6496 platforms: fix redefinition for QURT 2018-12-22 10:32:18 +01:00
Julian Oes 14e5ebbbbc platforms: fix clock build for macOS (yet again) 2018-12-22 10:32:18 +01:00
Julian Oes 06c5037025 platforms: use CLOCK_MONOTONIC
For the non-lockstep case we want to use CLOCK_MONOTONIC if possible.
2018-12-22 10:32:18 +01:00
Julian Oes 547dd8511b platforms: use define for lockstep scheduler
Instead of using the define __PX4_POSIX_SITL it makes more sense to have
a define just to determine if the lockstep scheduler should be used.
2018-12-22 10:32:18 +01:00
Julian Oes 5280a4aba1 platforms: prevent wrap-arounds in px4_sleep
@bkueng found that the old implementation was likely to wrap-around
given seconds is only a uint32_t. We now cast it directly to uint64_t
and therefore should fix this problem.
2018-12-22 10:32:18 +01:00
Julian Oes 4efe4b0d15 platforms: reorg after rebase on new board config
The new board config changed everything, so I needed to move the
lockstep_scheduler repo.
2018-12-22 10:32:18 +01:00
Julian Oes 6d273f3bd8 px4_layer: modernize warnings 2018-12-22 10:32:18 +01:00
Julian Oes c24f6ef943 platforms: lockstep_scheduler ain't no submodule 2018-12-22 10:32:18 +01:00
Julian Oes 357870377a platforms: try to get submodule checked out 2018-12-22 10:32:18 +01:00
Julian Oes e41518a08b platforms: clean up various build/linking issues
This makes sure lockstep is only built for SITL builds and fixes the
existing builds.
2018-12-22 10:32:18 +01:00
Julian Oes 843033d530 platforms: remove unused function 2018-12-22 10:32:18 +01:00
Julian Oes 98ae0186e9 px4_sem: use px4_sem on all POSIX system
This uses the "fake" px4_sem based on mutex and condition_variable on
all POSIX system, not just macOS and Cygwin. This means that we can
change px4_sem_timedwait under the hood and inject the simulated time.
2018-12-22 10:32:18 +01:00
Julian Oes 3e6e1f5c2b POSIX: use lockstep_scheduler to fake time
This integrates the lockstep_scheduler, so that the system time is set
by the mavlink HIL_SENSOR message.

This means that the speed factor is removed and the speed is entirely
given by the simulator.
2018-12-22 10:32:18 +01:00
Julian Oes f0ce300744 platforms: move latency_buckets to perf.c 2018-12-22 10:32:18 +01:00
Julian Oes fa8ac612ab POSIX: use C++ for drv_hrt (file was renamed) 2018-12-22 10:32:18 +01:00
Julian Oes 5df333fa96 POSIX: include lockstep_scheduler in build 2018-12-22 10:32:18 +01:00
Julian Oes fa31d95fd8 Renamed drv_hrt.c to drv_hrt.cpp 2018-12-22 10:32:18 +01:00
Julian Oes db6de38b19 Work in progress to support a speed factor in SITL
These contains some rough changes trying to get SITL to speed up by a
SPEED_FACTOR.

This platform time code probably requires some more thought and refactor
but this gets a demo at 4x working.
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
TSC21 870c513aad readd CMAKE_RUNTIME_OUTPUT_DIRECTORY install for the posix build 2018-12-13 02:09:31 +00:00
TSC21 a6121e1655 Cmake build: do not change CMAKE_RUNTIME_OUTPUT_DIRECTORY if building with catkin 2018-12-13 02:09:31 +00:00
James Goppert c7eb21be86 Fix catkin/ROS build paths. 2018-12-13 02:09:31 +00:00
Kārlis Seņko c1d50d35d3 Move common shmem parameter declarations to shmem.h. 2018-12-11 09:21:15 -05:00