12804 Commits

Author SHA1 Message Date
Matthias Grob
bc2579f3be mc_pos_control_params: lower jerk configuration
because of tighter tracking with acceleration feed-forward.
2020-03-30 09:58:39 +02:00
Matthias Grob
b3d7445059 PositionControl: acceleration based control strategy 2020-03-30 09:58:39 +02:00
Matthias Grob
1d2ac41edc ControlMath: adding limitTilt() helper function
which takes care of limiting the lilt angle of a "body" vector with
respect to a "world" vector. Both vectors have to be unit length!
2020-03-30 09:58:39 +02:00
Matthias Grob
aa53cabaa4 PositionControl: remove confusing uMin uMax alias 2020-03-30 09:58:39 +02:00
Matthias Grob
b8576cccc8 AttitudeControlTest: add scale testing for yaw weight 2020-03-28 17:51:59 +01:00
Matthias Grob
96bbc63eb1 AttitudeControl: let the user set yaw weight directly via parameter
instead of infering the yaw weight from the gains which can lead to
unexpected results depending on the particular vehicle tuning.
2020-03-28 17:51:59 +01:00
baumanta
22ceeccc26 add library for current- or thrust-based mag compensation 2020-03-26 08:00:30 +01:00
Hamish Willee
1288db9314 ekf2_params.c: EKF2_MAG_TYPE: Info about yaw without mag 2020-03-25 09:41:54 +01:00
bresch
1f4b2d1d53 Commander: replace deprecated warnx by PX4_WARN 2020-03-23 13:45:00 +01:00
bresch
c23ef0af4b Flight termination: lockdown if failure is detected on takeoff
During the first few seconds after takeoff, the failure detector is allowed to
trigger motor lockdown.
This is done for safety reasons to detect tipping-over or unstable
tuning gains
2020-03-23 13:45:00 +01:00
bresch
5babf644f0 MPC: limit tilt to maximum safe value of 89 degrees
The algorithm fails at 90 degrees due to tanf being INF
2020-03-23 13:36:23 +01:00
Daniel Agar
b73ec18abb
boards: add px4_fmu-v4 and px4_fmu-v5 optimized (-O3) build variants 2020-03-22 17:50:17 -04:00
bazooka joe
ad2d65df8d return with error from _log_request_list() in case of failed allocation 2020-03-21 16:50:46 +01:00
Nico van Duijn
240aad1aef mavlink_mission: beautify mission download error
This commit makes the IGN REQUEST LIST: Busy message more user-oriented
and actionable.
2020-03-20 12:54:00 +01:00
Nico van Duijn
849d3a1b54 mavlink_mission: robustify against dropped ack
This commit handles incoming MISSION_REQUEST_LIST messages such that
they are no longer ignored if the previously requested mission has
sent all mission items but the ack has never been received.

