Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding px4 fmu v6c #19544

Merged
merged 4 commits into from
May 20, 2022
Merged

Adding px4 fmu v6c #19544

merged 4 commits into from
May 20, 2022

Conversation

davids5
Copy link
Member

@davids5 davids5 commented Apr 26, 2022

Untested waiting on HW

Need all sensors rotations

Tested on HW.

  1. @vincentpoont2 The reason the px4io is failing is the the units were shipped with 25.00 mHz Xatal at X7 this needs to be 24.00 mHz

To do:

  1. Need to verify sensors and Calibration - Done
  2. Verify all signals on all connectors. - - Done

@davids5
Copy link
Member Author

davids5 commented Apr 26, 2022

FYI @vincentpoont2

@vincentpoont2
Copy link
Member

6C IMU

@davids5
Copy link
Member Author

davids5 commented Apr 28, 2022

@vincentpoont2 - Rotations are set now per the above image. Please test.

@vincentpoont2
Copy link
Member

vincentpoont2 commented Apr 29, 2022

@davids5 we having this issue for all 3 units we tested

[boot] Rev 0x0 : Ver 0x0 V6C00
reset done, 10 ms
[boot] Fault Log info File No 4 Length 3177 flags:0x01 state:1
[boot] Fault Log is Armed
sercon: Registering CDC/ACM serial driver
sercon: Successfully registered the CDC/ACM serial driver
HW arch: PX4_FMU_V6C
HW type: V6C00
HW version: 0x00000000
HW revision: 0x00000000
FW git-hash: d5f5846d03ae23f91aacfe6feadf810138e325d2
FW version: 1.13.0 80 (17629312)
OS: NuttX
OS version: Release 10.2.0 (167903487)
OS git-hash: c5c7d2b4f26f52f1dfb425ebde83328606b65d4f
Build datetime: Apr 28 2022 17:37:16
Build uri: localhost
Build variant: default
Toolchain: GNU GCC, 9.3.1 20200408 (release)
PX4GUID: 000600000000353533373139510800480030
MCU: STM32H7[4|5]xxx, rev. V
[hardfault_log] Fault Log is Armed
INFO  [param] selected parameter default file /fs/mtd_params
INFO  [param] importing from '/fs/mtd_params'
INFO  [parameters] BSON document size 749 bytes, decoded 749 bytes (INT32:13, FLOAT:21)
INFO  [param] selected parameter backup file /fs/microsd/parameters_backup.bson
Board architecture defaults: /etc/init.d/rc.board_arch_defaults
Board defaults: /etc/init.d/rc.board_defaults
ERROR [param] Parameter MAV_2_BROADCAST not found.
ERROR [param] Parameter MAV_2_REMOTE_PRT not found.
ERROR [param] Parameter MAV_2_UDP_PRT not found.
nsh: safety_button: command not found
INFO  [dataman] data manager file '/fs/microsd/dataman' size is 62560 bytes
Loading airframe: /etc/init.d/airframes/4019_x500_v2
INFO  [uavcan] Node ID 1, bitrate 1000000
WARN  [px4io] check CRC failed: -1, CRC: 1891365525
WARN  [px4io] IO refused to re-enable safety
WARN  [px4io] IO refused to reboot
WARN  [px4io] reboot failed - -1, still attempting upgrade
[PX4IO] using firmware from /etc/extras/px4_io-v2_default.bin
[PX4IO] bad sync 0xff,0xff
[PX4IO] found bootloader revision: 5
[PX4IO] erase...
[PX4IO] programming 39952 bytes...
[PX4IO] verify...
[PX4IO] update complete
INFO  [tune_control] Stopping playback...
WARN  [px4io] check CRC failed: -1, CRC: 1891365525
PX4IO not found
Board sensors: /etc/init.d/rc.board_sensors
nsh: bmi055: command not found
nsh: bmi055: command not found
icm42688p #0 on SPI bus 1 rotation 6
ERROR [SPI_I2C] ms5611: no instance started (no device on bus?)
ERROR [SPI_I2C] ist8310: no instance started (no device on bus?)
ERROR [SPI_I2C] ist8310: no instance started (no device on bus?)
nsh: battery_status: command not found
ERROR [mixer] can't open /dev/pwm_output0

ERROR [mixer] failed to load mixer
ERROR  [init] Failed loading mixer: /etc/mixers/quad_x.main.mix
INFO  [init] setting PWM_AUX_OUT none
ekf2 [639:237]
Starting Main GPS on /dev/ttyS0
Starting MAVLink on /dev/ttyS5
INFO  [mavlink] mode: Normal, data rate: 1200 B/s on /dev/ttyS5 @ 57600B
nsh: rc_input: command not found
INFO  [logger] logger started (mode=all)

@davids5
Copy link
Member Author

davids5 commented Apr 29, 2022

@vincentpoont2 - sensors should work now. Please retest

@vincentpoont2
Copy link
Member

vincentpoont2 commented May 5, 2022

@davids5
Still having this issue with the latest Artifact on the 6C

[boot] Rev 0x0 : Ver 0x0 V6C00
reset done, 10 ms
[boot] Fault Log info File No 4 Length 3177 flags:0x01 state:1
[boot] Fault Log is Armed
sercon: Registering CDC/ACM serial driver
sercon: Successfully registered the CDC/ACM serial driver
HW arch: PX4_FMU_V6C
HW type: V6C00
HW version: 0x00000000
HW revision: 0x00000000
FW git-hash: 8c34ffb83af774db90396ca0ed4178c8d3df45cd
FW version: 1.13.0 80 (17629312)
OS: NuttX
OS version: Release 10.2.0 (167903487)
OS git-hash: c5c7d2b4f26f52f1dfb425ebde83328606b65d4f
Build datetime: Apr 29 2022 13:42:51
Build uri: localhost
Build variant: default
Toolchain: GNU GCC, 9.3.1 20200408 (release)
PX4GUID: 000600000000353533373139510800410028
MCU: STM32H7[4|5]xxx, rev. V
rdfault_log] Fault Log is Armed
INFO  [param] selected parameter default file /fs/mtd_params
INFO  [param] importing from '/fs/mtd_params'
INFO  [parameters] BSON document size 115 bytes, decoded 115 bytes (INT32:2, FLOAT:3)
INFO  [param] selected parameter backup file /fs/microsd/parameters_backup.bson
Board architecture defaults: /etc/init.d/rc.board_arch_defaults
Board defaults: /etc/init.d/rc.board_defaults
ERROR [param] Parameter MAV_2_BROADCAST not found.
ERROR [param] Parameter MAV_2_REMOTE_PRT not found.
ERROR [param] Parameter MAV_2_UDP_PRT not found.
nsh: safety_button: command not found
INFO  [dataman] data manager file '/fs/microsd/dataman' size is 62560 bytes
INFO  [uavcan] Node ID 1, bitrate 1000000
WARN  [px4io] check CRC failed: -1, CRC: 1891365525
WARN  [px4io] IO refused to re-enable safety
WARN  [px4io] IO refused to reboot
WARN  [px4io] reboot failed - -1, still attempting upgrade
[PX4IO] using firmware from /etc/extras/px4_io-v2_default.bin
[PX4IO] bad sync 0xff,0xff
[PX4IO] found bootloader revision: 5
[PX4IO] erase...
[PX4IO] programming 39952 bytes...
[PX4IO] verify...
[PX4IO] update complete
INFO  [tune_control] Stopping playback...
WARN  [px4io] check CRC failed: -1, CRC: 1891365525
PX4IO not found
Board sensors: /etc/init.d/rc.board_sensors
ERROR [SPI_I2C] bmi055: no instance started (no device on bus?)
ERROR [SPI_I2C] bmi055: no instance started (no device on bus?)
icm42688p #0 on SPI bus 1 rotation 6
ERROR [SPI_I2C] ms5611: no instance started (no device on bus?)
ist8310 #0 on I2C bus 4 address 0xC rotation 6
ERROR [SPI_I2C] ist8310: no instance started (no device on bus?)
nsh: icm20948_i2c_passthrough: command not found
nsh: battery_status: command not found
No autostart ID found
ekf2 [380:237]
Starting Main GPS on /dev/ttyS0
Starting MAVLink on /dev/ttyS5
INFO  [mavlink] mode: Normal, data rate: 1200 B/s on /dev/ttyS5 @ 57600B
nsh: rc_input: command not found
INFO  [logger] logger started (mode=all)

NuttShell (NSH) NuttX-10.2.0
nsh> 

@davids5
Copy link
Member Author

davids5 commented May 5, 2022

@vincentpoont2 There are issues with the IMU board. I will contact you on Slack

@davids5
Copy link
Member Author

davids5 commented May 6, 2022

NuttShell (NSH) NuttX-10.2.0
nsh> [boot] Rev 0x0 : Ver 0x0 V6C00
reset done, 10 ms
[boot] Fault Log info File No 4 Length 3177 flags:0x01 state:1
[boot] Fault Log is Armed
HW arch: PX4_FMU_V6C
HW type: V6C00
HW version: 0x00000000
HW revision: 0x00000000
FW git-hash: ffa1045eb858eac774094ee64a41a178e39a1bcd
FW version: 1.13.0 80 (17629312)
sercon: Registering CDC/ACM serial driver
FW git-branch: pr-px4_fmu-v6c
sercon: Successfully registered the CDC/ACM serial driver
OS: NuttX
OS version: Release 10.2.0 (167903487)
OS git-hash: c5c7d2b4f26f52f1dfb425ebde83328606b65d4f
Build datetime: May  6 2022 13:30:27
Build uri: localhost
Build variant: default
Toolchain: GNU GCC, 9.3.1 20200408 (release)
PX4GUID: 0006000000003535333731395108004a002c
MCU: STM32H7[4|5]xxx, rev. V
nsh: mount: mount failed: No such device
INFO [init] formatting /dev/mmcsd0
nsh: mkfatfs: mkfatfs failed: No such device
ERROR [init] format failed
INFO  [param] selected parameter default file /fs/mtd_params
INFO  [param] importing from '/fs/mtd_params'
INFO  [parameters] BSON document size 363 bytes, decoded 363 bytes (INT32:8, FLOAT:9)
Board architecture defaults: /etc/init.d/rc.board_arch_defaults
Board defaults: /etc/init.d/rc.board_defaults
ERROR [param] Parameter MAV_2_BROADCAST not found.
ERROR [param] Parameter MAV_2_REMOTE_PRT not found.
ERROR [param] Parameter MAV_2_UDP_PRT not found.
nsh: safety_button: command not found
WARN  [dataman] Could not open data manager file /fs/microsd/dataman
ERROR [dataman] dataman start failed
INFO  [uavcan] Node ID 1, bitrate 1000000
ERROR [uavcan] CentralizedServer init: -1
ERROR [uavcan] UavcanServers init: 0
INFO  [px4io] IO FW CRC match
Board sensors: /etc/init.d/rc.board_sensors
bmi055_accel #0 on SPI bus 1 rotation 4
bmi055_gyro #0 on SPI bus 1 rotation 4
icm42688p #0 on SPI bus 1 rotation 6
ms5611 #0 on I2C bus 4 address 0x77
ist8310 #0 on I2C bus 4 address 0xC rotation 6
ERROR [SPI_I2C] ist8310: no instance started (no device on bus?)
nsh: icm20948_i2c_passthrough: command not found
nsh: battery_status: command not found
No autostart ID found
ekf2 [335:237]
Starting Main GPS on /dev/ttyS0
Starting MAVLink on /dev/ttyS5
ERROR [mavlink] DM_KEY_MISSION_STATE lock failed
WARN  [mavlink] offboard mission init failed (-1)
INFO  [mavlink] mode: Normal, data rate: 1200 B/s on /dev/ttyS5 @ 57600B
INFO  [logger] logger started (mode=all)
INFO  [logger] log root dir created: /fs/microsd/log

