12339 Commits

Author SHA1 Message Date
Matthias Grob
40edd33078 mc_pos_control: reduce scope of attitude setpoint
No need for a gloabl state since it gets produced freshly
by the controller and then published.
2019-10-24 14:58:57 +02:00
Matthias Grob
79334958a9 WeatherVane: only update with last row of rotation matrix 2019-10-24 14:58:57 +02:00
Matthias Grob
9c25b987bc vehicle_local_position_setpoint: make acceleration and jerk arrays 2019-10-24 14:58:57 +02:00
bresch
a7727769e9 ekf2: Fix heading not stable issue. The prblem was that a large
dt could drive the alpha filter crazy because of the small dt
approximation during the computation of the coefficient.
- Remove unused bitmask packing of the innovation checks
2019-10-24 11:27:35 +02:00
JaeyoungLim
2fc5789d68 Support offboard velocity setpoints for rover (#13225)
* Enable velocity control for rover

* Address comments

* Use pid for speed control

* Calculate steering commands correctly

* Use local velocity estimates to avoid global position dependency
2019-10-24 10:40:20 +02:00
Beat Küng
b5ba1665f6 commander: add COM_MOT_TEST_EN parameter to enable/disable motor testing 2019-10-24 09:27:29 +02:00
Beat Küng
02833c6075 px4io: add support for test_motor
And fix some IO bugs:
- PX4IO_P_STATUS_FLAGS_RAW_PWM was never cleared. This meant that after a
  'pwm test' command, normal mixing was not possible anymore.
  Fixed by remembering when we are in test mode and not sending
  PX4IO_PAGE_CONTROLS during that time. PX4IO_P_STATUS_FLAGS_RAW_PWM is
  cleared when PX4IO_PAGE_CONTROLS are received.
- when entering test mode w/o specifying all channels, the other channels
  were not set at all, which means they could still be set to values from
  a previous test call.
  This is fixed by setting all channels to disarmed when entering/leaving
  test mode.
2019-10-24 09:27:29 +02:00
Beat Küng
0d91d4e702 commander: do not beep on successful commands
DO_MOTOR_TEST is sent continuously, which led to constant beeping
2019-10-24 09:27:29 +02:00
Beat Küng
f7b04d5cbc commander: answer to VEHICLE_CMD_DO_ORBIT 2019-10-24 09:27:29 +02:00
Beat Küng
285ae608a5 commander: add support for DO_MOTOR_TEST
- add an optional timeout to test_motor
- enforce a timeout when receiving DO_MOTOR_TEST
- limitation: DO_MOTOR_TEST can only control the MAIN outputs
2019-10-24 09:27:29 +02:00
Matthias Grob
38651ceee1 mc_pos_control: address @bresch's review comments 2019-10-23 17:33:47 +02:00
Matthias Grob
d60e1e2774 ControlMath: switch to gtest for unit tessting 2019-10-23 17:33:47 +02:00
Matthias Grob
ad60f6d786 PositionControl: make it self contained library 2019-10-23 17:33:47 +02:00
Mathieu Bresciani
549fb0d5de
ekf2_main - Add optical flow innovation pre-flight check (#13036)
* ekf2: Add FirstOrderLpf and InnovationLpf classes for innovation lowpass filtering

* ekf2: use InnovLpf filter class in preflight checks

* ekf2: move selection of yaw test limit for pre-flight check in function

* ekf2: Move pre-flight checks into separate function

* ekf2: use static constexpr insetead of inline for sq (square) function

* ekf2: Split pre-flight checks in separate functions
Also use the same check for all the innovations:
innov_lpf < test and innov < 2xtest

* ekf2: Add optical flow pre-flight check

* ekf2: Combine FirstOrderLpf and InnovationLpf in single class

* ekf2: check vel_pos_innov when ev_pos is active as well

* ekf2: transform InnovationLpf into a header only library and pass the
spike limit during the update call to avoid storing it here

* ekf2: Static and const cleanup
- set spike_lim constants as static constexpr, set innovation
- set checker helper functions as static
- rename the mix of heading and yaw as heading to avoid confusion

* ekf2: use ternary operator in selectHeadingTestLimit instead of if-else

* ekf2: store intermediate redults in const bool flags. Those will be used for logging

* ekf2: set variable const whenever possible

* ekf2: create PreFlightChecker class that handle all the innovation
pre-flight checks.
Add simple unit testing
Use bitmask instead of general flag to have more granularity

* PreFlightChecker: use setter for the innovations to check instead of sending booleans in the update function
This makes it more scalable as more checks will be added

* ekf: Use booleans instead of bitmask for ekf preflt checks
Rename "down" to "vert"
2019-10-22 16:22:42 +02:00
Daniel Agar
35398e05ca
perf counter cleanup (mostly intervals)
Some of these perf counters were useful during initial development, but realistically aren't needed anymore, some are redundant when we can now see the average interval from `work_queue status` and some of them simply aren't worth the cost at higher rates.
2019-10-21 18:54:17 -04:00
Daniel Agar
6a0f5249f8
sensors: split out analog battery handling to new standalone battery_status module 2019-10-21 13:40:23 -04:00
Hamish Willee
177da1f923 RTL params - proposed updates 2019-10-21 09:08:27 +03:00
RomanBapst
4cc7bb7296 addressed review comments
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-10-21 09:08:27 +03:00
RomanBapst
b1a9d4b4c7 updated rtl parameter descriptions.
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-10-21 09:08:27 +03:00
Nick Steele
070d75496d Handle MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN 'Do nothing for autopilot' 2019-10-18 15:57:50 -04:00
Matthias Grob
08ec6a28f0 mc_att_control: remove TPA
because it's mostly unused and we have thrust curve correction
see parameter THR_MDL_FAC
2019-10-18 15:54:09 -04:00
Julian Oes
de90543d6f FlightTasks: add Descend task to land without GPS
This adds a flight task to catch the case where we want to do an
emergency descent without GPS but only a baro.

Previously, this would lead to the navigator land class being called
without position estimates which then made the flight tasks fail and
react with a flight task failsafe. This however meant that landed was
never detected and a couple of confusing error messages.

This applies if NAV_RCL_ACT is set to 3 "land".
2019-10-18 16:18:19 +02:00
Matthias Grob
5f53ae1253 mc_pos_control: execute failsafe with invalid setpoints 2019-10-18 16:18:19 +02:00
Mark Sauder
e9c9fb8239 fix multicopter land detector: do not update parameters every cycle (#13212)
And add updateParams() call in LandDetector::_update_params().
2019-10-18 09:25:41 +02:00
Julian Oes
2fcddd9b8d mavlink: fix uninitialized mavlink warnings 2019-10-17 08:44:53 -04:00
Julian Oes
ec95378821 logger: fix uninitialized coverity warnings 2019-10-17 08:44:53 -04:00
Beat Küng
884621415d dataman: fix invalid use of px4_sem_timedwait
px4_sem_timedwait expects an absolute time (from CLOCK_REALTIME), but a
relative time was provided.

This is only relevant if FLASH_BASED_DATAMAN is set (only on Intel aero).
2019-10-16 18:29:26 +02:00
ThomasRigi
17c17f26a9 VTOL GPSF: fix fixed bank loiter (#12778)
* GPS Failsafe fix for VTOL
* navigator: use new uORB API for VTOL publication
2019-10-16 17:57:44 +02:00
Matthias Grob
a053b7f69b vtol_att_control_main: only reset thrust when disarmed
to see flaps moving according to attitude control before arming
and not have tailsitter elevons move to follow north heading.
2019-10-16 16:30:38 +02:00
Julien Lecoeur
4cc7b1319f Fix param update in mc_att_control
ModuleParams::updateParams() was never called
2019-10-16 08:17:04 -04:00
Beat Küng
173337e49c uORBManager: print errno for advertisement failures
Helps with debugging.
2019-10-16 13:13:17 +02:00
Matthias Grob
45a53726d6 LandDetector: switch to uORB::Publication 2019-10-16 00:47:01 -04:00
Matthias Grob
679e4fedf5 LandDetector: switch land flags to properies instead of one state 2019-10-16 00:47:01 -04:00
Ilya Petrov
c58cfce6be do not check VP fusion during GPS startup
This is solution for https://github.com/PX4/Firmware/issues/11864
2019-10-15 17:01:20 +01:00
kamilritz
a4e035d338 Add param to choose vision observation noise source 2019-10-15 16:06:37 +01:00
RomanBapst
6bfb50df8a run arm authorization as last pre-arm check, as it used to be implemented
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-10-15 15:44:24 +01:00
Matthias Grob
e843090383 Replace a lot of memset with {} initializers 2019-10-15 10:01:03 -04:00
Matthias Grob
b8f70e865c voted_senors_update: remove memset 0 initializations because of zero initializer in header 2019-10-15 10:01:03 -04:00
Matthias Grob
185e2811dc gyro_calibration: use constexpr instead of const 2019-10-15 10:01:03 -04:00
Matthias Grob
09faa4647b ekf2_params: correct typo 2019-10-15 10:01:03 -04:00
Mark Sauder
0cbb693a8d Add return INFINITY; to the LandDetector class _get_max_altitude() method declaration (#12343) 2019-10-15 08:19:53 +02:00
Matthias Grob
9f639d1f3b mc_att_control: move rate control to RateControl class
This makes the controller more modular, more readable and hence
better maintainable.
2019-10-15 07:46:47 +02:00
Daniel Agar
c51475640e
mavlink: only send ATTITUDE/ATTITUDE_QUATERNION msgs on vehicle_attitude update
- fixes #13182
2019-10-14 15:47:22 -04:00
mcsauder
fb12ddb69a Cherry pick the directory and voted_sensors_update.h from PR #9756.
Consolidate _update_params() methods for improved inheritance from the LandDetector base class.
Move common uORB::Subscriptions to the base class for inheritance.
Deprecate redundant override methods.
2019-10-14 21:25:57 +02:00
Matthias Grob
bb91db2057 AttitudeControlTest: fix adaptAntipodal() function 2019-10-14 18:23:22 +02:00
Matthias Grob
83dfa227a7 AttitudeControlTest: include all corner case combinations
Which revealed antipodal quaternion corner cases when
the first element is zero.
2019-10-14 18:23:22 +02:00
Matthias Grob
511828bfd2 AttitudeControlTest: add first controller convergence test 2019-10-14 18:23:22 +02:00
TSC21
10e3bcd138 ulog stream msgs: rename 'sequence' fields as they are protected names in fastrtpsgen 2019-10-14 16:37:17 +01:00
BazookaJoe1900
3007b0876c mavlink: add protection against setting wrong type of parameters 2019-10-14 11:18:08 -04:00
Jin Chengde
13c3ae3b52 FW RWTO: add throttle_ramp_time parameter RWTO_RAMP_TIME
* add throttle_ramp_time parameter support fixed wing runway takeoff
2019-10-14 11:07:33 -04:00