This was the cause for frequent "IGN REQUEST LIST: Busy" warnings
2020-03-20 12:54:00 +01:00
SalimTerryLi
dc8e775d8f
ADC: replace ioctl with uorb message (#14087) 2020-03-20 11:23:32 +01:00
Beat Küng
40af5b0fbe logger: fix initial subscribing to topics
write_all_add_logged_msg() requires at least some subscriptions to be added
initially, as this message is used to separate ULog header from data.
2020-03-20 11:21:32 +01:00
bresch
0f2f72a757 Ekf2: Add bitmask to select terrain estimator aiding sources 2020-03-19 20:27:39 +03:00
Daniel Agar
e5d30c4413
Mavlink: split ESTIMATOR_STATUS and VIBRATION streams 2020-03-19 11:17:31 -04:00
Matthias Grob
d0349fcf07 mc_pos_control: allow zero thrust during takeoff and landing
Otherwise the takeoff ramp doesn't start with zero thrust and
the land thrust cut cannot cut to zero.
2020-03-18 20:36:05 +01:00
Matthias Grob
5027c68c0a mc_pos_control: handle takeoff and landing thrust limit the same way
The landing thrust limit was after the position controller and
could be inconsistent with what the takeoff limit did. This
resulted in different thrust values sequentially getting applied
during landing.
2020-03-18 20:36:05 +01:00
Matthias Grob
3049a3d14d mc_pos_control: prevent takeoff with thrust setpoint
This was only necessary for stabilized mode before #10805.
The  unit length thrust setpoint will anyways not be available
anymore soon because it gets replaced with the acceleration
setpoint in m/s².
2020-03-18 20:36:05 +01:00
Matthias Grob
1f98ebdb47 mc_pos_control: switch order of setpoint amendment
to make sure the takeoff limitation is always done last.
2020-03-18 20:36:05 +01:00
bresch
a8063ac948 HTE: enable by default 2020-03-18 19:47:30 +01:00
Julian Oes
795e000c2b simulator: remove redundant semicolon 2020-03-18 17:57:41 +00:00
Julian Oes
3233e0794d navigator: fix edge case with valid idle setpoint
This is an attempt to fix an edge case in the triplet publication which
can lead to crashes on autopilots with slow SD cards.

The sequence of events before this patch is:
1. Switch to POSCTL when disarmed. At this point current valid with
   setpoint idle is published.
2. Arm, takeoff, and fly using joystick/RC.
3. Switch to RTL (or trigger RTL using RC loss). At this point the
   setpoint is valid but still idle and the motors will shut off.
4. Once navigator has published the new setpoint (which can take up to
   1.5 seconds on slow SD cards) we will hopefully recover.

With this patch we omit this edge case, so we never publish this idle
setpoint when landed. The assumption is that this idle setpoint is no
longer required with the current flight task code, however, that needs
to be further verified.
2020-03-18 10:50:03 -04:00
CarlOlsson
58ded8d4c0 ekf2: remove unused function declatation 2020-03-18 14:33:11 +01:00
Matthias Grob
fb1b6a0ab9 mc_pos_control: hotfix for takeoff ramp stuck with NAN
Reported by @dusan19 in #13973.
2020-03-17 16:19:35 +01:00
Matthias Grob
eb3b0f6b55 mathlib: get rid of now duplicate sign() function
Instead use the one that was copied to the matrix library in
https://github.com/PX4/Matrix/pull/116/
2020-03-17 10:01:42 +01:00
Matthias Grob
d313b0417a AttitudeControl: Take advantage of Quaternion.canonical()
Introduced by @kamilritz in
https://github.com/PX4/Matrix/pull/116/
2020-03-17 10:01:42 +01:00
Lorenz Meier
9275937b44 Commander: Exclude shell commands for constrained flash
These are convenience commands for developers and are not required for flash constrained targets.
2020-03-17 00:17:11 +01:00
Lorenz Meier
9119f13ff7 Commander: Do not print health flags on constrained flash
Boards with constrained flash are not classic development targets and do not need this.
2020-03-17 00:17:11 +01:00
Lorenz Meier
e951123cff Health Flags: Optimize flash usage
Changing from a define to a function for reporting to safe space.
2020-03-17 00:17:11 +01:00
Lorenz Meier
aea68f06f9 Commander: Streamline preflight and arming checks
The checks did previously only report the first failure (to not overload the radio link). As we are moving to buffered messages and higher bandwidth links this design choice is not any more in the best interest of the drone operator. We are now reporting all detected failures. To ensure architectural consistency more checks have been moved from the commander mainloop into the respective classes.
2020-03-17 00:17:11 +01:00
Lorenz Meier
bf3b55cac7 Commander: Add function to print health flags consistently
This enables us to have better situational awareness during development and when inspecting a system in the field as to which subsystem is currently faulty. These flags are from standard MAVLink and are not sufficient nor do they match well the actual critical path to a safe flight. This will be addressed in a second step with the addition of a new MAVLink message and new flags.
2020-03-17 00:17:11 +01:00
Lorenz Meier
9d5aebd235 Commander: Run continuous pre-flight checks silently
As we are checking the current pre-flight state and validate wether the system could be armed, we do not want to spam the console or user with continously failing checks. These checks are reported to the GCS separately and are processed and displayed there.
2020-03-17 00:17:11 +01:00
Lorenz Meier
21435bd32b Report preflight and pre-arm checks from period checks
With this change we are reporting any issues we find with the periodic check.

Co-Authored-By: Beat Küng <beat-kueng@gmx.net>
2020-03-17 00:17:11 +01:00
Lorenz Meier
ed0a01d5da Commander: Add reporting of preflight and prearming state
This is essential for the operator to know if the system is ready to fly.
2020-03-17 00:17:11 +01:00
Daniel Agar
1a9452e411
fw_att_control: move ecl/attitude_fw into fw_att_control module
- ecl/attitude_fw was never maintained as a standalone library
 - moving ecl/attitude_fw library into the fw_att_control module to ease further development
2020-03-15 14:14:59 -04:00
bresch
6ccf55b6fd MPC: add updateHoverThrust function
This function updates the vertical velocity integrator with the change
in hover thrust to avoid propagating discontinuities through the
controller when changing the hover thrust.
This is also important when using the hover thrust estimator as its
estimate has unconstrained dynamics and can cause drops or kicks when
the estimate updates faster than the velocity integrator.
2020-03-15 13:57:02 -04:00
bresch
1bf791ba3f MC_HTE: Stability improvements
- Use a low-passed value of the signed innovation test ratio to trigger
the state variance boost. The threshold of 0.2 has been chosen using log
replay and simulation scenarii.
- Do not reset the learned accel noise during a state variance boost.
After a few tests, this does not seem to help at all.
- Continue to learn the accel noise even if the measurement got rejected
to avoid ignoring sudden changes of noise
- Lower the acceleration noise time constant and increase min/max
values to avoid learning quickly a small variance that could temporarly
destabilize the filter
- Update filter time constants. Increasing the speed of the residual lpf
improves the quality of the learned accel noise
2020-03-15 13:57:02 -04:00
Paul Riseborough
ab92b46e69
Update ecl to add ability to recover from bad magnetic yaw
* msg: Add EKF-GSF yaw estimator logging data
* ecl: update to version with EKF-GSF yaw estimator
* ekf2: Add param control and logging for EKF-GSF yaw estimator
* logger: Add logging for EKF-GSF yaw esimtator
2020-03-15 12:57:25 -04:00
Daniel Agar
5fcd7932e9
mavlink: replace MavlinkOrbSubscription with uORB::Subscription
* uORB orb_stat() and update(uint64_t *time, void *dst) are now obsolete and have been deleted
 * mavlink messages add more advertised checks in streams get_size() check to improve data rate calculation across different scenarios
2020-03-14 12:52:46 -04:00
Lorenz Meier
35ed5607b4 Mission feasibility checker: Prevent zero-length trajectories
The mission logic depends in a number of locations on being able to calculate the direction from one waypoint to another. Missions that have waypoints that are in the same physical location do not make sense and need to be rejected (the GCS / SDK generating them needs to be fixed). By enforcing this we can work with a reasonable and simpler state machine while executing the mission.
2020-03-14 17:50:40 +01:00
Lorenz Meier
76d20be29d Mission block: Gate math cleanup and checks
This change simplifies the gate calculation.
2020-03-14 17:50:40 +01:00
Lorenz Meier
4876e7bd6b Navigator: Improve documentation of mission block
The default for the gate check condition is to pass and this needed to be explicitly documented
2020-03-14 17:50:40 +01:00
Lorenz Meier
5e7ff47aac Navigator: Improve code readibility
This diff does not contain any functional changes but just makes the code more readable and adds comments.
2020-03-14 17:50:40 +01:00
Lorenz Meier
417d172a72 Navigator: Warn only for non-zero missions
Previously a zero-length mission that failed checks
(e.g. because a mandatory element was not present) would lead to a
warning.
2020-03-14 17:50:40 +01:00
Lorenz Meier
f1f185d209 Mission feasibility checker: Handle mission with zero elements silently
A mission with zero elements is invalid but should not lead to a warning. Previously a fixed wing aircraft without a mission did emit warnings about a missing land item.
2020-03-14 17:50:40 +01:00
Lorenz Meier
09595f88fc Mission block: Style improvement
Boolean logic improvement to avoid double assignment of true
2020-03-14 17:50:40 +01:00