Commit Graph

12371 Commits

Author SHA1 Message Date
Daniel Agar 9f4258f6ff clang-tidy: partially fix hicpp-explicit-conversions 2019-10-28 10:50:31 -04:00
Daniel Agar a7f330075a clang-tidy: enable hicpp-braces-around-statements and fix 2019-10-28 10:50:31 -04:00
Daniel Agar 744f06cc8f clang-tidy: enable readability-delete-null-pointer and fix 2019-10-28 10:50:31 -04:00
Daniel Agar 4192414576 clang-tidy: partially fix cppcoreguidelines-pro-type-reinterpret-cast 2019-10-28 10:50:31 -04:00
Julian Oes f5945d1185 commander: make battery failsafes sane by default
I propose two changes to the battery failsafes:
1. Remove the return only mode because it means the drone is likely
   to crash during RTL. I think this is not expected by users chosing
   the option and therefore better not exposed as an option.
2. Make Return/Land the default battery failsafe because it is expected
   that a drone does the right thing when battery is low.

Also, this changes the description of the Return/Land behaviour to make
the drop down menu less long and awkward in QGC.
2019-10-28 05:51:12 -07:00
Silvan Fuhrer 0ce9329803 Safe Landing Points: Added new RTL_TYPE: closest between home, mission landing and safe points
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

Co-authored by Martina Rivizzigno <martina@rivizzigno.it>
2019-10-28 09:54:59 +01:00
Silvan Fuhrer efafd91095 Rally Points in RTL: fly to closest Rally Point (safe point), or to home if that's closer
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2019-10-28 09:54:59 +01:00
Silvan Fuhrer 99dd229d71 Rally Point: fix typo of save to safe in mission_safe_point_s
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2019-10-28 09:54:59 +01:00
Julien Lecoeur 8f910f8435 ATTITUDE_QUATERNION: fill repr_offset_q for tailsitters (#13249)
* Conversions lib: add quaternion getter

* vehicle_status: add flag is_vtol_tailsitter

* ATTITUDE_QUATERNION: fill repr_offset_q for tailsitters
2019-10-28 09:27:53 +01:00
Daniel Agar 380cae18d1 clang-tidy: partially fix modernize-use-equals-default 2019-10-27 19:19:07 -04:00
Daniel Agar 967446af4c clang-tidy: enable readability-simplify-boolean-expr and fix 2019-10-27 19:19:07 -04:00
Daniel Agar 279df3b1b8 clang-tidy: partially fix hicpp-use-equals-delete 2019-10-27 19:19:07 -04:00
Daniel Agar d545825bf0 clang-tidy: enable performance-unnecessary-value-param and fix 2019-10-27 19:19:07 -04:00
Jaeyoung-Lim 29987a4f80 Address comments 2019-10-27 11:47:10 +00:00
Jaeyoung-Lim 3dc3679f9e Copy fields 2019-10-27 11:47:10 +00:00
Jaeyoung-Lim 58d646e33d Log CPU loads 2019-10-27 11:47:10 +00:00
Jaeyoung-Lim 677c0b4713 Add uorb topic 2019-10-27 11:47:10 +00:00
Jaeyoung-Lim a3bd9ead4c Add message handlers for onboard computer status 2019-10-27 11:47:10 +00:00
Ildar Sadykov 0326a8ec76 mavlink_receiver: Fit in 'flash' region 2019-10-26 18:29:16 +01:00
Ildar Sadykov b29a6b8761 set_attitude_target: get vehicle_status every time. 2019-10-26 18:29:16 +01:00
Ildar Sadykov fc59414a25 set_attitude_target: set rate thrust according to VTOL mode 2019-10-26 18:29:16 +01:00
Ildar Sadykov 948d24c1e3 Apply suggestions from code review
Co-Authored-By: Julien Lecoeur <jlecoeur@users.noreply.github.com>
2019-10-26 18:29:16 +01:00
Ildar Sadykov 65ed068bbd mavlink_receiver: vtol_vehicle_status changed to vehicle_status subscription 2019-10-26 18:29:16 +01:00
Ildar Sadykov d2f0100e5e Removed _is_vtol in MavlinkReceiver class 2019-10-26 18:29:16 +01:00
Ildar Sadykov c8edac0a1d VTOL state check for attitude setpoint publish 2019-10-26 18:29:16 +01:00
Ildar Sadykov 35b0778499 Check system type for SET_ATTITUDE_TARGET attitude publising
Check if system type is VTOL and publish attitude to proper uORB topic
2019-10-26 18:29:16 +01:00
Matthias Grob be545db44f mc_pos_control: reuse timestamp to reduce hrt calls 2019-10-26 06:11:18 +02:00
Matthias Grob d0084766ff PositionControl: make getters const functions 2019-10-26 06:11:18 +02:00
Matthias Grob f70d4d21a1 PositionControl: add getter for output attitude setpoint 2019-10-26 06:11:18 +02:00
Matthias Grob 198605d258 PositionControl: add getter for output position setpoint 2019-10-26 06:11:18 +02:00
Dusan Zivkovic 7ebaf9a1cb mission: ensure precland::on_inactivation() is called once landed 2019-10-25 09:28:09 +02:00
bresch 788b8c86a2 InnovationLpf: initialize state to zero 2019-10-24 18:33:55 +02:00
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