NuttShell (NSH) NuttX-10.2.0
nsh>

@vincentpoont2
Copy link
Member

vincentpoont2 commented May 9, 2022

With the 24Mhz Xtal installed & the latest firmware artifact. BMI055 can be recognized.
Unable to detect battery voltage, therefore, we cant unlock and test fly.
image

Bootloader shows FMUV6X on QGC, assuming because it has the same PID.
20220509 FMUv6C print.txt

[boot] Rev 0x0 : Ver 0x0 V6C00
reset done, 10 ms
[boot] Fault Log info File No 4 Length 3177 flags:0x01 state:1
[boot] Fault Log is Armed
sercon: Registering CDC/ACM serial driver
sercon: Successfully registered the CDC/ACM serial driver
HW arch: PX4_FMU_V6C
HW type: V6C00
HW version: 0x00000000
HW revision: 0x00000000
FW git-hash: 1aed5a434da9d95a93a4eeeb57399a8329a3c2b1
FW version: 1.13.0 80 (17629312)
OS: NuttX
OS version: Release 10.2.0 (167903487)
OS git-hash: c5c7d2b4f26f52f1dfb425ebde83328606b65d4f
Build datetime: May 6 2022 23:33:30
Build uri: localhost
Build variant: default
Toolchain: GNU GCC, 9.3.1 20200408 (release)
PX4GUID: 0006000000003535333731395108003e0039
MCU: STM32H7[4|5]xxx, rev. V
[hardfault_log] Fault Log is Armed
INFO [param] selected parameter default file /fs/mtd_params
INFO [param] importing from '/fs/mtd_params'
INFO [parameters] BSON document size 192 bytes, decoded 192 bytes (INT32:5, FLOAT:4)
INFO [param] selected parameter backup file /fs/microsd/parameters_backup.bson
Board architecture defaults: /etc/init.d/rc.board_arch_defaults
Board defaults: /etc/init.d/rc.board_defaults
ERROR [param] Parameter MAV_2_BROADCAST not found.
ERROR [param] Parameter MAV_2_REMOTE_PRT not found.
ERROR [param] Parameter MAV_2_UDP_PRT not found.
nsh: safety_button: command not found
INFO [dataman] data manager file '/fs/microsd/dataman' size is 62560 bytes
rgbled_ncp5623c #0 on I2C bus 1 (external) address 0x39
Loading airframe: /etc/init.d/airframes/4015_holybro_s500
INFO [uavcan] Node ID 1, bitrate 1000000
INFO [px4io] IO FW CRC match
Board sensors: /etc/init.d/rc.board_sensors
bmi055_accel #0 on SPI bus 1 rotation 4
bmi055_gyro #0 on SPI bus 1 rotation 4
icm42688p #0 on SPI bus 1 rotation 6
ms5611 #0 on I2C bus 4 address 0x77
ist8310 #0 on I2C bus 4 address 0xC rotation 6
ist8310 #1 on I2C bus 1 (external) address 0xE rotation 10
nsh: icm20948_i2c_passthrough: command not found
WARN [SPI_I2C] Already running on bus 1
nsh: battery_status: command not found
INFO [pwm_out] instance: 0, max rate: 100, default: 50, alt: 50
INFO [init] Mixer: /etc/mixers/quad_x.main.mix on /dev/pwm_output0
INFO [init] Mixer: /etc/mixers/pass.aux.mix on /dev/pwm_output1
ekf2 [657:237]
INFO [pwm_out] instance: 0, max rate: 100, default: 50, alt: 50
Starting Main GPS on /dev/ttyS0
Starting MAVLink on /dev/ttyS5
WARN [mavlink] offboard mission init failed (-1)
INFO [mavlink] mode: Normal, data rate: 1200 B/s on /dev/ttyS5 @ 57600B
INFO [logger] logger started (mode=all)
NuttShell (NSH) NuttX-10.2.0
nsh> INFO [gps] u-blox firmware version: SPG 3.01
INFO [gps] u-blox protocol version: 18.00
INFO [gps] u-blox module: NEO-M8N-0
INFO [gps] u-blox firmware version: SPG 3.01
INFO [gps] u-blox protocol version: 18.00
INFO [gps] u-blox module: NEO-M8N-0

@vincentpoont2
Copy link
Member

vincentpoont2 commented May 9, 2022

@davids5 Is it possible to temporarily add some test software to the firmware, such as SD_bench, and enable it to print out the temperature of the CPU? It would help with our CPU temp testing.

@davids5
Copy link
Member Author

davids5 commented May 9, 2022

@vincentpoont2 -

USB ID and Board ID updated.
Battery issues should be resolved
Test Code added.

For temperature see adc_report channel 20 and the datasheet for the conversion.

nsh> listener adc_report

TOPIC: adc_report
 adc_report
    timestamp: 541120274 (0.003151 seconds ago)
    device_id: 4294967295 (Type: 0xFF, UNKNOWN:31 (0xFF))
    raw_data: [0, 45, 17343, 175, 50442, 12964, 0, 0, 0, 0, 0, 0]
    resolution: 65536
    v_ref: 3.3000
    channel_id: [4, 5, 8, 14, 18, 20, -1, -1, -1, -1, -1, -1]

@vincentpoont2
Copy link
Member

@davids5
First indoor flight with the FMUv6C Hardware
https://logs.px4.io/plot_app?log=7296ea9a-f9ca-4400-a36a-df0bb474efe9

davids5 added 3 commits May 13, 2022 08:51
px4 fmu-v6c_bootloader Ensure PWM pins are low from power on

px4_fmu-v6c:Clean up DMA map

px4_fmu-v6c:Add to px4io_update

px4_fmu-v6c:Fix BMI055 CS

px4_fmu-v6c:Use address 0x77 for MS6511 (shematic is wrong)

px4_fmu-v6c:Set Board type and PRODUCTID

px4_fmu-v6c:Add Analog battery support
@davids5 davids5 requested a review from dagar May 13, 2022 15:53
@davids5
Copy link
Member Author

davids5 commented May 13, 2022

@vincentpoont2 - I fixed a bug that periph_5v_oc was reported wrong. Also the Safety switch CBRK default was not allowing the safety switch to be used. The board is added to the build archive now as well.

I have tested all signals at the connectors. It is now 100% functional.

@dagar - this is ready to come in.

@davids5 davids5 marked this pull request as ready for review May 13, 2022 17:05
dagar
dagar previously approved these changes May 13, 2022
@vincentpoont2
Copy link
Member

Reposting here for record keeping. @davids5

Test flight with v6C:
6C Position mode is completely unstable. If the remote controller does not intervene, the aircraft will fly randomly.
Log: https://logs.px4.io/plot_app?log=8430dfd6-4a40-4f1a-baf7-dcf704b268ba

After calibration, the external MAG will be automatically set to YAW270. Manually change it to NONE for test flight, and it can be fixed. But the flight performance is not very good.
Log is as follows: https://logs.px4.io/plot_app?log=292f2b1a-946c-41cb-a44b-faec67f9a435

M8N GPS + X500 was used on these test flights.

@dagar Was the mag orientation supposed to be left as the 3DR? and not +X in DOF +Y right +Z down? Would you please have a look at the logs and advise

@vincentpoont2
Copy link
Member

@davids5
We placed the IST8310 sensor to a position far away from the flight control, but still did not solve the problem of unstable positioning. The external IST8310 has been connected to other flight controllers for calibration, and it is confirmed that the OFFSET of the XYZ axis is not greater than 200. The possibility of a bad compass was ruled out.

The test flight Log here https://review.px4.io/plot_app?log=2c21a087-7159-4e2d-b0f0-3cae9812ea47

@davids5
Copy link
Member Author

davids5 commented May 20, 2022

@davids5 We placed the IST8310 sensor to a position far away from the flight control, but still did not solve the problem of unstable positioning. The external IST8310 has been connected to other flight controllers for calibration, and it is confirmed that the OFFSET of the XYZ axis is not greater than 200. The possibility of a bad compass was ruled out.

The test flight Log here https://review.px4.io/plot_app?log=2c21a087-7159-4e2d-b0f0-3cae9812ea47

@vincentpoont2 - see slack.

We will bring this is and continue to debug the issue.

@dagar
Copy link
Member

dagar commented May 20, 2022

There's something wrong with the internal IST8310. In both David's board and Vince's test flight log the internal IST8310 X axis is reporting values that are at least an order of magnitude too large.
Screenshot from 2022-05-20 15-47-37

I'm going to implement the IST8310 test procedure in the driver startup and we'll continue debugging.

