12777 Commits

Author SHA1 Message Date
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
Lorenz Meier
5936844595 Update to latest mission API 2020-03-14 17:50:40 +01:00
Lorenz Meier
b405c7e9bd Navigator: Add ability to wait for a position gate with executing the mission
This enables the navigator to wait for a specific gate coordinate to pass orthogonally to the current trajectory. This is particularly helpful for payload / camera handling in missions and avoids a dependency of payload handling on navigation waypoints.
2020-03-14 17:50:40 +01:00
Lorenz Meier
ed8cb1c5a7 MAVLink: Add support for new gate command
This enables the vehicle to be able to wait with executing the next item until a position has been passed.
2020-03-14 17:50:40 +01:00
BazookaJoe1900
5e343b104e
logger: using ModuleParams (#14316)
and some cleanups on main()
2020-03-13 11:31:43 +01:00
Daniel Agar
0eca583ecf sensors: move baro aggregation to new sensors/vehicle_air_data 2020-03-12 19:06:34 -04:00
Daniel Agar
093e9ba1ce
mc_rate_control: use vehicle_angular_acceleration topic instead of differentiating
* mc_rate_control: use vehicle_angular_acceleration topic
* IMU_DGYRO_CUTOFF change default to 30 Hz
* improve IMU_DGYRO_CUTOFF param documentation (updated from MC_DTERM_CUTOFF)
2020-03-12 15:07:03 -04:00
Daniel Agar
a89b69b0ea
vehicle_global_position: remove velocity fields (duplicates of local vx, vy, vz)
* attitude_estimator_q: get velocity from local position (if available)
2020-03-11 23:57:43 -04:00
Daniel Agar
5d33b9e999
delete Outback Challenge (OBC) AUTO_RTGS (datalink loss) and AUTO_RCRECOVER (rc loss) 2020-03-11 22:45:55 -04:00
Daniel Agar
f9794e99f8
move hover_thrust_estimator to new module (mc_hover_thrust_estimator)
* MC_HTE: unitialize with hover_thrust parameter
* MC_HTE: constrain hover thrust setter between 0.1 and 0.9
* MC_HTE: integrate with land detector and velocity controller
* MCHoverThrustEstimator: Always publish an estimate even when not fusing measurements. This is required as the land detector and the position controller need to receive a hover thrust value.

* MC_HTE: use altitude agl threshold to start the estimator
local_position.z is relative to the origin of the EKF while dist_bottom
is above ground

Co-authored-by: bresch <brescianimathieu@gmail.com>
2020-03-11 21:20:54 -04:00
Daniel Agar
9cd8bb4f88
sensors: move to WQ
Running the sensors module out of the same WQ thread as the estimator, position, and attitude controllers is a bit safer and prevents potential priority and starvation issues. There is a very small increase in latency (~50 us) between sensors and ekf2 execution (on average). This also saves a little bit of memory (~ 3 kB) and cpu (~1-1.5% depending on the board).
2020-03-11 11:34:04 -04:00
Daniel Agar
9585055e9e
uORB: add bitset for faster orb_exists check and remove uORB::Subscription lazy subscribe hack/optimization
- add PX4 bitset and atomic_bitset with testing
 - add uORB::Subscription constructor to take ORB_ID enum
 - move orb test messages into msg/
2020-03-11 09:06:33 -04:00
TSC21
2568d9ae20 mavlink: timesync: readd timesync_status uORB to report Mavlink timesync 2020-03-10 12:15:18 +00:00
TSC21
170835f3f8 microRTPS: add timesync for the agent side 2020-03-10 12:15:18 +00:00
Roman Dvořák
152427ecdc
Ability to disable airspeed scaling (#14334) 2020-03-10 12:57:36 +01:00
RomanBapst
4ddf0f9dc1 ekf2_main.cpp: fixed bug in the calculation of the mag bias calibration time
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2020-03-10 08:54:04 +01:00
Roman Dvořák
e43aa4e287
logger: add RPM sensor messages 2020-03-09 18:34:06 -04:00
Beat Küng
3fef401e81 uorb callbacks: fix unregister ordering to avoid race conditions
The order should be: first unregister, then remove the item from the
runnable queue.
2020-03-09 08:06:00 -04:00
Julian Kent
d2507e831e Add mavlink parsing for bezier message 2020-03-09 09:51:49 +01:00
Matej Frančeškin
b8970673c6 Fixed Mavlink FTP tests 2020-03-08 21:43:54 +01:00
Matej Frančeškin
ef865a091f Added FileNotFound error code according to new Mavlink FTP specification 2020-03-08 21:43:54 +01:00
bazooka joe
887d846f7a remove one space from string sent with the logger filename
now the full file name is sent, and not missing the last seconds digit
2020-03-08 12:07:51 +01:00
Dusan Zivkovic
d7a9b123e6 logger: fix thread deadlock 2020-03-06 13:37:34 +01:00
Silvan Fuhrer
b9fab04adb tiltrotor: improve comments and renaming of one variable
This is to point out that also rear motor can be used in FW flight and not only the front motors

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-03-05 11:49:42 +03:00
CarlOlsson
8de1f5229b EKF2: use fixed time constant for GPS blending
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2020-03-04 16:46:20 +01:00
CarlOlsson
357700aa8d EKF2 GPS blending: fall out of blending if one module lose 3D fix
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2020-03-04 16:46:20 +01:00
CarlOlsson
a10a228092 EKF2 GPS blending: reset relative position offsets if blending not feasible
Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
2020-03-04 16:46:20 +01:00
Julian Oes
2b087a92c2 commander: increment is 1 for int params 2020-03-04 09:35:14 +01:00