5135 Commits

Author SHA1 Message Date
Daniel Agar
99a7491cde
bmp280: build on linux and qurt 2019-11-13 15:16:24 -05:00
Daniel Agar
bcfa2eecd8
ms5611: build on linux (navio2) 2019-11-13 13:01:00 -05:00
Daniel Agar
c5520cbaca mpu9250: start building "NuttX" driver for Linux and QuRT 2019-11-13 09:21:02 -05:00
Matthias Grob
675af4f5f9 uavcan_kinetis: fix flexcan code style
* flexcan: fix code style
* flexcan: exclude from style check to avoid that a different version of astyle breaks indentation again
2019-11-12 20:50:54 -05:00
Daniel Agar
9183f44243 px4_fmu-v4: deprecate boscch pixracer variant and cleanup SPI devs 2019-11-12 11:18:57 -05:00
Julian Oes
00a7ac013c ak09916: fix mag spikes
This fixes spuriously occuring mag spikes in the external mag of Here2.

The reason for the spikes was that the fact that the I2C registers were
not read out correctly as suggested in the datasheet.

Before we were reading out ST1, data, and ST2 in one pass and ignoring
the data ready bit (DRDY) in ST1. This meant that we could run into race
conditions where the data was not ready when we started reading and
being updated as the registers are read.

Instead, we need to check the read the ST1 register first to check the
data ready bit and then read the data and ST2 if the data is ready. By
reading ST2 we then trigger the next measurement in the chip.
2019-11-12 10:04:35 -05:00
Julian Oes
035e81e084 ak09916: cleanup only
Note: the author name was removed because this file has almost no
resemblence with the code written by that author 4 years ago, has been
copied to new places, and was initially commited without author anyway.

Also, my opinion is that the version control system should take care of
attribution, and not outdated comments.
2019-11-12 10:04:35 -05: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
1fc85da4b0
Update submodule GPSDrivers to latest Fri Nov 8 12:40:32 UTC 2019
- GPSDrivers in PX4/Firmware (085bdd14b41ac3977d612a1cae27f111de7fe4fb): 011959b4da
    - GPSDrivers current upstream: 085a85c48a
    - Changes: 011959b4da...085a85c48a

    085a85c 2019-10-15 Andreas Antener - sbf: invalidating gps position when invalid data is received We have encountered a case where do-not-use values were being reported in velocity fields without a corresponding error code or fix-type 0. This adds a check for known invalid data and sets the appropriate flags.
2019-11-08 09:43:53 -05:00
Beat Küng
073298bc8e
batt_smbus: fix incorrect CLI description 2019-11-08 13:52:23 +01:00
Beat Küng
a5af1c8afc batt_smbus: add missing PRINT_MODULE_USAGE_DEFAULT_COMMANDS() 2019-11-07 10:56:27 +01:00
Beat Küng
f94236dcc9 batt_smbus: fix getopt arguments (-A does not have an argument) 2019-11-07 10:56:27 +01:00
Beat Küng
ce1ae3fcb7 batt_smbus: exit/continue correctly when no device is on the bus 2019-11-07 10:56:27 +01:00
Beat Küng
72e62a62cb batt_smbus: make bus_options const and rename to smbus_bus_options
as it is a global name.
2019-11-07 10:56:27 +01:00
Beat Küng
adad11f247 batt_smbus: remove unused defines 2019-11-07 10:56:27 +01:00
Beat Küng
b487920cf4 fix batt_smbus: add bound checks when accessing argv 2019-11-07 10:56:27 +01:00
Beat Küng
60f55a4fa1 fix batt_smbus: check if module running for custom_command 2019-11-07 10:56:27 +01:00
Beat Küng
f63b55b219 fix batt_smbus: do not block the work queue while suspended 2019-11-07 10:56:27 +01:00
Beat Küng
3f3304fefc batt_smbus: variable init cleanup + remove unused declarations 2019-11-07 10:56:27 +01:00
Beat Küng
32359168d6 smbus: fix invalid memory access in read_word()
read_word() expected 3 bytes (uint16_t + PEC byte), but was passed an
address to an uint16_t value.

write_word() is changed to be type-safe as well.
2019-11-07 10:56:27 +01:00
Beat Küng
6622f04feb uavcan drivers: update code style
Pure refactoring, just running 'make format'.
2019-11-07 10:40:03 +01:00
Beat Küng
6049a95073 uavcan drivers: remove unused code for other OSs/bare metal 2019-11-07 10:40:03 +01:00
Beat Küng
5dff065ec5 uavcan: move to work queue and use MixingOutput
Main UAVCAN protocol handling and ESC updates run on the same thread/wq as
before. There are 2 WorkItems for separate scheduling of the 2, so that
ESC updates run in sync with actuator_control updates. UAVCAN is scheduled
at a fixed rate of 3ms (previously the poll timeout) and on each UAVCAN
bus event.
This leads to roughly the same behavior as before. CPU & RAM usage are
pretty much the same (tested on Pixhawk 4).