@dagar dagar merged commit 9d0e572 into master May 20, 2022
@dagar dagar deleted the pr-px4_fmu-v6c branch May 20, 2022 19:49
dagar pushed a commit that referenced this pull request May 27, 2022
lmarzen added a commit to Open-UAS/PX4-Autopilot that referenced this pull request Oct 13, 2022
…PX4-Autopilot:stable (#12)

* px4io: only publish valid input_rc

* bords: omnibus_f4sd move ekf2 from default to new ekf2 board variant

 - temporary solution to flash overflow

* Jenkinsfile-compile: skip px4_sitl_rtps for now

* boards: px4_fmu-v2_rover disable unused drivers to save flash

* sensors: add baro calibration and cleanup

 - sensor_baro.msg use SI (pressure in Pascals)
 - update all barometer drivers to publish directly and remove PX4Barometer helper
 - introduce baro cal (offset) mainly as a mechanism to adjust
relative priority
 - commander: add simple baro cal that sets baro offsets to align with
GPS altitude (if available)
 - create new sensors_status.msg to generalize sensor reporting

* sensors/vehicle_magnetometer: publish sensors_status_mag and other minor updates to stay in sync with air data

* FlightTaskOrbit: don't start Orbit if radius is not in range

* FlightTaskOrbit: increase radius limit

* boards: px4_fmu-v5x_rtps disable unused systemcmds and examples to save flash

* boards: px4_fmu-v2_multicopter disable distance_sensor/tfmini to save flash

* drives/gps: add new sensor_gnsss_relative msg

 - for ublox this corresponds to NAV_RELPOSNED

* uavcannode: publish RelPosHeading (from sensor_gnss_relative)

* simulator: fix conversion from hPa to Pa

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* FlightModeManager: switch to failsafe task if orbit is rejected

* FlightModeManager: don't ack with result failed when parameters are invalid

Command denied is defined as "supported but has invalid parameters"
which matches the case.

* FlightModeManager: refactor flight task switch result condition for vehicle commands

* FlightModeManager: remove needless space at the end of invalid task error string

* FlightTaskOrbit: alert user about exceeded radius (events)

* FlightTaskOrbit: alert user about exceeded radius (mavlink_log)

* fmu-v5: Add support for ICM-42688-P

* spi: get the correct version revision

* fmu-v5: add macro definitions for different version revisions

* mavlink: Use round instead of ceil on BATTERY_STATUS percentage

Co-authored-by: Alex Mikhalev <alex@corvus-robotics.com>

* tunes: Fixed unspecified behaviour

This fixes unspecified behaviour due to evaluation order of args.
It's up to the compiler whether next_number() or next_dots() is executed
first which means that the behaviour is not properly specified.

* tunes: Print warning if there is a tune error

* boards: px4_fmu-v5_stackcheck disable common telemetry modules to save flash

* px_update_git_header:Extract latest release tag

* commander_params: add precision land option for mode switch

* boards: px4_fmu-v5_uavcanv0periph disable modules to save flash

* boards: px4_fmu-v2_fixedwing disable drivers/camera_trigger to save flash

* boards: px4_fmu_v5x_rtps disable common telemetry modules to save flash

* 1011_iris_irlock: require precland (PX4#19431)

* metadata.cmake: enable ethernet parameters

* battery: improve flight time remaining improvements

- introduce BAT_AVRG_CURRENT param that is used for init of average current estimate
- increase filtering of average current estimation
- only update average current filter when armed

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* battery: use mechanism to keep an up to date armed state

* battery: update average current also when no capacity is configured

* holybro/kakuteh7: fix BOARD_FLASH_SIZE

The BL was reporting a flash size of 1703936, whereas it should be 1835008.

* Support for NXP UWB position sensor

uwb_sr150 driver for the sensor, and some
modifications in precision landing to allow
landing on a platform using the UWB system.

* precland: save flash space

* commander: silence GPS no longer validity PX4_WARN

* uavcan: update safety button

updated uavcannode/Publishers/SafetyButton.hpp
tested successfully
make format
revert cannode publishing

* safety and safety button: refactoring PX4#19413

* mathlib: add second order reference model filter with optional rate feedback (PX4#19246)

mathlib: add second order reference model filter with optional rate feedback (PX4#19246)

Reference models can be used as filters which exhibit a particular, chosen (reference) dynamic behavior. This PR implements a simple second order transfer function which can be used as such a reference model, additionally with rate feedback. The system is parameterized by explicitly set natural frequency and damping ratio. Another nice externality is that the output state and rate are kinematically consistent. Forward-euler and bilinear transform discretizations for the state space integration step are available.

* boards: omnibus_f4sd_ekf2 disable frsky telemetry to save flash (and fix build)

 - this isn't great, but our options are limited at the moment and this
can be fixed later once the old mixing system is deleted

* Commander: separate out arm state machine to class

Pure refactoring and just the first step to avoid conflicts on the way.

* ArmStateMachine: port arming_state_names into the class

* ArmStateMachine: port over unit tests to functional gtests

* mavlink: set correct param capability

PX4 supports int32 parameter types by interpreting the 32 bits in
the float field as an int32 field. To signal this behaviour, it should
set the bit which is described as PARAM_ENCODE_BYTEWISE.

PX4 had always handled parameters this way but never actually sent the
capability (which back then was called PARAM_UNION), however, it should
have. This came up recently in the MAVLink devcall when these flags were
discussed. The takeaway was to remove the flags to make it clearer and
to make sure the projects (like PX4) send them out correctly.

* update mavlink submodule to latest

 - update MAV_TYPE VTOL usage for current mavlink

* rc_update: further tighten timing requirements for valid data

 - any real RC data input will be much faster than 3 Hz, so this is an
easy way to minimize bogus decoded data from propagating

* ci: build and deploy kakuteh7

* modeCheck: allow arming in land mode for MAVSDK compatibility

ideally we can remove it again when the workflow is changed to
first changing mode then arming.

* use new safety_button topic for uavcannode Button publishing

* boards/matek/gnss-m9n-f4: IMU orientation update

 - the icm20602 needs to be rolled 180º and yaw 90º for this board.

* boards/matek/gnss-m9n-f4: RM3100 orientation fix

 - the RM3100 needs to be pitched 180º for correction orientation on this board.

* Add I2C retries in INA226 to prevent publishing 0's on a single read failure

* px4io: input_rc only publish new successful decodes

 - previously an invalid decode would continue to be transferred to the FMU (at 50 Hz) and published to the rest of the system as successfully decoded new RC data
 - by only publishing new successful decodes we can more effectively discard invalid data in downstream consumers

* commander: fix enable_failsafe reason (PX4#19391)

 - In this case, no action is configured for datalink lost. Action is configured for RC lost.
 - In case of no data link and no rc failsafe is enabled but reporting a "no_datalink" reason but "no_rc_and_no_datalink" seems more explicit.

* Increase NAV_LOITER_RAD and RTL_LOITER_RAD to 80m each

For many VTOLs/fixed-wing drones a 50m loiter radius is too tight, and
going to 80m is a better and safer default.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* ROMFS: remove duplicate setting of NAV_LOITER_RAD to 80

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* Update submodule mavlink to latest Sun Apr 10 12:39:00 UTC 2022

    - mavlink in PX4/Firmware (a1530591764f0c694560e4bb6ae41c15d3e35c9b): mavlink/mavlink@0133e5d
    - mavlink current upstream: mavlink/mavlink@56a5110
    - Changes: mavlink/mavlink@0133e5d...56a5110

    56a5110d 2022-04-09 Tom Pittenger - Add radius to DO_REPOSITION (PX4#1825)
3b5959bd 2022-04-07 Thomas Debrunner - Option to not reset non-configurable params in preflight storage (PX4#1826)

* ekf2: fix IMU missed perf count when not using multi-EKF

* Tools: add drag fusion tuning script

* boards: px4_fmu-v2_multicopter disable load_mon to save flash

* ekf2: properly reset IMU biases on calibration change (non-multi-EKF)

 - this was working in the multi-EKF case using vehicle_imu, but missing
in sensor_combined

* Update world_magnetic_model to latest Mon Apr 11 11:14:11 UTC 2022 (PX4#19475)

* Update submodule sitl_gazebo to latest Tue Apr 12 12:38:53 UTC 2022

    - sitl_gazebo in PX4/Firmware (bb2ea57): PX4/PX4-SITL_gazebo-classic@25138e8
    - sitl_gazebo current upstream: PX4/PX4-SITL_gazebo-classic@2cf56d0
    - Changes: PX4/PX4-SITL_gazebo-classic@25138e8...2cf56d0

    2cf56d0 2022-03-23 Julian Oes - Revert "models: Add model for standard_vtol_ctrlalloc"
b3ab8de 2022-03-18 JamesAnawati - Update cloudship.sdf.jinja

* Update submodule GPSDrivers to latest Tue Apr 12 12:38:56 UTC 2022

    - GPSDrivers in PX4/Firmware (c04e66a): PX4/PX4-GPSDrivers@ad1094a
    - GPSDrivers current upstream: PX4/PX4-GPSDrivers@ddb1825
    - Changes: PX4/PX4-GPSDrivers@ad1094a...ddb1825

    ddb1825 2022-03-29 Daniel Agar - ubx: print relevent UBX-MON-VER output

Co-authored-by: PX4 BuildBot <bot@px4.io>

* MulticopterPositionControl: remove unused return value parameters_update()

* posix: HRT hrt_lock() sem_wait try again if error returned

* ROMFS: move px4flow start to rc.sensors

* Add ARK CANnode board config

* uORB : Don't automatically include message name as default topic name in uORBTopics source files, to handle case where user doesn't use default messgae name for multi topic definition in .msg file

* navigator: stop handling speed changes via reposition triplet

- the mc and fw controllers are handling the speed changes directly

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* FixedWingPositionControl: handle VEHICLE_CMD_DO_CHANGE_SPEED

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* FlightModeManager: handle MAV_CMD_DO_CHANGE_SPEED

- support setting the cruise speed of the auto flight task via command

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* vehicle_command: added enum for speed types

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* addressed review comments

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* vehicle_command: specify what SPEED_TYPEs are for

* FlightModeManager/FixedwingPositionControl: robustify vehicle command parameter casting

* FlightTask: rename and move setCruisingSpeed() -> overrideCruiseSpeed()

* FlightTaskAuto: refactor _commanded_speed_ts -> _time_last_cruise_speed_override

* ekf: extract range finder noise computation

* ekf: add range finder kinematic consistency check

At each new valid range measurement, the time derivative of the distance
to the ground is computed and compared with the estimated velocity.
The average of a normalized innovation squared statistic check is used
to detect a bias in the derivative of distance measurement,
indicating that the distance measurements are kinematically inconsistent
with the filter.

* ekf: access member variable without getter

* ekf: use same gate for innov and innov sequence monitoring

* ekf: improve rng consistency check

To pass from invalid to valid:
- time hysteresis
- some vertical velocity
- test ratio < 1
- low-passed signed test ratio < 1

To pass from valid to invalid:
- low-passed signed test ratio >= 1

* ekf: requires kinematically consistent range finder data to continue terrain aiding

* ekf: use uint64_t for time variables

* ekf: add logging of range finder consistency check

* ekf: add logging for rng kinematic consistency check

* ekf: run rng consistency check only when not horizontally moving

The check assumes a non-moving terrain height

* ekf: make range finder kin consistency gate tunable by parameter

* ekf rng finder consistency: simplify class member names

* ekf rng kin: increase default gate size

The user needs to tune the range finder noise parameters properly and we
shouldn't need such a small gate

* ekf rng kin: reduce minimum rng variance

* sensors/vehicle_imu: replace coning metric with actual integrator coning correction (averaged)

 - this saves a relatively expensive higih rate cross product and gives
better visibility into what's actually happening internally

* sensors/vehicle_imu: Integrator use 1 microsecond for minimum DT

 - this is a more realistic minimum for the system

* Tools/ecl_ekf: fix vibe_metrics usage (moved to vehicle_imu_status instances)

* Update submodule mavlink to latest Wed Apr 13 12:39:05 UTC 2022

    - mavlink in PX4/Firmware (16fd85d): mavlink/mavlink@56a5110
    - mavlink current upstream: mavlink/mavlink@3b52eac
    - Changes: mavlink/mavlink@56a5110...3b52eac

    3b52eac0 2022-04-13 Beat Küng - add COMPONENT_METADATA, deprecate COMPONENT_INFORMATION (PX4#1823)

* lib/rc: Fix DSM2/DSMX guessing routine and DSM range checking (PX4#18270)

* Add Orangerx test case

Co-authored-by: Chris Seto <chris.seto@bossanova.com>

* dronecan beeper: remove unneded var

* px4io cleanup LED and heater handling

 - most px4_io-v2 boards have a blue LED that breathes for status
 - the pixhawk 2.1 (hex) re-used this blue LED for as an IMU heater (active low), but kept the same board id (so we have to detect at runtime)
 - the new cubepilot boards (yellow, orange) inverted the polarity of this heater pin
 - untangle the mess slightly so that things we know statically (eg cubepilot cubeorange LEDs and heater polarity) are handled at build time.

* param-reset: Add option to reset all configurable params, but not the ones that store vehicle information

* commander/safety: set early safety_button_available

* mavlink: add COMPONENT_METADATA message

And still support the previous message COMPONENT_INFORMATION for now.

* drivers/optical_flow: new PixArt PAA3905 optical flow driver

* boards: px4_fmu-v6x_default disable systemcmds/sd_bench to save flash

* boards: px4_fmu_v5x_rtps disable several modules to save flash

* boards: px4_fmu-v5_uacanv0periph disable systecmds/sd_bench to save flash

* boards: px4_fmu-v2_multicopter disable lightware_laser_serial to save flash

* px4iofirmware: convert most files to c++

* boards: px4_fmu-v5/v5x run default & rtps boards through kconfiglib to cleanup

* boards: px4_fmu-v5_stackcheck disable unused systemcmds to save flash

* small cleanup for  FlightTask::_evaluateDistanceToGround if-else

* output modules simplify locking for mixer reset and load

 - fixes the deadlock in px4io ioctl mixer reset
   - px4io Run() locks (CDev semaphore)
   - mixer load goes through px4io ioctl MIXERIOCRESET which calls MixingOutput::resetMixerThreadSafe()
   - MixingOutput::resetMixerThreadSafe() stores a Command::Type::resetMixer command in an atomic variable, schedules a work queue cycle, then sleep spins until the command is cleared
   - the execution of the cycle eventually calls back into PX4IO::updateOutputs(), which tries to lock (and waits forever)

* mission block: fix incorrectly calculated ccw loiter exit (PX4#19487)

* mission block: fix incorrectly calculated ccw loiter exit

* mission block: update comment on orbit exit location

* mission_block: fix vehicle not exiting loiter after reaching exit heading

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* commander: refactor home position setter

- always try to set local or global home position when possible
- set global home with GNSS position if global pos from EKF isn't
  available
- reset home when significantly moved from home before takeoff (checking
  lpos or gpos or GNSS)
- reset home on takeoff transition
- reset home on mavlink arm command
- remove "home required accuracy" parameters, rely on validity flags

* navigator: home_positionvalid -> global_home_position_valid

This is to make clear that the relevant part of the home position
message for navigator is the global one. Local home position isn't
required as everything is done in global coordinates.
The specific home_alt_valid is used when lat/lon are not used

* geofence: remove unused function parameters

* commander: improve set_in_air_position

- set local home using global pos and global home
- set local home using GNSS pos and global home
- set global home using global ref of local frame and local home

* mavsdk_tests: update MAVSDK dependency

This should fix the CI issue where the test just hangs trying to
connect.

* mc wind: rename MC wind estimor tuning script

* Tools: add baro pressure coefficient tuning script

* EKF: move python tuning tools to EKF module

* Update submodule GPSDrivers to latest Thu Apr 21 12:38:20 UTC 2022

    - GPSDrivers in PX4/Firmware (e9c07fa): PX4/PX4-GPSDrivers@ddb1825
    - GPSDrivers current upstream: PX4/PX4-GPSDrivers@6534b05
    - Changes: PX4/PX4-GPSDrivers@ddb1825...6534b05

    6534b05 2022-04-19 Jonas Perolini - ubx: disable gps heading for in RTK float fix type (PX4#104)

Co-authored-by: PX4 BuildBot <bot@px4.io>

* 13004_quad+_tailsitter - outputs mixed up

* Add gyro and accel range register values to the icm42688p driver.

* px4flow allow delayed background startup

* platforms/nuttx: cdc_acm_check implement mavlink reboot directly

* Mission: don't do anything in set_current_mission_index() when index=current already

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* ROMFS: fix typo in convergence and clair configs

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* FlightTaskAuto: fix Weather Vane during landing

Weather vane should only set a yawrate setpoint, but no yaw setpoint.
Setting it to NAN when WV is active makes sure that whatever _yaw_setpoint
is set previously (e.g. through Waypoint) is not used.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* logger: add default ground truth logging for HITL/SITL

* boards: new Sky-Drones AIRLink board support

* icm20948: disable debug output (_debug_enabled=true)

* Set Tune's Volume for Power-Off in Commander to default volume of tune_control message

* mavlink: shell expand locking (PX4#19308)

 - on some H7 boards (cuav x7pro tested) there's an occasional hard fault when starting the mavlink shell that is no longer reproducible with the slightly expanded locking
 - this is likely just changing the timing (holding the sched lock for longer), but this should be harmless for now until we can identify the root cause

* commander: Add prearm check for flight termination

* mavlink: delete Mavlink instance if early startup fails

* commander: mag calibration tolerate fit failure if sensor disabled

* ekf: robustify bad_acc_vertical check

when the vertical pos or vel innov ratio is above the threshold, the
other one needs to be significant too and not just positive to trigger
the failure

* [AUTO COMMIT] update change indication

* systemcmds/param: set-default should mark parameter active to avoid race conditions

* mc_att_control: only apply quat reset if estimate is newer than setpoint

* boards: add new mRo Control Zero Classic

* boards: add new Diatone Mamba F405 mk2

* boards/diatone/mamba-f405-mk2: fix code style

* boards/mro/ctrl-zero-classic: fix code style

* boards: update bootloaders to latest

* boards: px4_fmu-v2 restore systemcmds/ver needed for board init

* boards/diatone/mamba-f405-mk2: disable modules to save flash

* mc_pos_control: silence invalid setpoint warning when disarmed

* boards: px4_fmu-v6x_default disable common barometers to save flash

* Separate takeoff and landing to individual fixed wing states for FW pos control (PX4#19495)

* apply differential pressure calibration (SENS_DPRES_OFF) centrally

 - remove drv_airspeed.h and ioctls

* differential pressure remove filters from drivers and average in sensors/airspeed

* drivers/differential_pressure: remove lib/drivers/airspeed dependency and cleanup

 - split ms4525_airspeed into separate ms4515 and ms4525 drivers

* boards: cubepilot_cubeorange_test disable examples/fake_gps to save flash

* boards: px4_fmu-v5_uavcanv0periph disable modules to save flash

* drivers/rc_input: RC_INPUT_PROTO parameter minimal implementation (PX4#19539)

Co-authored-by: chris1seto <chris12892@gmail.com>

Co-authored-by: chris1seto <chris12892@gmail.com>

* fix dshot: remove setAllFailsafeValues

Fixes a regression from c1e5e66,
where with static mixers the dshot outputs would go to max instead of 0
in a failsafe case.

* dshot: avoid using pwm failsafe params when dynamic mixing is enabled

* ekf2: optimize KHP computation

Calculating K(HP) takes less operations than (KH)P because K and H are
vectors.

Without considering the sparsity optimization:
- KH (24*24 operations) is then a 24x24 matrix an it takes
24^3 operations to multiply it with P. Total: 14400 op

- HP (24*(24+24-1) operations) is a row vector
and it takes 24 operations to left-multiply it by K. Total:1152 op

* commander: fix incorrect return in set_link_loss_nav_state()

If both local position and altitude were not valid, then both RC loss and
datalink loss would not trigger any failsafe at all, independently from
the configured action.

* Commander: ensure diconnected battery is cleared from bit field

* fw pos ctrl: fix state switching logic for takeoff and landing

* fw pos ctrl: add missing guidance control interval setting to control_manual_position()

* fw pos ctrl: turn back to takeoff point with npfg

* uavcan: use timer 6 by default on stm32f7

* log_writer_file: protect access to _should_run, use px4::atomicbool for _exit_thread

* log_writer_file: fix corner case when mission log is enabled

Normally _should_run for mission is only ever true if _should_run for the
normal log is. There are exceptions though:
- the log buffer fails to allocate
- there was a write failure (e.g. due to SD card removal)
In that situation, the writer would not wait anymore but busy-loop.

* drivers/rc_input: ensure RC inversion is disabled initially and latch RC_INPUT_PROTO conservatively

 - this allows jumping straight to a non-SBUS RC protocol
 - increased the scan time per protocol 300->500 ms, which the newer DSM parser seems to need in some cases.
 - only set RC_INPUT_PROTO if we've had a successful RC lock for > 3 seconds

* Fix uavcan battery causing immediate RTL time remaining low

* output drivers: init SmartLock after exit_and_cleanup

This fixes an invalid memory access when exiting the module:
exit_and_cleanup destroys the object, but lock_guard is destructed after
and accesses the lock.

* .vscode/.gitignore ignore all log files

* Commander: ignore MAV_CMD_REQUEST_MSG

This commit adds the MAV_CMD_REQUEST_MESSAGE to the list of vehicle
commands which are ignored without generating a warning sound.

* HITL: undefined time_remaining_s should be NAN

* ROMFS: disable UAVCAN in HITL

Without this, uavcan creates MixingOutput classes which then create
empty actuator_outputs publications. This then prevents the motor
output in HITL to be forwarded to the simulator via mavlink.

* sensors/vehicle_magnetometer: fix multi_mode check

Signed-off-by: Serhat Aksun <serhat.aksun@maxwell-innovations.com>

* ekf2: use explicit flags instead of bitmask position

This prevents bitmask mismatch when a new flag is inserted

* icm42688p: only check configured registers periodically (as intended)

* commander: lockdown is not termination

We use lockdown to prevent outputs like motors and servos from being
active in HITL simulation. This means that we can't treat the lockdown
flag as a flight_terminated, otherwise we can't arm in HITL at all.

* sitl_gazebo: update submodule

This fixes the issue where HITL doesn't connect over USB.

* ekf2_post-processing: use estimator_status_flags instead of bitmasks

* boards: new px4_fmu-v6c board support (PX4#19544)

* px4_fmu-v6c:Fix mag rotation

* boards: STM32H7 pad to 256 bit - 32 bytes (PX4#19724)

* flash_cache:Flush complete cache line

* Update all H7 Bootloders

* boards: pixhawk 2 cube skip starting low quality l3gd20 gyro to save memory and cpu

 - free memory is getting tight on these older boards (depending on
configuratoin) and the pixhawk 2 cube still has 2 other superior IMUs, so this is just
dropping dead weight

* boards: reduce SPI DMA buffers on older STM32F4 boards

 - on common IMUs like the mpu6000, mpu9250, icm20602, etc each FIFO
sample is only 12 bytes so this is still more than large enough for the
worst case transfer

* update NuttX and apps to latest with sem holder fixes and updated ostest

* boards: NuttX update all boards to preallocated sem holder list

 - CONFIG_SEM_PREALLOCHOLDERS=32
 - CONFIG_SEM_NNESTPRIO=16 (default)

* sensors/vehicle_imu: don't bother checking IMU_GYRO_RATEMAX

* sensors/vehicle_angular_velocity: add IMU_GYRO_RATEMAX constraints

* uavcannode: Fix dronecan baro units

* px4_fmu-v6x:Add Rev 4 Sensors

* px4_fmu-v5X:Added Holybro mini base board

* uc_stm32h7_can:Correct initalization of the mumber of interfaces

   H7 Only supports 2 not 3 CAN interfaces.

   CanInitHelper passes in in the run time configuration of
   the number of interfaces. The code was ignoring these!

* px4_fmu-v6X:Added Holybro mini base board

* differential_pressure/sdp3x: sdp3x_main fix 'keep running' regression

* uavcan: GNSS optionally publish RTCMStream or MovingBaselineData

* ekf2: do not run rng kinematic consistency check for fixed-wings

As they are always moving horizontally, the check doesn't make sense
for fixed-wings.
Also don't run the check while on ground to prevent getting a failed
check during pre-takeoff manipulation.

* gps_inject_data: fixed integer overflow
- array length of data was increased without changing the data type of
the variable holding the length

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* adis16470: fix accel and gyro scaling

* drivers/imu/invensense/icm42670p: cleanup and small fixes

* icm42670p run at full speed

* px4_fmu-v6x:HB Mini add Ver 3, Ver 4 init

* standard: fixed pusher assist in hover

- in hover mode the pusher assist is already set in update_mc_state()

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* boards: V1.13.0 ARKV6X Backport (PX4#20253)

* fmu-v6c: internal baro and mag on external bus

This swaps the internal baro and mag back to the bus which is both
internal an external but configured as external for this case.

* px4_fmu-v6c: Move I2C 4 back to External

This is a revert of the revert.
This reverts commit 1080855.

* [DO NOT MERGE] px4_i2c_device_external hacks

* Add PX4 vision v1.5 Airframe

* boards: save some flash on CubeOrange test config

* Add BMP390 to BMP388 driver

* boards/platform: remove confusing override

This removes the odd px4_i2c_bus_external override which was confusing
me and lead to odd and inconsistent results.

The function is now only available with an int as the argument.

* cuav_x7pro: save flash on test target

* Add Holybro Pixhawk Pi CM4 Baseboard Support

* Fix Error on board_config.h Define on FMUv5X & FMUv6X

* Fix Error on manifest.c

* Correct BOARD_NUM_SPI_CFG_HW_VERSIONS at board_config.h

* update v5x rc.board_sensors

add V5X004002

* update fmuv5x rc.board_sensors with V5X004000

* update fmu-v6x rc.board_sensors, add V6X004003

* platforms: decrease flash usage by type for bus id

My assumption is that the bus are numbered < 127.
This saves about 100 bytes of flash.

* fmu-v5x: disable rev0 for HB Mini and CM4 base

As I understand it, only Rev 1 and Rev 2 were shipped by HB, and likely
to be used for the Mini and CM4.

* fmu-v6: disable Rev 0, Rev 1 for HB Mini, and CM4

As I understand it, only Rev 3 and Rev 4 were shipped by HB for Mini and
CM4, and are likely to be used for it.

It would be nice to have all combinations but it requires quite some
flash in the current implementation.

* fmu-v5x: alias for duplicates, remove commented

- Removed commented out config data.
- hw_mft_list_v0540 was the same as hw_mft_list_v0500

* fmu-v6x: alias, add VX43

- alias from hw_mft_list_v0650 to hw_mft_list_v0600 as it is the same
- add V6X50 again

* fmu-v3: make optional sensor startup quiet

This fixes the errors showing up at startup for me with a Black Cube.

* fmu-v5x: support for mini base board

This was forgotton with all the merges and shuffling previously.

* libuavcan: update submodule

This fixes a Python 3.10 issue for me.

* uavcan: fix RTCM corrections publication

Before this fix, this function would stall and somehow never return.

* Mag: fix estimated bias save to calibration

Clear the calibration at the end only otherwise everything gets erased
at the end of the first iteration of the outer loop

* Fix ARKV6X control allocator with base boards

* ms5611: ignore reading 0

This prevents publishing a negative pressure which leads to a NAN
altitude estimate further down the line.

* vehicle_imu: only reset raw accel/gyro Welford mean periodically

 - vehicle_imu_status can publish immediately on any measured sample
rate change or sensor error increment, but the windowed mean/variance
shouldn't necessarily reset that often

* welford mean: convert to matrix only template

* welford mean: protect against negative variances

* resolved merge conflicts

* resolved merge conflicts

* updated sitl_gazebo submodule

* updated sitl_gazebo submodule

* removed cudepilot files that were removed from PX4

* added whitespace to match PX4:stable

* updated sitl_gazebo submodule tto master

Signed-off-by: RomanBapst <bapstroman@gmail.com>
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Signed-off-by: Serhat Aksun <serhat.aksun@maxwell-innovations.com>
Co-authored-by: Daniel Agar <daniel@agar.ca>
Co-authored-by: Matthias Grob <maetugr@gmail.com>
Co-authored-by: RomanBapst <bapstroman@gmail.com>
Co-authored-by: CUAVmengxiao <mengxiao@cuav.net>
Co-authored-by: Kabir Mohammed <kabir@corvus-robotics.com>
Co-authored-by: Alex Mikhalev <alex@corvus-robotics.com>
Co-authored-by: Alex Mikhalev <alexmikhalevalex@gmail.com>
Co-authored-by: David Sidrane <David.Sidrane@NscDg.com>
Co-authored-by: stmoon <munhoney@gmail.com>
Co-authored-by: alessandro <3762382+potaito@users.noreply.github.com>
Co-authored-by: Beat Küng <beat-kueng@gmx.net>
Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Hovergames <loic.fernau@googlemail.com>
Co-authored-by: Alessandro Simovic <alessandro@auterion.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: Igor Misic <igy1000mb@gmail.com>
Co-authored-by: Thomas Stastny <thomas.stastny@auterion.com>
Co-authored-by: Julian Oes <julian@oes.ch>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>
Co-authored-by: Ryan Johnston <31726584+ryanjAA@users.noreply.github.com>
Co-authored-by: alexklimaj <alex@arkelectron.com>
Co-authored-by: Nicolas MARTIN <59083163+NicolasM0@users.noreply.github.com>
Co-authored-by: PX4 BuildBot <bot@px4.io>
Co-authored-by: bresch <brescianimathieu@gmail.com>
Co-authored-by: Junwoo Hwang <junwoo@auterion.com>
Co-authored-by: chris1seto <chris12892@gmail.com>
Co-authored-by: Chris Seto <chris.seto@bossanova.com>
Co-authored-by: Thomas Debrunner <thomas.debrunner@auterion.com>
Co-authored-by: bazooka joe <bazookajoe1900@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: mcsauder <mcsauder@gmail.com>
Co-authored-by: Kirill Shilov <aviaks.kirill@gmail.com>
Co-authored-by: bresch <bresch@users.noreply.github.com>
Co-authored-by: achim <lumserei@web.de>
Co-authored-by: JaeyoungLim <jalim@ethz.ch>
Co-authored-by: Nico van Duijn <nico@auterion.com>
Co-authored-by: Nicolas MARTIN <nicolas1.martin1@gmail.com>
Co-authored-by: Serhat Aksun <serhat.aksun@maxwell-innovations.com>
Co-authored-by: vincentpoont2 <vincentpoont2@gmail.com>
lmarzen added a commit to Open-UAS/PX4-Autopilot that referenced this pull request Jan 24, 2023
* Jenkinsfile-compile: skip px4_sitl_rtps for now

* boards: px4_fmu-v2_rover disable unused drivers to save flash

* sensors: add baro calibration and cleanup

 - sensor_baro.msg use SI (pressure in Pascals)
 - update all barometer drivers to publish directly and remove PX4Barometer helper
 - introduce baro cal (offset) mainly as a mechanism to adjust
relative priority
 - commander: add simple baro cal that sets baro offsets to align with
GPS altitude (if available)
 - create new sensors_status.msg to generalize sensor reporting

* sensors/vehicle_magnetometer: publish sensors_status_mag and other minor updates to stay in sync with air data

* FlightTaskOrbit: don't start Orbit if radius is not in range

* FlightTaskOrbit: increase radius limit

* boards: px4_fmu-v5x_rtps disable unused systemcmds and examples to save flash

* boards: px4_fmu-v2_multicopter disable distance_sensor/tfmini to save flash

* drives/gps: add new sensor_gnsss_relative msg

 - for ublox this corresponds to NAV_RELPOSNED

* uavcannode: publish RelPosHeading (from sensor_gnss_relative)

* simulator: fix conversion from hPa to Pa

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* FlightModeManager: switch to failsafe task if orbit is rejected

* FlightModeManager: don't ack with result failed when parameters are invalid

Command denied is defined as "supported but has invalid parameters"
which matches the case.

* FlightModeManager: refactor flight task switch result condition for vehicle commands

* FlightModeManager: remove needless space at the end of invalid task error string

* FlightTaskOrbit: alert user about exceeded radius (events)

* FlightTaskOrbit: alert user about exceeded radius (mavlink_log)

* fmu-v5: Add support for ICM-42688-P

* spi: get the correct version revision

* fmu-v5: add macro definitions for different version revisions

* mavlink: Use round instead of ceil on BATTERY_STATUS percentage

Co-authored-by: Alex Mikhalev <alex@corvus-robotics.com>

* tunes: Fixed unspecified behaviour

This fixes unspecified behaviour due to evaluation order of args.
It's up to the compiler whether next_number() or next_dots() is executed
first which means that the behaviour is not properly specified.

* tunes: Print warning if there is a tune error

* boards: px4_fmu-v5_stackcheck disable common telemetry modules to save flash

* px_update_git_header:Extract latest release tag

* commander_params: add precision land option for mode switch

* boards: px4_fmu-v5_uavcanv0periph disable modules to save flash

* boards: px4_fmu-v2_fixedwing disable drivers/camera_trigger to save flash

* boards: px4_fmu_v5x_rtps disable common telemetry modules to save flash

* 1011_iris_irlock: require precland (PX4#19431)

* metadata.cmake: enable ethernet parameters

* battery: improve flight time remaining improvements

- introduce BAT_AVRG_CURRENT param that is used for init of average current estimate
- increase filtering of average current estimation
- only update average current filter when armed

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* battery: use mechanism to keep an up to date armed state

* battery: update average current also when no capacity is configured

* holybro/kakuteh7: fix BOARD_FLASH_SIZE

The BL was reporting a flash size of 1703936, whereas it should be 1835008.

* Support for NXP UWB position sensor

uwb_sr150 driver for the sensor, and some
modifications in precision landing to allow
landing on a platform using the UWB system.

* precland: save flash space

* commander: silence GPS no longer validity PX4_WARN

* uavcan: update safety button

updated uavcannode/Publishers/SafetyButton.hpp
tested successfully
make format
revert cannode publishing

* safety and safety button: refactoring PX4#19413

* mathlib: add second order reference model filter with optional rate feedback (PX4#19246)

mathlib: add second order reference model filter with optional rate feedback (PX4#19246)

Reference models can be used as filters which exhibit a particular, chosen (reference) dynamic behavior. This PR implements a simple second order transfer function which can be used as such a reference model, additionally with rate feedback. The system is parameterized by explicitly set natural frequency and damping ratio. Another nice externality is that the output state and rate are kinematically consistent. Forward-euler and bilinear transform discretizations for the state space integration step are available.

* boards: omnibus_f4sd_ekf2 disable frsky telemetry to save flash (and fix build)

 - this isn't great, but our options are limited at the moment and this
can be fixed later once the old mixing system is deleted

* Commander: separate out arm state machine to class

Pure refactoring and just the first step to avoid conflicts on the way.

* ArmStateMachine: port arming_state_names into the class

* ArmStateMachine: port over unit tests to functional gtests

* mavlink: set correct param capability

PX4 supports int32 parameter types by interpreting the 32 bits in
the float field as an int32 field. To signal this behaviour, it should
set the bit which is described as PARAM_ENCODE_BYTEWISE.

PX4 had always handled parameters this way but never actually sent the
capability (which back then was called PARAM_UNION), however, it should
have. This came up recently in the MAVLink devcall when these flags were
discussed. The takeaway was to remove the flags to make it clearer and
to make sure the projects (like PX4) send them out correctly.

* update mavlink submodule to latest

 - update MAV_TYPE VTOL usage for current mavlink

* rc_update: further tighten timing requirements for valid data

 - any real RC data input will be much faster than 3 Hz, so this is an
easy way to minimize bogus decoded data from propagating

* ci: build and deploy kakuteh7

* modeCheck: allow arming in land mode for MAVSDK compatibility

ideally we can remove it again when the workflow is changed to
first changing mode then arming.

* use new safety_button topic for uavcannode Button publishing

* boards/matek/gnss-m9n-f4: IMU orientation update

 - the icm20602 needs to be rolled 180º and yaw 90º for this board.

* boards/matek/gnss-m9n-f4: RM3100 orientation fix

 - the RM3100 needs to be pitched 180º for correction orientation on this board.

* Add I2C retries in INA226 to prevent publishing 0's on a single read failure

* px4io: input_rc only publish new successful decodes

 - previously an invalid decode would continue to be transferred to the FMU (at 50 Hz) and published to the rest of the system as successfully decoded new RC data
 - by only publishing new successful decodes we can more effectively discard invalid data in downstream consumers

* commander: fix enable_failsafe reason (PX4#19391)

 - In this case, no action is configured for datalink lost. Action is configured for RC lost.
 - In case of no data link and no rc failsafe is enabled but reporting a "no_datalink" reason but "no_rc_and_no_datalink" seems more explicit.

* Increase NAV_LOITER_RAD and RTL_LOITER_RAD to 80m each

For many VTOLs/fixed-wing drones a 50m loiter radius is too tight, and
going to 80m is a better and safer default.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* ROMFS: remove duplicate setting of NAV_LOITER_RAD to 80

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* Update submodule mavlink to latest Sun Apr 10 12:39:00 UTC 2022

    - mavlink in PX4/Firmware (a1530591764f0c694560e4bb6ae41c15d3e35c9b): mavlink/mavlink@0133e5d
    - mavlink current upstream: mavlink/mavlink@56a5110
    - Changes: mavlink/mavlink@0133e5d...56a5110

    56a5110d 2022-04-09 Tom Pittenger - Add radius to DO_REPOSITION (PX4#1825)
3b5959bd 2022-04-07 Thomas Debrunner - Option to not reset non-configurable params in preflight storage (PX4#1826)

* ekf2: fix IMU missed perf count when not using multi-EKF

* Tools: add drag fusion tuning script

* boards: px4_fmu-v2_multicopter disable load_mon to save flash

* ekf2: properly reset IMU biases on calibration change (non-multi-EKF)

 - this was working in the multi-EKF case using vehicle_imu, but missing
in sensor_combined

* Update world_magnetic_model to latest Mon Apr 11 11:14:11 UTC 2022 (PX4#19475)

* Update submodule sitl_gazebo to latest Tue Apr 12 12:38:53 UTC 2022

    - sitl_gazebo in PX4/Firmware (bb2ea57): PX4/PX4-SITL_gazebo-classic@25138e8
    - sitl_gazebo current upstream: PX4/PX4-SITL_gazebo-classic@2cf56d0
    - Changes: PX4/PX4-SITL_gazebo-classic@25138e8...2cf56d0

    2cf56d0 2022-03-23 Julian Oes - Revert "models: Add model for standard_vtol_ctrlalloc"
b3ab8de 2022-03-18 JamesAnawati - Update cloudship.sdf.jinja

* Update submodule GPSDrivers to latest Tue Apr 12 12:38:56 UTC 2022

    - GPSDrivers in PX4/Firmware (c04e66a): PX4/PX4-GPSDrivers@ad1094a
    - GPSDrivers current upstream: PX4/PX4-GPSDrivers@ddb1825
    - Changes: PX4/PX4-GPSDrivers@ad1094a...ddb1825

    ddb1825 2022-03-29 Daniel Agar - ubx: print relevent UBX-MON-VER output

Co-authored-by: PX4 BuildBot <bot@px4.io>

* MulticopterPositionControl: remove unused return value parameters_update()

* posix: HRT hrt_lock() sem_wait try again if error returned

* ROMFS: move px4flow start to rc.sensors

* Add ARK CANnode board config

* uORB : Don't automatically include message name as default topic name in uORBTopics source files, to handle case where user doesn't use default messgae name for multi topic definition in .msg file

* navigator: stop handling speed changes via reposition triplet

- the mc and fw controllers are handling the speed changes directly

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* FixedWingPositionControl: handle VEHICLE_CMD_DO_CHANGE_SPEED

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* FlightModeManager: handle MAV_CMD_DO_CHANGE_SPEED

- support setting the cruise speed of the auto flight task via command

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* vehicle_command: added enum for speed types

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* addressed review comments

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* vehicle_command: specify what SPEED_TYPEs are for

* FlightModeManager/FixedwingPositionControl: robustify vehicle command parameter casting

* FlightTask: rename and move setCruisingSpeed() -> overrideCruiseSpeed()

* FlightTaskAuto: refactor _commanded_speed_ts -> _time_last_cruise_speed_override

* ekf: extract range finder noise computation

* ekf: add range finder kinematic consistency check

At each new valid range measurement, the time derivative of the distance
to the ground is computed and compared with the estimated velocity.
The average of a normalized innovation squared statistic check is used
to detect a bias in the derivative of distance measurement,
indicating that the distance measurements are kinematically inconsistent
with the filter.

* ekf: access member variable without getter

* ekf: use same gate for innov and innov sequence monitoring

* ekf: improve rng consistency check

To pass from invalid to valid:
- time hysteresis
- some vertical velocity
- test ratio < 1
- low-passed signed test ratio < 1

To pass from valid to invalid:
- low-passed signed test ratio >= 1

* ekf: requires kinematically consistent range finder data to continue terrain aiding

* ekf: use uint64_t for time variables

* ekf: add logging of range finder consistency check

* ekf: add logging for rng kinematic consistency check

* ekf: run rng consistency check only when not horizontally moving

The check assumes a non-moving terrain height

* ekf: make range finder kin consistency gate tunable by parameter

* ekf rng finder consistency: simplify class member names

* ekf rng kin: increase default gate size

The user needs to tune the range finder noise parameters properly and we
shouldn't need such a small gate

* ekf rng kin: reduce minimum rng variance

* sensors/vehicle_imu: replace coning metric with actual integrator coning correction (averaged)

 - this saves a relatively expensive higih rate cross product and gives
better visibility into what's actually happening internally

* sensors/vehicle_imu: Integrator use 1 microsecond for minimum DT

 - this is a more realistic minimum for the system

* Tools/ecl_ekf: fix vibe_metrics usage (moved to vehicle_imu_status instances)

* Update submodule mavlink to latest Wed Apr 13 12:39:05 UTC 2022

    - mavlink in PX4/Firmware (16fd85d): mavlink/mavlink@56a5110
    - mavlink current upstream: mavlink/mavlink@3b52eac
    - Changes: mavlink/mavlink@56a5110...3b52eac

    3b52eac0 2022-04-13 Beat Küng - add COMPONENT_METADATA, deprecate COMPONENT_INFORMATION (PX4#1823)

* lib/rc: Fix DSM2/DSMX guessing routine and DSM range checking (PX4#18270)

* Add Orangerx test case

Co-authored-by: Chris Seto <chris.seto@bossanova.com>

* dronecan beeper: remove unneded var

* px4io cleanup LED and heater handling

 - most px4_io-v2 boards have a blue LED that breathes for status
 - the pixhawk 2.1 (hex) re-used this blue LED for as an IMU heater (active low), but kept the same board id (so we have to detect at runtime)
 - the new cubepilot boards (yellow, orange) inverted the polarity of this heater pin
 - untangle the mess slightly so that things we know statically (eg cubepilot cubeorange LEDs and heater polarity) are handled at build time.

* param-reset: Add option to reset all configurable params, but not the ones that store vehicle information

* commander/safety: set early safety_button_available

* mavlink: add COMPONENT_METADATA message

And still support the previous message COMPONENT_INFORMATION for now.

* drivers/optical_flow: new PixArt PAA3905 optical flow driver

* boards: px4_fmu-v6x_default disable systemcmds/sd_bench to save flash

* boards: px4_fmu_v5x_rtps disable several modules to save flash

* boards: px4_fmu-v5_uacanv0periph disable systecmds/sd_bench to save flash

* boards: px4_fmu-v2_multicopter disable lightware_laser_serial to save flash

* px4iofirmware: convert most files to c++

* boards: px4_fmu-v5/v5x run default & rtps boards through kconfiglib to cleanup

* boards: px4_fmu-v5_stackcheck disable unused systemcmds to save flash

* small cleanup for  FlightTask::_evaluateDistanceToGround if-else

* output modules simplify locking for mixer reset and load

 - fixes the deadlock in px4io ioctl mixer reset
   - px4io Run() locks (CDev semaphore)
   - mixer load goes through px4io ioctl MIXERIOCRESET which calls MixingOutput::resetMixerThreadSafe()
   - MixingOutput::resetMixerThreadSafe() stores a Command::Type::resetMixer command in an atomic variable, schedules a work queue cycle, then sleep spins until the command is cleared
   - the execution of the cycle eventually calls back into PX4IO::updateOutputs(), which tries to lock (and waits forever)

* mission block: fix incorrectly calculated ccw loiter exit (PX4#19487)

* mission block: fix incorrectly calculated ccw loiter exit

* mission block: update comment on orbit exit location

* mission_block: fix vehicle not exiting loiter after reaching exit heading

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* commander: refactor home position setter

- always try to set local or global home position when possible
- set global home with GNSS position if global pos from EKF isn't
  available
- reset home when significantly moved from home before takeoff (checking
  lpos or gpos or GNSS)
- reset home on takeoff transition
- reset home on mavlink arm command
- remove "home required accuracy" parameters, rely on validity flags

* navigator: home_positionvalid -> global_home_position_valid

This is to make clear that the relevant part of the home position
message for navigator is the global one. Local home position isn't
required as everything is done in global coordinates.
The specific home_alt_valid is used when lat/lon are not used

* geofence: remove unused function parameters

* commander: improve set_in_air_position

- set local home using global pos and global home
- set local home using GNSS pos and global home
- set global home using global ref of local frame and local home

* mavsdk_tests: update MAVSDK dependency

This should fix the CI issue where the test just hangs trying to
connect.

* mc wind: rename MC wind estimor tuning script

* Tools: add baro pressure coefficient tuning script

* EKF: move python tuning tools to EKF module

* Update submodule GPSDrivers to latest Thu Apr 21 12:38:20 UTC 2022

    - GPSDrivers in PX4/Firmware (e9c07fa): PX4/PX4-GPSDrivers@ddb1825
    - GPSDrivers current upstream: PX4/PX4-GPSDrivers@6534b05
    - Changes: PX4/PX4-GPSDrivers@ddb1825...6534b05

    6534b05 2022-04-19 Jonas Perolini - ubx: disable gps heading for in RTK float fix type (PX4#104)

Co-authored-by: PX4 BuildBot <bot@px4.io>

* 13004_quad+_tailsitter - outputs mixed up

* Add gyro and accel range register values to the icm42688p driver.

* px4flow allow delayed background startup

* platforms/nuttx: cdc_acm_check implement mavlink reboot directly

* Mission: don't do anything in set_current_mission_index() when index=current already

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* ROMFS: fix typo in convergence and clair configs

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* FlightTaskAuto: fix Weather Vane during landing

Weather vane should only set a yawrate setpoint, but no yaw setpoint.
Setting it to NAN when WV is active makes sure that whatever _yaw_setpoint
is set previously (e.g. through Waypoint) is not used.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* logger: add default ground truth logging for HITL/SITL

* boards: new Sky-Drones AIRLink board support

* icm20948: disable debug output (_debug_enabled=true)

* Set Tune's Volume for Power-Off in Commander to default volume of tune_control message

* mavlink: shell expand locking (PX4#19308)

 - on some H7 boards (cuav x7pro tested) there's an occasional hard fault when starting the mavlink shell that is no longer reproducible with the slightly expanded locking
 - this is likely just changing the timing (holding the sched lock for longer), but this should be harmless for now until we can identify the root cause

* commander: Add prearm check for flight termination

* mavlink: delete Mavlink instance if early startup fails

* commander: mag calibration tolerate fit failure if sensor disabled

* ekf: robustify bad_acc_vertical check

when the vertical pos or vel innov ratio is above the threshold, the
other one needs to be significant too and not just positive to trigger
the failure

* [AUTO COMMIT] update change indication

* systemcmds/param: set-default should mark parameter active to avoid race conditions

* mc_att_control: only apply quat reset if estimate is newer than setpoint

* boards: add new mRo Control Zero Classic

* boards: add new Diatone Mamba F405 mk2

* boards/diatone/mamba-f405-mk2: fix code style

* boards/mro/ctrl-zero-classic: fix code style

* boards: update bootloaders to latest

* boards: px4_fmu-v2 restore systemcmds/ver needed for board init

* boards/diatone/mamba-f405-mk2: disable modules to save flash

* mc_pos_control: silence invalid setpoint warning when disarmed

* boards: px4_fmu-v6x_default disable common barometers to save flash

* Separate takeoff and landing to individual fixed wing states for FW pos control (PX4#19495)

* apply differential pressure calibration (SENS_DPRES_OFF) centrally

 - remove drv_airspeed.h and ioctls

* differential pressure remove filters from drivers and average in sensors/airspeed

* drivers/differential_pressure: remove lib/drivers/airspeed dependency and cleanup

 - split ms4525_airspeed into separate ms4515 and ms4525 drivers

* boards: cubepilot_cubeorange_test disable examples/fake_gps to save flash

* boards: px4_fmu-v5_uavcanv0periph disable modules to save flash

* drivers/rc_input: RC_INPUT_PROTO parameter minimal implementation (PX4#19539)

Co-authored-by: chris1seto <chris12892@gmail.com>

Co-authored-by: chris1seto <chris12892@gmail.com>

* fix dshot: remove setAllFailsafeValues

Fixes a regression from c1e5e66,
where with static mixers the dshot outputs would go to max instead of 0
in a failsafe case.

* dshot: avoid using pwm failsafe params when dynamic mixing is enabled

* ekf2: optimize KHP computation

Calculating K(HP) takes less operations than (KH)P because K and H are
vectors.

Without considering the sparsity optimization:
- KH (24*24 operations) is then a 24x24 matrix an it takes
24^3 operations to multiply it with P. Total: 14400 op

- HP (24*(24+24-1) operations) is a row vector
and it takes 24 operations to left-multiply it by K. Total:1152 op

* commander: fix incorrect return in set_link_loss_nav_state()

If both local position and altitude were not valid, then both RC loss and
datalink loss would not trigger any failsafe at all, independently from
the configured action.

* Commander: ensure diconnected battery is cleared from bit field

* fw pos ctrl: fix state switching logic for takeoff and landing

* fw pos ctrl: add missing guidance control interval setting to control_manual_position()

* fw pos ctrl: turn back to takeoff point with npfg

* uavcan: use timer 6 by default on stm32f7

* log_writer_file: protect access to _should_run, use px4::atomicbool for _exit_thread

* log_writer_file: fix corner case when mission log is enabled

Normally _should_run for mission is only ever true if _should_run for the
normal log is. There are exceptions though:
- the log buffer fails to allocate
- there was a write failure (e.g. due to SD card removal)
In that situation, the writer would not wait anymore but busy-loop.

* drivers/rc_input: ensure RC inversion is disabled initially and latch RC_INPUT_PROTO conservatively

 - this allows jumping straight to a non-SBUS RC protocol
 - increased the scan time per protocol 300->500 ms, which the newer DSM parser seems to need in some cases.
 - only set RC_INPUT_PROTO if we've had a successful RC lock for > 3 seconds

* Fix uavcan battery causing immediate RTL time remaining low

* output drivers: init SmartLock after exit_and_cleanup

This fixes an invalid memory access when exiting the module:
exit_and_cleanup destroys the object, but lock_guard is destructed after
and accesses the lock.

* .vscode/.gitignore ignore all log files

* Commander: ignore MAV_CMD_REQUEST_MSG

This commit adds the MAV_CMD_REQUEST_MESSAGE to the list of vehicle
commands which are ignored without generating a warning sound.

* HITL: undefined time_remaining_s should be NAN

* ROMFS: disable UAVCAN in HITL

Without this, uavcan creates MixingOutput classes which then create
empty actuator_outputs publications. This then prevents the motor
output in HITL to be forwarded to the simulator via mavlink.

* sensors/vehicle_magnetometer: fix multi_mode check

Signed-off-by: Serhat Aksun <serhat.aksun@maxwell-innovations.com>

* ekf2: use explicit flags instead of bitmask position

This prevents bitmask mismatch when a new flag is inserted

* icm42688p: only check configured registers periodically (as intended)

* commander: lockdown is not termination

We use lockdown to prevent outputs like motors and servos from being
active in HITL simulation. This means that we can't treat the lockdown
flag as a flight_terminated, otherwise we can't arm in HITL at all.

* sitl_gazebo: update submodule

This fixes the issue where HITL doesn't connect over USB.

* ekf2_post-processing: use estimator_status_flags instead of bitmasks

* boards: new px4_fmu-v6c board support (PX4#19544)

* px4_fmu-v6c:Fix mag rotation

* boards: STM32H7 pad to 256 bit - 32 bytes (PX4#19724)

* flash_cache:Flush complete cache line

* Update all H7 Bootloders

* boards: pixhawk 2 cube skip starting low quality l3gd20 gyro to save memory and cpu

 - free memory is getting tight on these older boards (depending on
configuratoin) and the pixhawk 2 cube still has 2 other superior IMUs, so this is just
dropping dead weight

* boards: reduce SPI DMA buffers on older STM32F4 boards

 - on common IMUs like the mpu6000, mpu9250, icm20602, etc each FIFO
sample is only 12 bytes so this is still more than large enough for the
worst case transfer

* update NuttX and apps to latest with sem holder fixes and updated ostest

* boards: NuttX update all boards to preallocated sem holder list

 - CONFIG_SEM_PREALLOCHOLDERS=32
 - CONFIG_SEM_NNESTPRIO=16 (default)

* sensors/vehicle_imu: don't bother checking IMU_GYRO_RATEMAX

* sensors/vehicle_angular_velocity: add IMU_GYRO_RATEMAX constraints

* uavcannode: Fix dronecan baro units

* px4_fmu-v6x:Add Rev 4 Sensors

* px4_fmu-v5X:Added Holybro mini base board

* uc_stm32h7_can:Correct initalization of the mumber of interfaces

   H7 Only supports 2 not 3 CAN interfaces.

   CanInitHelper passes in in the run time configuration of
   the number of interfaces. The code was ignoring these!

* px4_fmu-v6X:Added Holybro mini base board

* differential_pressure/sdp3x: sdp3x_main fix 'keep running' regression

* uavcan: GNSS optionally publish RTCMStream or MovingBaselineData

* ekf2: do not run rng kinematic consistency check for fixed-wings

As they are always moving horizontally, the check doesn't make sense
for fixed-wings.
Also don't run the check while on ground to prevent getting a failed
check during pre-takeoff manipulation.

* gps_inject_data: fixed integer overflow
- array length of data was increased without changing the data type of
the variable holding the length

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* adis16470: fix accel and gyro scaling

* drivers/imu/invensense/icm42670p: cleanup and small fixes

* icm42670p run at full speed

* px4_fmu-v6x:HB Mini add Ver 3, Ver 4 init

* standard: fixed pusher assist in hover

- in hover mode the pusher assist is already set in update_mc_state()

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* boards: V1.13.0 ARKV6X Backport (PX4#20253)

* fmu-v6c: internal baro and mag on external bus

This swaps the internal baro and mag back to the bus which is both
internal an external but configured as external for this case.

* px4_fmu-v6c: Move I2C 4 back to External

This is a revert of the revert.
This reverts commit 1080855.

* [DO NOT MERGE] px4_i2c_device_external hacks

* Add PX4 vision v1.5 Airframe

* boards: save some flash on CubeOrange test config

* Add BMP390 to BMP388 driver

* boards/platform: remove confusing override

This removes the odd px4_i2c_bus_external override which was confusing
me and lead to odd and inconsistent results.

The function is now only available with an int as the argument.

* cuav_x7pro: save flash on test target

* Add Holybro Pixhawk Pi CM4 Baseboard Support

* Fix Error on board_config.h Define on FMUv5X & FMUv6X

* Fix Error on manifest.c

* Correct BOARD_NUM_SPI_CFG_HW_VERSIONS at board_config.h

* update v5x rc.board_sensors

add V5X004002

* update fmuv5x rc.board_sensors with V5X004000

* update fmu-v6x rc.board_sensors, add V6X004003

* platforms: decrease flash usage by type for bus id

My assumption is that the bus are numbered < 127.
This saves about 100 bytes of flash.

* fmu-v5x: disable rev0 for HB Mini and CM4 base

As I understand it, only Rev 1 and Rev 2 were shipped by HB, and likely
to be used for the Mini and CM4.

* fmu-v6: disable Rev 0, Rev 1 for HB Mini, and CM4

As I understand it, only Rev 3 and Rev 4 were shipped by HB for Mini and
CM4, and are likely to be used for it.

It would be nice to have all combinations but it requires quite some
flash in the current implementation.

* fmu-v5x: alias for duplicates, remove commented

- Removed commented out config data.
- hw_mft_list_v0540 was the same as hw_mft_list_v0500

* fmu-v6x: alias, add VX43

- alias from hw_mft_list_v0650 to hw_mft_list_v0600 as it is the same
- add V6X50 again

* fmu-v3: make optional sensor startup quiet

This fixes the errors showing up at startup for me with a Black Cube.

* fmu-v5x: support for mini base board

This was forgotton with all the merges and shuffling previously.

* libuavcan: update submodule

This fixes a Python 3.10 issue for me.

* uavcan: fix RTCM corrections publication

Before this fix, this function would stall and somehow never return.

* Mag: fix estimated bias save to calibration

Clear the calibration at the end only otherwise everything gets erased
at the end of the first iteration of the outer loop

* Fix ARKV6X control allocator with base boards

* ms5611: ignore reading 0

This prevents publishing a negative pressure which leads to a NAN
altitude estimate further down the line.

* vehicle_imu: only reset raw accel/gyro Welford mean periodically

 - vehicle_imu_status can publish immediately on any measured sample
rate change or sensor error increment, but the windowed mean/variance
shouldn't necessarily reset that often

* welford mean: convert to matrix only template

* welford mean: protect against negative variances

* Navigator: initialize _mission_item for all navigation modes in Navigator::Navigator()

This fixes the issue where the init happended in the initializer list, at which point
the params were not yet initialized and thus resulted in random values for the init
values of _mission_item.loiter_radius and .acceptance_radius.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* Holybro PX4Vision: Don't use IO

* px4_fmu-v6:Add Revision 1 to manifest to note I2C4 is only internal

* vehicle_magnetometer: fix standalone mag bias est factored into in flight mag cal

 - preflight mag bias estimate is in the vehicle body frame and removed from the raw mag data after it's rotated, calibrated, etc
 - in flight mag bias (from ekf2) is in the vehicle body frame, but stored as a sensor frame offset immediately

* boards: px4_fmu-v6x_default include systemcmds/gpio

* mission_block: minimal acceptance radius of 1mm

to avoid float rounding errors leading to tiny acceptance radii
getting considered

* mission_block: explicitly (re)set the acceptance radius to default for takeoff items

otherwise a previously adjusted or uninitialized radius from the last flight
can cause problems during the new takeoff

* ekf2: do not fuse ZVU if other velocity source is active

* fmu-v2: make optional sensor startup quiet

Signed-off-by: Julian Oes <julian@oes.ch>

Signed-off-by: RomanBapst <bapstroman@gmail.com>
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Signed-off-by: Serhat Aksun <serhat.aksun@maxwell-innovations.com>
Signed-off-by: Julian Oes <julian@oes.ch>
Co-authored-by: Daniel Agar <daniel@agar.ca>
Co-authored-by: Matthias Grob <maetugr@gmail.com>
Co-authored-by: RomanBapst <bapstroman@gmail.com>
Co-authored-by: CUAVmengxiao <mengxiao@cuav.net>
Co-authored-by: Kabir Mohammed <kabir@corvus-robotics.com>
Co-authored-by: Alex Mikhalev <alex@corvus-robotics.com>
Co-authored-by: Alex Mikhalev <alexmikhalevalex@gmail.com>
Co-authored-by: David Sidrane <David.Sidrane@NscDg.com>
Co-authored-by: stmoon <munhoney@gmail.com>
Co-authored-by: alessandro <3762382+potaito@users.noreply.github.com>
Co-authored-by: Beat Küng <beat-kueng@gmx.net>
Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Hovergames <loic.fernau@googlemail.com>
Co-authored-by: Alessandro Simovic <alessandro@auterion.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: Igor Misic <igy1000mb@gmail.com>
Co-authored-by: Thomas Stastny <thomas.stastny@auterion.com>
Co-authored-by: Julian Oes <julian@oes.ch>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>
Co-authored-by: Ryan Johnston <31726584+ryanjAA@users.noreply.github.com>
Co-authored-by: alexklimaj <alex@arkelectron.com>
Co-authored-by: Nicolas MARTIN <59083163+NicolasM0@users.noreply.github.com>
Co-authored-by: PX4 BuildBot <bot@px4.io>
Co-authored-by: bresch <brescianimathieu@gmail.com>
Co-authored-by: Junwoo Hwang <junwoo@auterion.com>
Co-authored-by: chris1seto <chris12892@gmail.com>
Co-authored-by: Chris Seto <chris.seto@bossanova.com>
Co-authored-by: Thomas Debrunner <thomas.debrunner@auterion.com>
Co-authored-by: bazooka joe <bazookajoe1900@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: mcsauder <mcsauder@gmail.com>
Co-authored-by: Kirill Shilov <aviaks.kirill@gmail.com>
Co-authored-by: bresch <bresch@users.noreply.github.com>
Co-authored-by: achim <lumserei@web.de>
Co-authored-by: JaeyoungLim <jalim@ethz.ch>
Co-authored-by: Nico van Duijn <nico@auterion.com>
Co-authored-by: Nicolas MARTIN <nicolas1.martin1@gmail.com>
Co-authored-by: Serhat Aksun <serhat.aksun@maxwell-innovations.com>
Co-authored-by: vincentpoont2 <vincentpoont2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants