12666 Commits

Author SHA1 Message Date
Hamish Willee
9886b11f99 EKF params - clarify body frame origin/orientation 2020-01-30 07:29:11 -05:00
Matthias Grob
69af6386b3 mc_pos_control_main: remove obsolete input setpoint assignments
These assignments were temporary for correct logging of the input
setpoint which now properly also comes out of the controller again.

This is reverting the hotfix from:
dee8d200d8bb42cd964065f9a6506e3c4a901f10
2020-01-30 07:28:18 -05:00
Matthias Grob
b75c1308f9 PositionControl: replace interfacemapping checks
Removing the skip_controller and interfaceMapping
concept and replacing it with a single method checking
if the position control update was successful and
return the result in the PositionControl.update().
2020-01-30 07:28:18 -05:00
Matthias Grob
e06fff94bb PositionControl: handle yaw NAN inputs 2020-01-30 07:28:18 -05:00
Matthias Grob
dcc0339773 PositionControl: calculate velocity integral once using Vector3f 2020-01-30 07:28:18 -05:00
Matthias Grob
9109d22c28 PositionControl: simplify horizontal thrust limiting 2020-01-30 07:28:18 -05:00
Matthias Grob
83653d6581 PositionControl: readd direct thrust setpoint support
This restores original horizontal thrust setpoint execution
that I intentionally broke three commits ago. It's necessary
for correct stick to tilt mapping of FlightTaskManualAltitude.
2020-01-30 07:28:18 -05:00
Matthias Grob
282d46efcb PositionControl: add feed-forwards with addIfNotNan() 2020-01-30 07:28:18 -05:00
Matthias Grob
62fb06bd58 PositionControl: calculate velocity PID once using Vector3f 2020-01-30 07:28:18 -05:00
Matthias Grob
5bd8da2286 PositionControl: temporarily remove direct thrust setpoint support
This commit temporarily breaks direct horizontal thrust setpoint execution
which is used by FlightTaskManualAltitude. This is necessary to allow for
PositionControl cleanup namely calculating the whole velocity PID in one
Vector3f formula.

Having this in a separate commit is useful since it reduces indentation
of a bigger code block.
2020-01-30 07:28:18 -05:00
Matthias Grob
e53ae45188 ControlMath: add addIfNotNan helper functions 2020-01-30 07:28:18 -05:00
Daniel Agar
931a3f2684
logger: publish initial logger_status orb message 2020-01-29 17:29:30 -05:00
Daniel Agar
2410b31662
sensors: move accel filtering to sensors/vehicle_acceleration
I've added a queue depth of 4 for sensor_accel and sensor_gyro. This is initially added because it's not always possible for the `vehicle_acceleration` to keep up with every publication of the primary accelerator as it runs in the same thread as ekf2, various controllers, etc. 

Later this mechanism will be used in a few areas
 - rate limit `vehicle_angular_velocity` and `vehicle_acceleration` without missing any raw data
 - move IMU integration to `vehicle_imu` and out of the actual driver threads, eliminating the need for sensor_accel_integrated and sensor_gyro_integrated
 - integrate raw gyro synchronized with optical flow measurements
2020-01-29 16:13:38 -05:00
RomanBapst
3ef6eba34c prearmCheck: vtol cleanup
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2020-01-28 10:14:32 -05:00
Silvan Fuhrer
8de675ec88 mission feasibilty check: fix for VTOL backtransition and land waypoint
Prior this fix VTOL missions get rejected if they have a DO_LAND_START marker, but then do
not end with a LAND waypoint but a VTOL transition and land.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-01-28 10:13:41 -05:00
Lorenz Meier
7e39ef8b8f MAVLink sim: Start faster
This reduces test times across the board.
2020-01-28 08:59:25 +01:00
Silvan Fuhrer
4fa64f686a pre arm check: add circuit breaker for the VTOL arming in fixed-wing mode prevention
Added a new circuit breaker that, if set, enables arming in fixed-wing mode for VTOLs.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-01-28 00:30:24 +01:00
Silvan Fuhrer
f4df3fb5f2 pre arm check: VTOL: do not allow arming if not in multicopter mode
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-01-28 00:30:24 +01:00
Daniel Agar
1237402fa4
sensors: compute and publish vehicle_angular_acceleration
- introduces parameter IMU_DGYRO_CUTOFF to configure the angular acceleration low pass filter
 - the angular acceleration is computed by differentiating angular velocity after the notch filter (IMU_GYRO_NF_FREQ & IMU_GYRO_NF_BW) is applied

Co-authored-by: Julien Lecoeur <jlecoeur@users.noreply.github.com>
2020-01-27 16:44:01 -05:00
Daniel Agar
24f0c2d72a
sensors: move gyro filtering to sensors/vehicle_angular_velocity
- gyro filtering (low-pass and notch) only performed on primary gyro in `sensors/vehicle_angular_velocity` instead of every gyro in `PX4Gyroscope`
 - sample rate is calculated from actual updates (the fixed value was slightly wrong in many cases, and very wrong in a few)
 - In the FIFO case the array is now averaged and published in `sensor_gyro` for filtering downstream. I'll update this in the future to use the full FIFO array (if available), but right now it should be fine.
2020-01-27 10:05:33 -05:00
Daniel Agar
3545ba97ca commander: don't run preflightCheck during calibration on reconnect 2020-01-27 09:10:22 +01:00
Daniel Agar
10410fc868 msg: rename sensor_bias -> estimator_sensor_bias 2020-01-27 09:03:27 +01:00
Beat Küng
db49e5abcd fix commander: run preflight checks on GCS connection
Regression from 6dec451babf1b4c6394fbf8678585d66932adefb, leading to
preflight failures not being reported at all. Only after a failed arming
attempt the messages would be sent. And for GPS check failures, in case
they are set to optional (default), arming would be possible, but switching
to position would be rejected w/o error.

