14694 Commits

Author SHA1 Message Date
Matthias Grob
10ceea2fe6 geo: refactoring on comments and usage 2021-12-06 14:30:14 +01:00
Thomas Debrunner
8db7a6225b geo: Moved the map_projection_* functions and state into a self-contained C++ class 2021-12-06 14:30:14 +01:00
PX4BuildBot
aae794965a [AUTO COMMIT] update change indication 2021-12-05 11:03:58 -05:00
Daniel Agar
2190f66096 sensors/vehicle_magnetometer: add SENS_MAG_AUTOCAL to enable initial auto cal 2021-12-01 20:24:56 -05:00
Daniel Agar
8fbf79527f magnetometer allow setting initial calibration from bias if available and stable 2021-12-01 20:24:56 -05:00
Daniel Agar
b7efd4f947
ekf2: selector treat combined test ratio > 1 as a warning
* ekf2: selector treat combined test ratio > 1 as a warning
* ekf2: wait for 1s of constant warning to trigger an instance switch

Co-authored-by: bresch <brescianimathieu@gmail.com>
2021-12-01 20:22:34 -05:00
Julian Oes
a9b9362fea commander: handle system broadcast commands
This changes the command handling logic to accept commands which are
targeted at any system, signaled by target_system set to 0.
2021-12-01 20:17:35 -05:00
alexklimaj
bfd5a90a5d UAVCAN Moving Baseline Working
Set uavcan publisher priorities

Switch to ardupilot rtcm message and add heading accuracy
2021-11-30 15:59:08 -05:00
Matthias Grob
b59db7dac2 rtl_params: change default and max rtl time margin 2021-11-30 19:46:22 +01:00
Matthias Grob
55dfbdc6a6 Commander: fix remaining flight time user messaging 2021-11-30 19:46:22 +01:00
David Jablonski
4f88c200ec vmount: fix gimbal_manager_status 2021-11-30 19:35:22 +01:00
Thomas
9345f68a93 reapply PR 18614 to refactored FlightTaskAuto 2021-11-30 14:52:16 +01:00
Julian Oes
01db98fccf vmount: fix RC pitch input scale
When scaling manual input, we should only use pitch -90 to +90 instead
of -180 to 180 degrees which leads to weird behavior as it gets passed
on by a quaternion.
2021-11-30 07:50:20 +01:00
Daniel Agar
bb562a6d10 mavlink: unify find_broadcast_address logic
- remove NuttX special handling
2021-11-29 09:08:42 -05:00
Julian Oes
7ddf43b443 mavlink_ftp: fix tests on Nuttx
On Nuttx we have an additional check whether the directory is accessible
to check if we are trying to write to storage that is not on the SD
card. This returns the FileProtected error whereas on Linux this just
ends up being a FileNotFound.

The ifdefs around this issue are not pretty but the alternatives of
either removing the tests for /bogus folders, or removing the additional
check on the NuttX side don't seem better either.
2021-11-26 15:50:28 -05:00
Julian Oes
7c90b06628 mavlink_ftp: fix tests after implementation fix
In commit 462b5721721122c94bc7a3c43ae7f37c41ee625d the reading operation
on the PX4 side was changed to only read as many bytes as requested
rather than however many fit in the payload data.

This caused the unit tests to fail which this commit here aims to fix.

What is confusing about MAVLink FTP is that there is a size field which
generally signals how many bytes of the payload data are used/set.

However, in the case of a read requst, the size field is used to
indicate how many bytes should be read. The payload data is empty in
that case though.

This case was, from how I understand it, not implemented/tested in the
unit tests and now failed. In order to implement it I had to change a
few things:
- Change _setup_ftp_msg and _send_receive_msg so that the params contain
  a data length rather than the size field. The size field itself needs
  to be set outside of these methods using payload->size.
- Since we test files smaller, equal, and bigger than one payload data
  length, I implemented that we send multiple read requests until we
  have the whole file and not just the first part.
- Additionally, I saw a lot of uninitialized warnings in valgrind, and
  got rid of them by adding a few zero initializations.
2021-11-26 15:50:28 -05:00
Silvan Fuhrer
3a9eef658c Commander: remove preflight check for transition switch
This check enforced setting a VTOL transition switch if an RC as used on a VTOL.
It comes from a time when the only way to transtion was through the RC switch,
whereas now we have also a mavlink message in place for it, so enforcing it is
no longer needed.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-11-26 11:37:40 +01:00
Daniel Agar
fc1aaa58b2
sensors/vehicle_angular_velocity: fallback sensor selection improvements
- avoid unnecessary filter reset on parameter update
 - additional minor optimizations (precomputing dt inverse, etc)
 - moving filter reset check and dynamic notch filter update checks out of the update loops
     - this were necessary previously when the scale factor wasn't applied prior to filtering the otherwise raw data
