52 Commits

Author SHA1 Message Date
Daniel Agar
f4e2cd36d4 add new invensense/mpu6500 driver for airmind mindpx 2020-03-25 01:05:38 -04:00
Daniel Agar
f5fe50f839 invensense/icm20608g driver minor improvements
- interupt pin set active low and latch
 - relax retry timeout if configure failed
 - improve configured empty rate (sample rate) rounding
 - fix RegisterCheck
 - check FIFO count as part of full transfer and reset or adjust timing if necessary
 - rename DRV_IMU_DEVTYPE_ICM20608 -> DRV_IMU_DEVTYPE_ICM20608G
2020-03-25 01:05:38 -04:00
Daniel Agar
64c7b4d489 parameters: handle MC_DTERM_CUTOFF -> IMU_DGYRO_CUTOFF migration 2020-03-15 09:31:45 +01:00
Beat Küng
a2b2605443 param: fix param_get_cplusplus type check 2020-03-10 10:11:43 -04:00
Beat Küng
b54e5a1c23 param: automatically update calibration ID params on import
This avoids the need for recalibration, and also cleans up other driver
ID's (merge separate accel/gyro).

The SPI address was previously set to a board-specific (arbitrary) value,
and is now set to 0. This will allow extending for multiple sensors of the
same type on the same bus.
2020-03-10 10:11:43 -04:00
Daniel Agar
d7c3e1066a
uavcannode updates and px4_fmu-v4_cannode example
- drivers/uavcannode add baro, mag, gps publications
 - delete old px4_cannode-v1 board
 - add stripped down simple rcS for CAN nodes
2020-02-16 12:11:54 -05:00
Julian Oes
9a96ca14be Tools: make Python import error more readable
The problem with printing the exception was that starting with
Python 3.6 the ImportError is yet another (sub) exception called
ModuleNotFoundError which can't be printed as a string and then triggers
another exception:

```
Traceback (most recent call last):
  File "/home/julianoes/src/Firmware/Tools/serial/generate_config.py", line 11, in <module>
    import jinja2
ModuleNotFoundError: No module named 'jinja2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/julianoes/src/Firmware/Tools/serial/generate_config.py", line 13, in <module>
    print("Failed to import jinja2: " + e)
TypeError: must be str, not ModuleNotFoundError
```

As per @bkueng's suggestion the easiest is to cast the exception to str
and that way prevent the second exception.
2020-02-14 11:40:05 +01:00
Julian Oes
c77816aef2 cmake: move jinja2 check to Python modules
This removes the cmake check for jinja2 and moves it to the respective
Python scripts.
2020-01-16 16:25:26 +01:00
Matthias Grob
ffff35a597 Unit tests: use EXPECT_FLOAT_EQ for float comparisons
as precaution to prevent failing tests because of small potential
rounding errors on certain platforms or compilares.
2019-12-26 12:53:07 +01:00
Christian Clauss
6dc55f97d4 More fixes for Python 3 compatibility (#13008)
* More fixes for Python 3 compatibility

* Workaround if the six module is not pip installed

* Lose the semicolons
2019-12-19 02:05:55 -08: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
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
375fc4a75c
uavcan module cleanup
- move most orb to uORB::Publication and uORB::Subscription
 - update legacy message handling (warn to PX4_INFO, PX4_WARN, PX4_ERR)
 - add perf counters
 - sensors/mag support newer `uavcan::equipment::ahrs::MagneticFieldStrength2` message
 - sensors/gps support `uavcan::equipment::gnss::Auxiliary` for hdop and vdop
 - sensors delete obsolete ioctl and read methods
 - use PublicationMulti for actuator_outputs and esc_reports (to coexist with other output modules)
 - add GNSS parameter metadata (parameters_injected.xml)
2019-10-28 19:57:50 -04:00
Daniel Agar
967446af4c clang-tidy: enable readability-simplify-boolean-expr and fix 2019-10-27 19:19:07 -04:00
Hamish Willee
564b29c0f8 Fix incorrect default for parser 2019-10-24 19:00:17 -07:00
Hamish Willee
a904f78fad Parameter parser/markdown includes boolean flag 2019-10-24 19:00:17 -07:00
Tanja Baumann
be1f966e5f Collision prevention: Option to enable flying outside FOV and rename parameters (new CP group)
* rename parameters to allow more descriptive names under CP group
* add option to enable moving where there is no data
* add test for param CP_GO_NO_DATA

Co-Authored-By: Martina Rivizzigno <martina@rivizzigno.it>
2019-10-17 11:23:50 -04:00
Beat Küng
82106105b7 parameters: defer auto-saving to after disarming for flash-based params
This is especially important for DShot, that does not update when the CPU
stalls.
2019-10-11 08:14:17 +02:00
Beat Küng
93a12436a3 parameters: update perf counter for flash-based param_save_default() 2019-10-11 08:14:17 +02:00
Hamish Willee
94ef585f76 Link to missing params docs 2019-09-11 09:17:00 -04:00
Beat Küng
f32abe8534 src/platforms: move remaining source files to platforms/common 2019-08-30 07:59:44 +02:00
Julian Kent
5c68880b56 Reset parameters in test setup, not teardown 2019-08-21 14:53:41 +02:00
Julian Kent
63140f1d61 Do a single setup of uORB/Parameters instead of once every test 2019-08-21 14:53:41 +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
Mark Sauder
4c228eaf4a cmake whitespace fixes to quiet git hook. 2019-03-16 14:48:44 -04:00
Daniel Agar
b35d048566 cmake enable -Wcast-align and disable per module 2019-03-16 11:47:15 -04:00
David Sidrane
0cc3bfb10b flashfs:Track upstream nuttx CONFIG_ARCH_HAVE_PROGMEM
Upstream header file is conditional on CONFIG_ARCH_HAVE_PROGMEM
2019-01-25 06:32:37 -08:00
David Sidrane
f00d633196 flashfs:Upstream renamed up_progmem_erasepage to up_progmem_eraseblock 2019-01-25 06:32:37 -08: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
658d734068 param add status 2019-01-18 11:50:37 -05:00
Daniel Agar
84724d5e1d param show default only active parameters
- add -a option to display all possible system parameters
2019-01-18 11:50:37 -05:00
Beat Küng
5b4a77a67b params: add possibility to access files if flash-based params are enabled
- the flash-backend is selected by specifying nullptr as file or -1 as fd
- the default file is nullptr, and thus the FLASH
- 'param select' has no effect, FLASH is always the default

Thus there should be no functional change to existing setups.
2018-12-23 15:49:37 -05:00
Julian Oes
8e4296d000 parameters: remove unneeded usleep
According to @bkueng this was to schedule other processes but can now be
removed.
2018-12-22 10:32:18 +01:00
Julian Oes
3f508c99fd parameters: commented out strange usleep 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
Kārlis Seņko
c1d50d35d3 Move common shmem parameter declarations to shmem.h. 2018-12-11 09:21:15 -05:00
Kārlis Seņko
859b242cb8 Fix some dynamic linking errors.
_Stof, bsearch, param_find_changed
2018-12-11 09:21:15 -05:00
Daniel Agar
d42fe1826a
parameters also include all module configs when scoping disabled (#10992)
* fixes parameters on Snapdragon
2018-12-06 14:21:06 -05:00
Daniel Agar
abb3817d31 boards new split VENDOR_MODEL naming convention 2018-11-26 14:40:14 -08:00
Daniel Agar
f692ad04d0 boards organization 2018-11-26 14:40:14 -08:00
Beat Küng
dae292631c Tools/serial: use per-module serial port config params, instead of per-port 2018-09-25 07:53:29 +02:00
Beat Küng
dc412e4cd5 px_process_params.py: fix default argument for --inject-xml 2018-09-25 07:53:29 +02:00
Beat Küng
c237221a81 cmake: add serial param & ROMFS generation to the build system
- only a few configs done yet
2018-09-25 07:53:29 +02:00
Daniel Agar
38aa9a20f6 parameters delete unused scope 2018-09-23 13:56:04 -04:00
Hamish Willee
dc878f43a8 Param docs explain how create (#10439)
This adds text to markdown output to explain how params are generated
2018-09-10 09:38:41 -04:00
Daniel Agar
060463e8a7
parameters lib convert to c++ (#10267) 2018-09-04 09:18:28 -04:00
Beat Küng
1a4396c15e param_shmem: rename exit to do_exit 2018-08-31 18:11:58 +02:00
Daniel Agar
7ceb79d606
parameters lib always depend on prebuild_targets 2018-08-12 10:25:24 -04:00
Daniel Agar
a7f3012c1c delete all dokuwiki helpers 2018-08-08 14:07:59 -04:00
Daniel Agar
cf74166801 double promotion warning fix or ignore per module 2018-07-01 09:36:55 +00:00