We need to run the preflight checks periodically, but this at least restores
the previous behavior.
2020-01-25 11:17:33 +01:00
Beat Küng
2a67d22ac7 commander powerCheck: simplify logic
refactoring only
2020-01-25 11:17:33 +01:00
Beat Küng
9e7dcd4b06 commander: fix prearm flag to preflightCheck
This was inverted, i.e. set to false in most cases, whereas it should be
true.

As a consequence, both powerCheck and airspeed.confidence checks were not
executed.
2020-01-25 11:17:33 +01:00
Daniel Agar
4fef3dd7d5 simulated sensors minor cleanup
- mavlink receiver use PX4Accelerometer/PX4Gyroscope for hil_sensor and hil_state_quaternion
 - simulator module remove unnecessary fake scaling
 - sih module remove unnecessary fake scaling
2020-01-24 12:50:22 -05:00
kamilritz
5a5b3a44ee Update flow interface 2020-01-24 16:49:17 +03:00
Beat Küng
0542ac0e5f fix simulator_mavlink: orb_copy requires a valid data pointer
orb_copy() just returns if data==nullptr.

Fixes lockstep for ekf2. estimator_status.time_slip now stays constant
after startup, even with high speedup factor and high system load.
2020-01-24 12:04:47 +01:00
Julian Oes
30edcad752 Revert "Simulator: Remove EKF2 based wait"
This reverts commit 1834c156d280b7562945d61ac7a711c59eb3754b.
2020-01-24 12:04:47 +01:00
mohammad
f5a81f5793 capture.result
Boolean indicating success (1) or failure (0) while capturing this image.
2020-01-24 11:42:03 +01:00
Julian Oes
1280351feb mavlink: forward everything except what is for us
The previous forwarding rules exclude another onboard MAVLink node to
send messages to a specific target.

E.g. a message from a companion computer with sysid 1 (same as
autopilot) with target sysid 190 (for the ground station) was not
forwarded.

With the new rules, anything that is not specifically addressed to the
autopilot's sysid and compid is forwarded.
2020-01-24 11:14:44 +01:00
Beat Küng
5cacf17e47 navigator mission: simplify reset logic
This can be simplified because we now only activate Mission while armed.
2020-01-24 08:42:16 +01:00
Beat Küng
92aa341c18 navigator: do not set a mode while disarmed
This avoids premature state machine execution, most notably for missions.

In particular this fixes these issues:
- when landed, and the vehicle has a valid mission: switching to mission
  would execute the first item.
- after executing a mission with a land waypoint, the mission is reset
  and the first item is executed.

In case the first waypoint is a takeoff, it would print a user message:
"Takeoff to x meters above home.". If it was a vehicle command, it would
execute that.
Note that because the vehicle is disarmed, the vehicle would not actually
do anything (except for commands that are accepted while disarmed).
2020-01-24 08:42:16 +01:00
Beat Küng
c0352027fb mc_pos_control: do not warn when going into failsafe while disarmed
It's possible to get invalid or no setpoints from navigator while disarmed.
2020-01-24 08:42:16 +01:00
kritz
47cab3dba5 Update external vision interface (#13989)
* Update external vision interface

* Update ECL Version
2020-01-23 15:36:08 +01:00
kamilritz
8d25dcd543 Update EKF auxiliary velocity interface 2020-01-23 13:27:30 +01:00
kamilritz
9d184ea3d6 Update EKF range finder interface 2020-01-23 13:27:30 +01:00
kamilritz
230d7f2558 Update EKF airspeed interface 2020-01-23 13:27:30 +01:00
kamilritz
8772e09963 Update EKF gps interface 2020-01-23 13:27:30 +01:00
kamilritz
19b7421f86 Update EKF baro interface 2020-01-23 13:27:30 +01:00
kamilritz
439a20bfcb Update EKF mag interface 2020-01-23 13:27:30 +01:00
Daniel Agar
697dbfb9f8 sensors/vehicle_imu: incremental step towards multi-EKF 2020-01-22 18:04:29 -05:00
RomanBapst
0e90448e52 navigator: add position setpoint reset helper with safe defaults
- use in reset_triplets()
2020-01-22 18:03:25 -05:00
Daniel Agar
98042bf58f
uORB: introduce SubscriptionBlocking
- uORB::SubscriptionBlocking is a specialized uORB::Subscription that allows you to do a blocking read
 - this is intended to be an easy to use, hard to misuse replacement for the typical orb fd + poll pattern we've relied on historically
2020-01-22 17:56:28 -05:00
Beat Küng
db36edffe8 commander: fix mission topic publication
The local scope caused the topic to be unadvertised, which in turn caused
a copy() failure in navigator and 'mission update failed' printf error.
2020-01-22 12:08:32 -05:00
Beat Küng
c61e44f55b commander: fix variable naming 2020-01-22 12:07:51 -05:00
Beat Küng
8bfbfa033c fix commander: avoid LED printf errors on every SITL startup 2020-01-22 12:07:51 -05:00
Daniel Agar
21a8d7db7f WorkItem modules: Run() shouldn't be public 2020-01-22 12:03:03 -05:00
Martina Rivizzigno
8162b1095b send obstacle distance data in onboard mode such that they are
received by the gcs when using mavlink router
2020-01-22 16:22:32 +01:00
Daniel Agar
cf195b0755 commander: safety button disarm require land detector
- landed, maybe_landed, or ground_contact required before the safety
button is able to disarm
 - this reduces the risk of a faulty safety button triggering in regular
flight
2020-01-21 23:35:25 +01:00