2021-11-25 22:44:05 -05:00
PX4 BuildBot
ffc52cc2fc Update submodule mavlink to latest Fri Nov 26 00:39:19 UTC 2021
- mavlink in PX4/Firmware (2328402f99b8f8931e4148d033e0b9361407d485): 5309ba449a
    - mavlink current upstream: 28163a3b39
    - Changes: 5309ba449a...28163a3b39

    28163a3b 2021-11-25 Julian Oes - dev: add new message for component capability (#1724)
5534f76b 2021-11-24 olliw42 - adding some missing MAV_TYPEs (#1679)
2021-11-25 21:37:14 -05:00
Thomas Stastny
8defbc8829 update correct airsp scale param string in ekf2 2021-11-25 11:01:04 -05:00
Matthias Grob
c5fb68b7a1 Commander: force disabling the arm stick gesture when arm switch is in use 2021-11-25 07:56:35 +01:00
Sander Swart
462b572172 Fixed mavlink_ftp read
Instead of always reading the max data length, it now properly respects the requested amount of bytes (as per documentation)
2021-11-24 17:51:29 +01:00
Matthias Grob
ea3b99e964 navigator: Remove deprecated RangeRTL unit tests 2021-11-24 14:10:24 +01:00
Matthias Grob
c522a8b15a Compute RTL time and react if lower than flight time
- Compute RTL time also during RTL
- Calculate correct altitude when finding destination
2021-11-24 14:10:24 +01:00
Matthias Grob
5489005e0b Commander: call battery_status_check on update instead of early return 2021-11-24 14:10:24 +01:00
Jukka Laitinen
5dbbddb13f EKF2: Use _distance_sensor_subs vector directly
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-11-24 09:11:45 +01:00
Jukka Laitinen
d9498ade32 EKF2: Allocate distance sensor subscriptions as member variables
Just create the subscriptions and keep them, instead of
re-creating them continuously

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-11-24 09:11:45 +01:00
Beat Küng
2809dd8944 control_allocator: remove min/max/scale params 2021-11-23 12:40:22 -05:00
Beat Küng
b29d9db7f1 control_allocator: limit status publication rate to 200Hz
Reduces CPU load by ~3.5% on F4 @2khz.
And compute getAllocatedControl as needed (~1.5% CPU reduction)
2021-11-23 12:40:22 -05:00
Beat Küng
bcba3dfe52 control_allocator,angular_velocity_controller: run on rate_ctrl wq 2021-11-23 12:40:22 -05:00
Beat Küng
a0e43bca96 msg: remove unused vehicle_actuator_setpoint topic 2021-11-23 12:40:22 -05:00
Beat Küng
52a2ef34fd mixer_module: add THR_MDL_FAC for SYS_CTRL_ALLOC=1 2021-11-23 12:40:22 -05:00
Beat Küng
4346ac4a37 control_allocator: add mixer metadata 2021-11-23 12:40:22 -05:00
Beat Küng
282d35bbf0 esc_calibration: handle SYS_CTRL_ALLOC==1 2021-11-23 12:40:22 -05:00
Beat Küng
21699935e8 vehicle_command: add VEHICLE_CMD_ACTUATOR_TEST and VEHICLE_CMD_CONFIGURE_ACTUATOR 2021-11-23 12:40:22 -05:00
Beat Küng
f99c2617ad control_allocator: add module.yaml, add CA_MC_R_COUNT param & update defaults 2021-11-23 12:40:22 -05:00
Matthias Grob
0153c870d2 Commander: make sure yaw airmode is not possible while arm gesture is enabled
It's unsafe to arm with the gesture when yaw airmode is enabled
because e.g. in Stabilized mode that results in a high yawrate setpoint
that the drone tries to follow even with zero thrust
because of the airmode.

It was handled before by checking the arm switch parameter because that
used to disable the stick arm gesture.
See 24dc316973a049e50d3e6760eddbf7250cb55d2e
2021-11-23 16:03:46 +01:00
Matthias Grob
572890f8c0 ManualControl: add parameter to disable arm/disarm stick gesture 2021-11-23 16:03:46 +01:00
Matthias Grob
468022abba ManualControl: correct arm hysteresis parameter name 2021-11-23 16:03:46 +01:00
Matthias Grob
c84b1c6566 ManualControl: ignore unassigned mode slots
They were resulting in a message
"Switching to Unkown is currently not available".
2021-11-23 16:03:46 +01:00
Daniel Agar
7ff72304b4
sensors/vehicle_imu: improve disabled sensor handling
- remove regular callback scheduling when sensor is disabled, register if re-enabled
2021-11-22 21:10:35 -05:00
Daniel Agar
577d926639 commander: improve angular velocity validity and message 2021-11-22 11:27:45 -05:00
PX4 BuildBot
88d9ade4d7 Update submodule mavlink to latest Mon Nov 22 12:39:21 UTC 2021
- mavlink in PX4/Firmware (0e4e8162407a12dc09c8d17635c60d4036b81bc7): c3a4b52eb1
    - mavlink current upstream: 5309ba449a
    - Changes: c3a4b52eb1...5309ba449a

    5309ba44 2021-11-18 Hamish Willee - Remove backticks - these do not render as a style so not helpful (#1745)
9cac0e5a 2021-11-17 David Jablonski - docs: catch more hyperlinks (#1744)
ea9349b5 2021-11-16 David Jablonski - common: add SET_FOCUS_TYPE_AUTO (#1741)
2021-11-22 09:08:50 -05:00
Daniel Agar
8fc3b05491 mavlink: param_get proper type to silence errors 2021-11-22 09:08:38 -05:00
wangwwno1
7a1a4ea7a6 Format fix & Remove redundant lines 2021-11-20 16:13:46 +01:00
wangwwno1
51ce8306ee Remove redundant code out of hil_lpos 2021-11-20 16:13:46 +01:00
wangwwno1
b2c5919d29 Update src/modules/simulator/simulator_mavlink.cpp
Co-authored-by: JaeyoungLim <jalim@ethz.ch>
2021-11-20 16:13:46 +01:00
wangwwno1
160fec5f25 Update simulator_mavlink.cpp 2021-11-20 16:13:46 +01:00
wangwwno1
6e2060ddb6 Add accel to vehicle_local_position_groundtruth
Related Issue: #18527 
According to [this doc](92b1a43468/common/mavlink_msg_hil_state_quaternion.h (L102)), the *acc value are mili-Gee, so multiply the value with `CONSTANT_ONE_G/1000.0f` would get the acceleration in `m/s`.
2021-11-20 16:13:46 +01:00
Daniel Agar
505f963dd0 mavlink: receiver fix SENS_FLOW_ROT type 2021-11-19 21:08:04 -05:00