Commit Graph

28101 Commits

Author SHA1 Message Date
Kurt Kiefer b111489825 PX4IO: re-enable handling digital rssi
The px4io driver was ignoring the contents of PX4IO_P_RAW_RC_NRSSI
since digital rssi wasn't working properly. This change was made in
commit 41b127d40.

Now that PX4IO_P_RAW_RC_NRSSI is returning valid values for digital
rssi, we can re-enable its use.
2018-07-23 08:16:51 +02:00
Kurt Kiefer 7a5a135739 PX4IO Firmware: promote rssi to static storage
The controls_tick() rate exceeds the rate at which RC receivers
provide digital rssi. As such, most ticks set PX4IO_P_RAW_RC_NRSSI
to 0.

This change promotes the controls_tick() local variable 'rssi' to
static storage so that it doesn't have to be updated every tick to
keep the correct value in PX4IO_P_RAW_RC_NRSSI.
2018-07-23 08:16:51 +02:00
Daniel Agar b1d3bb0403 stop ignoring Wmissing-field-initializers and fix (#9912) 2018-07-22 12:45:52 -04:00
Paul Riseborough fc65939f0e ekf2: Add support for use of multiple GPS receivers (#9765) 2018-07-22 12:18:30 -04:00
Daniel Agar afe82ffb31 Update submodule mavlink v2.0 to latest Sat Jul 21 21:26:19 EDT 2018
- v2.0 in PX4/Firmware (8feac97399): https://github.com/mavlink/c_library_v2/commit/f2ae3ada7990d6fea25c5206057375e0c4d05672
    - v2.0 current upstream: https://github.com/mavlink/c_library_v2/commit/fb2c4f819819e2348285bc9e03ab711ceb6c4cc1
    - Changes: https://github.com/mavlink/c_library_v2/compare/f2ae3ada7990d6fea25c5206057375e0c4d05672...fb2c4f819819e2348285bc9e03ab711ceb6c4cc1

fb2c4f8 2018-07-19 PX4BuildBot - autogenerated headers for rev https://github.com/mavlink/mavlink/tree/de22395191208df6c42e243a6d7993e6a364e48a
550c3f5 2018-07-19 PX4BuildBot - autogenerated headers for rev https://github.com/mavlink/mavlink/tree/fe88d5fd12f94066a42b80ed44f7284c9b9e72a3
404f50f 2018-07-18 PX4BuildBot - autogenerated headers for rev https://github.com/mavlink/mavlink/tree/3940532218b0a1a9491d3f0fa5eec8d4555693ad
2018-07-22 09:45:02 -04:00
Paul Riseborough a37580ceac mc_pos_control: remove un-used parameter 2018-07-22 17:42:31 +10:00
Paul Riseborough 73a7aa75a8 FlightTasks: update terrain hold transition logic.
Use pre-existing MPC_HOLD_MAX_XY parameter for speed threshold.
Use _stick_expo variable for stick movement check.
Update documentation.
2018-07-22 17:42:31 +10:00
Paul Riseborough dd3fb84db8 mc_pos_control: Fix parameter description error 2018-07-22 17:42:31 +10:00
Paul Riseborough c9ca27e7c2 ekf2: Update documentation for EKF2_RNG_AID parameter 2018-07-22 17:42:31 +10:00
Paul Riseborough 7ff23f7859 posix-configs: Update optical flow SITL test parameter defaults
Use baro for height in EKF.
Use terrain hold mode in height controller.
2018-07-22 17:42:31 +10:00
Paul Riseborough 2baa6caacb FlightTasks: Fix transition between use of local and ground height (+2 squashed commits)
Squashed commits:
[ed2a243] FlightTasks: Preserve control loop tuning when applying max altitude limit
[b33b947] FlightTasks: Add terrain hold function

This new mode of altitude control uses terrain following when holding position and normal altitude control when moving.
2018-07-22 17:42:31 +10:00
Paul Riseborough 82780e33b9 mc_pos_control: Add parameter support for terrain hold function
This new mode of altitude control uses terrain following when holding position and normal altitude control when moving.
2018-07-22 17:42:31 +10:00
mcsauder 14a8afb61d Formatted whitespace and comments, standardized comment block styles and single line comments, and added capitalization and full stops to comments wherever appropriate. 2018-07-22 08:44:30 +02:00
Kurt Kiefer a114450f51 spektrum_rssi: clear PX4IO_P_SETUP_FEATURES_ADC_RSSI when valid
When we're getting valid rssi input from the telemetry receiver,
clear the flag PX4IO_P_SETUP_FEATURES_ADC_RSSI in r_setup_features.
2018-07-22 08:42:30 +02:00
Kurt Kiefer fc16dce8f1 spektrum_rssi: initialize rssi lookup as constexpr
Rather than initializing the rssi percentage lookup table at runtime
on the heap, we would like it to be stored in flash.

This change pre-computes the rssi lookup table.
2018-07-22 08:42:30 +02:00
Kurt Kiefer 597372bec9 Gather RSSI data from Spektrum Telemetry receivers
On SPM4649T receivers with firmware versions at least 1.1RC9, the
serial data will contain an rssi value in dbm, as outlined in the
Remote Receiver Interfacing document section 8.3.1.

If the value received is greater than or equal to zero, the receiver
does not support rssi data, and the incoming value will be ignored.
However, if the value is negative, we can use the rssi value.

When we have a valid rssi, it gets mapped to a percentage from 0 to
100 as expected by mavlink. This mapping is constructed as a
logarithmic function over Spektrum's published minimum and maximum
rssi values, -92dBm to -42dBm as 0 to 100:
100 Log10[1 + (x - min) * (9 / (max - min))]

This change updates all calls to the dsm input rountes to return
the rssi value.

Note that one place this doesn't work with the px4io enabled.
There is a comment left in the absence of analog rssi that:
"we do not actually get digital RSSI regs[PX4IO_P_RAW_RC_NRSSI]".
This restriction has been left in place, as removing it exposes a
problem where the frequency of the control tick is greater than
that of valid dsm frames so the rssi isn't valid every cycle.
2018-07-22 08:42:30 +02:00
Daniel Agar 8feac97399 docker update all to 2018-07-19 tagged image 2018-07-21 15:52:19 -04:00
mcsauder ec16a4d063 Migrate LOGGER_BUF argument to rc.logging, group OUTPUT_MODE instances closer together by relocating UAVCAN logic block in rcS, and alphabetize hardware specific logic in rc.sensors. 2018-07-20 19:01:33 +02:00
David Sidrane 5ae39229b8 manifest:Clean up using synbolic constants 2018-07-20 18:29:58 +02:00
David Sidrane 45f210e544 fmu:Use Compile time & run time Safety switch control
Platforms that provide HW versioning tend to have
   more FLASH and can have a PX4IO as an option.
   (E.G.) FMUv5. This change provides run time
   decision to control the safety switch on
   platfors that have BOARD_HAS_VERSIONING.

   On platforms with no versioning and have
   BOARD_HAS_STATIC_MANIFEST defined as a 1
   The decision is compile time only. When a PX4IO
   is present the fmu control of the safety is
   not built.
2018-07-20 18:29:58 +02:00
David Sidrane 3ea3c1f537 px4fmu-v5:Runtime Safety LED support.
Safety Switch is HW version dependent on having an PX4IO
   So we init to a benign state with the _INIT definition
   and use the non _INIT verion in the driver if the run time
   decision is we do not have a PX4IO
2018-07-20 18:29:58 +02:00
David Sidrane 3136521493 px4fmu-v5:Fix led toggle.
The phyical led read was not returing the logical state
    of the LED. Since they are active low, when on it was
    returning 0 and the the negation operation in togggle
    was makeing that a 1 which it already was.
2018-07-20 18:29:58 +02:00
David Sidrane 1db1155697 px4fmu-v5:Comment and define SAFETY LED and Button so FMU can use
Safety Switch is HW version dependent on having an PX4IO
  So we init to a benign state with the _INIT definition
  and provide the the non _INIT one for the driver to make a run time
  decision to use it.

  We also define the FMU GPIO_BTN_SAFETY and GPIO_LED_SAFETY alias
  so the px4fmu will drrive will be built with the safety switch
  code at compile time and have runtime control via the manifest
2018-07-20 18:29:58 +02:00
David Sidrane c9cf17c432 px4fmu-v5:define BOARD_HAS_CONTROL_STATUS_LEDS
FMUv5 supports status LEDs.
2018-07-20 18:29:58 +02:00
David Sidrane 0b60df5fe0 px4fmu-v2:Added HW manifest (only support PX4IO) for now
This is the beginning of the manifest support on FMUv2/v3
   it only provide PX4_MFT_PX4IO for now.
2018-07-20 18:29:58 +02:00
David Sidrane 08e04e3c5c px4fmu-v4pro:Comment GPIO_BTN_SAFETY_FMU is inited and not used 2018-07-20 18:29:58 +02:00
David Sidrane 4330d6dad5 px4fmu-v4pro::Define BOARD_HAS_STATIC_MANIFEST as 1
When BOARD_HAS_STATIC_MANIFEST is defined with a value of 1
   and the board_config provides the BOARD_USES_PX4IO_VERSION
   then the board_common will define
   PX4_MFT_HW_SUPPORTED_PX4_MFT_PX4IO
2018-07-20 18:29:58 +02:00
David Sidrane 3b0427c2a5 auav-x21:Define BOARD_HAS_STATIC_MANIFEST as 1
When BOARD_HAS_STATIC_MANIFEST is defined with a value of 1
    and the board_config provides the BOARD_USES_PX4IO_VERSION
    then the board_common will define
    PX4_MFT_HW_SUPPORTED_PX4_MFT_PX4IO
2018-07-20 18:29:58 +02:00
David Sidrane 68aa5664b0 px4io:Use manifest query mechanism 2018-07-20 18:29:58 +02:00
David Sidrane 840b3ae985 px4fmu-v5:manifest add initial query mechanism 2018-07-20 18:29:58 +02:00
David Sidrane a0cc4dc345 Fix typo 2018-07-20 18:29:58 +02:00
David Sidrane f2cb7b0ade board_common:Add underpinning for board manifest query 2018-07-20 18:29:58 +02:00
David Sidrane 5b4da90d60 fmuv2:Added State information for FMUv2 questionable hardware
This HW does not respond to the GPIO query consistantly
   and should be treated like regular FMUv2
2018-07-20 18:29:58 +02:00
David Sidrane 7524a318cc px4fmuv5:Fix display order to ver rev 2018-07-20 18:29:58 +02:00
David Sidrane 7a4ac739f1 Fix Stack warning 2018-07-20 18:29:58 +02:00
Daniel Agar 345f6367a5 av-x remove mc_pos_control_tests 2018-07-20 09:26:18 +02:00
Dennis Mannhart 18a3c08659 mc_pos_control: idle to armed state delay controlled by parameter MPC_IDLE_TKF 2018-07-20 09:26:18 +02:00
Dennis Mannhart ab1ae1fb4e mc_pos_control_main: trigger failsafe if no setpoint along D-direction is valid 2018-07-20 09:26:18 +02:00
ChristophTobler 9362f844f4 position control: fix failsafe thrust
invert direction to point upwards and increase to 70% of throttle range between min and hover
2018-07-20 09:26:18 +02:00
ChristophTobler 7cc85885a4 position control: set _skip_controller before calling _interfaceMapping()
Without this failsafe will be overwritten
2018-07-20 09:26:18 +02:00
ChristophTobler 80867343ab mc_pos_control: trigger failsafe if no pos, vel or thrust pair is valid 2018-07-20 09:26:18 +02:00
Dennis Mannhart 260284571d mc_pos_control: move failsafe logic into method 2018-07-20 09:26:18 +02:00
Dennis Mannhart ac2c49218d mc_pos_control: remove mavlink_log_info 2018-07-20 09:26:18 +02:00
Dennis Mannhart f11a65a74f mc_pos_control: fix overwrite for state velocity 2018-07-20 09:26:18 +02:00
Dennis Mannhart f2d559a4c2 mc_pos_control: minor refactor 2018-07-20 09:26:18 +02:00
Matthias Grob cc0bc05156 mc_att_control: remove useless parameter MC_YAW_FF
It scales the yawspeed setpoint arbitrarily by default with 0.5.
This makes no sense because when you give a setpoint of 1rad/s then
you expect the setpoint to get executed. If you want manual yawspeed
response to be less agressive on the stick use the scaling parameter
for the stick MPC_MAN_Y_MAX.
2018-07-20 09:26:18 +02:00
Dennis Mannhart b5731e0ccd FlightTaskOffboard: only start task if control mode flags are met 2018-07-20 09:26:18 +02:00
Dennis Mannhart bf4ac7a9d6 mc_pos_control: for terrain following use range sensor climbrate for velocity estimate 2018-07-20 09:26:18 +02:00
Dennis Mannhart eb7139bc56 FlightTaskManualAltitude: respect maximum altitude if there is a valid distance sensor 2018-07-20 09:26:18 +02:00
Dennis Mannhart c907e7a9dc FlighttaskManualAlititude: replace SENS_FLOW_MINRNG with hagl_min 2018-07-20 09:26:18 +02:00