Testing done: Motors still work (with feedback), param changes and a
UAVCAN optical flow sensor.
2019-11-07 10:40:03 +01:00
Beat Küng
b7a480b45b refactor uavcan: add stm32 and kinetis drivers directly 2019-11-07 10:40:03 +01:00
Beat Küng
6854b14dd6 esc_report: remove unused fields to reduce message size
esc_setpoint in UAVCAN was just wrong, this is what it really is:
uint7 power_rating_pct      # Instant demand factor in percent
(percent of maximum power); range 0% to 127%.
2019-11-07 10:40:03 +01:00
Beat Küng
0db0981b1b uavcan: remove actuator_direct (no publisher) 2019-11-07 10:40:03 +01:00
Daniel Agar
5ec74af421 ADIS IMU drivers cleanup and standardize main 2019-11-05 11:58:43 -05:00
Matthias Grob
1a79f75f94 Commander: start pulling arming related parts into separate folder
* PreFlightCheck: remove unused reportFailures flag
* Commander: pull all pre flight checks together on the PreFlightCheck class
* PreFlightCheck: separate checks into their own files
2019-11-05 11:25:59 -05:00
Jacob Dahl
005f530eed Removed lidar lite reset after intialization 2019-11-03 20:07:27 +01:00
Daniel Agar
7bf9700426
NuttX: math.h drop extra math defines carried in PX4 defines.h 2019-11-03 10:30:00 -05:00
Julian Oes
a08abccdd5 mpu9250: fix mag spikes on fmu-v4pro
This should fix spikes in the mag data on MPU9250 found inside Drotek
Pixhawk 3Pro.

The problem turned out to be that we are not checking the DRDY bit
before reading the data. We presumably threw away most of the stale data
by doing a duplicate check, however, sometimes we might have run into a
race where the mag data was already being updated in the chip while
still being read.
2019-11-02 12:49:30 -04:00
Daniel Agar
7a82df3872
UVify Core and Draco-R updates
* Draco-R sensor orientation correction
* LL40LS sensor is not stable during I2C probing. More trials have been implemented.
* px4flow execution has been removed as rc script already running it
* GPS LED script repaired
* Off ICM20608 due to some bug?
* Removed i2c speed adjustment due to SMBUS.
* ms5611 test2 does not exist
* Baud rate has changed.
* Draco-R airframe parameters are updated.
* IFO and Draco parameters are updated
* Draco-R sensor orientation corrected
* Draco-R DSHOT supports
2019-11-02 11:39:41 -04:00
Daniel Agar
a475d71ca9
astyle shift module documentation to bottom of files
- Astyle chokes on the module description strings, so for now we can keep them near the bottom of each file.
2019-11-02 10:58:47 -04:00
CUAVcaijie
77a896a0dd UAVCAN: Fixed CAN battery status
* Set battery.voltage_filtered_v and battery.current_filtered_a value
* Fixed battery.remaining error when full_charge_capacity_wh is zero
2019-10-31 22:35:04 -04:00
Daniel Agar
129299e25d
Update submodule GPSDrivers to latest Fri Nov 1 00:38:09 UTC 2019 (#13338)
- GPSDrivers in PX4/Firmware (939b83ad492abe795f5eb9f0c4e4387aaee193a5): 69e38ecc84
    - GPSDrivers current upstream: 011959b4da
    - Changes: 69e38ecc84...011959b4da

    011959b 2019-10-27 Daniel Agar - clang-tidy: fix hicpp-member-init
2019-10-31 21:29:27 -04:00
Beat Küng
3b7c1b4ff1 src/drivers/boards: move to platforms/nuttx/src/px4/common 2019-10-30 11:48:47 +01:00
Beat Küng
be7ed5e388 src/drivers/boards/common/{stm32,kinetis}: move under platforms/nuttx/src/px4 2019-10-30 11:48:47 +01:00
Beat Küng
58e161347b board_mcu_version: move to platforms/nuttx/src/px4 2019-10-30 11:48:47 +01:00
Beat Küng
e7519c9fa0 board_identity: move to platforms/nuttx/src
And fix a potential alignment issue in board_get_mfguid and
board_get_px4_guid.
2019-10-30 11:48:47 +01:00
Beat Küng
b30171ba8d board_common.h: move under platforms/common
Also move board_determine_hw_info and board_gpio_init under platforms/nuttx
2019-10-30 11:48:47 +01: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
c284198bec clang-tidy: partially fix hicpp-use-override 2019-10-28 10:50:31 -04:00
Daniel Agar
4192414576 clang-tidy: partially fix cppcoreguidelines-pro-type-reinterpret-cast 2019-10-28 10:50:31 -04:00
Jacob Crabill
ffefd458be UAVCAN: Optical Flow: Bug fix (missing integration_timespan field in optical_flow topic). (#13257) 2019-10-25 13:21:03 +02:00
Beat Küng
02833c6075 px4io: add support for test_motor
And fix some IO bugs:
- PX4IO_P_STATUS_FLAGS_RAW_PWM was never cleared. This meant that after a
  'pwm test' command, normal mixing was not possible anymore.
  Fixed by remembering when we are in test mode and not sending
  PX4IO_PAGE_CONTROLS during that time. PX4IO_P_STATUS_FLAGS_RAW_PWM is
  cleared when PX4IO_PAGE_CONTROLS are received.
- when entering test mode w/o specifying all channels, the other channels
  were not set at all, which means they could still be set to values from
  a previous test call.
  This is fixed by setting all channels to disarmed when entering/leaving
  test mode.
2019-10-24 09:27:29 +02:00
Beat Küng
eb6a9bd488 px4io: add missing lock()/unlock() in ioctl 2019-10-24 09:27:29 +02:00
mcsauder
7389bf1759 Add rangefinder dependency to the CM8JL65 driver CMakeList and organize #includes. 2019-10-24 01:50:49 -04:00
Daniel Agar
35398e05ca
perf counter cleanup (mostly intervals)
Some of these perf counters were useful during initial development, but realistically aren't needed anymore, some are redundant when we can now see the average interval from `work_queue status` and some of them simply aren't worth the cost at higher rates.
2019-10-21 18:54:17 -04:00
Daniel Agar
6a0f5249f8
sensors: split out analog battery handling to new standalone battery_status module 2019-10-21 13:40:23 -04:00