15826 Commits

Author SHA1 Message Date
Silvan Fuhrer
83e906e2e9 Control_allocator_status.msg: remove allocated_ fields
It's enough that the setpoints and the unallocated values are logged, from these
 the allocated values can be calculated if required.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-02 14:56:13 +01:00
Silvan Fuhrer
f44713e8a3 ControlAllocator: enable custom saturation logic to override default one
Custom saturation logic currently implemented for Tiltrotor VTOL and Helicopter.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-02 14:56:13 +01:00
Silvan Fuhrer
2e20fb7f97 ActuatorEffectiveness: add _collective_ keyword to controls for collective tilt to disinct from yaw tilt
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-02 14:56:13 +01:00
Matthias Grob
7667883385 MulticopterLandDetector: make in descend detection depend on vertical speed threshold
It's very important that the in descend detection is always
at a strictly higher velocity than the vertical movement check.
This combination is basically used to check for vertical downwards
velocity tracking. Desired descend, no movement -> ground

If in descend threshold is lower than vertical movement it is
by definition even with perfect tracking the case that with
any velocity between the two thresholds there is no movement
even though a descend is commanded.

See first fix of this problem #7831
e39b38ba96971245aaf6d2b1c249868c8717665e
2022-11-01 18:35:54 +01:00
Matthias Grob
ac646d32e6 MulticopterLandDetector: Apply threshold widening only when landed, not maybe landed 2022-11-01 18:35:54 +01:00
Matthias Grob
509c37c373 MulticopterLandDetector: use quick access for xy angular velocity components 2022-11-01 18:35:54 +01:00
Matthias Grob
d9764f2ef4 MulticopterLandDetector: rename vertical velocity threshold variable 2022-11-01 18:35:54 +01:00
Silvan Fuhrer
06bf60672b MC LandDetector: add constant (0.3) for vz threshold for in_descend flag
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-01 18:35:54 +01:00
Silvan Fuhrer
4e74473932 MC LandDetector: remove 2s phase after not maybe landed to still increase thresholds
I don't see where this is necessary. During takeoff, the maybe landed flag should
only get cleared once system is about to takeoff, and thus well after the spool up
is complete (for which the higher thresholds are meant in this case).

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-01 18:35:54 +01:00
Silvan Fuhrer
91adb4c9e0 MC LandDetector: widen thresholds for vz and rotational movment always in maybe landed and 2s after
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-01 18:35:54 +01:00
Silvan Fuhrer
27309a45cc MC LandDetector: remove dependency on MPC_LAND_SPEED and MPC_LAND_CRWL
Don't consider these params for vertical speed threshold,
and instead increase the default for LNDMC_Z_VEL_MAX and
use solely that one. Makes the land detector outcome more
predictable and its interal logic simpler, while the new
default tuning is resulting in about the same vz threshold
as before.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-01 18:35:54 +01:00
Silvan Fuhrer
263c7923d6 MPC params: MPC_LAN_CRWL: fix description and reduce min
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-01 18:35:54 +01:00
Silvan Fuhrer
bace45ba8d LandDetector: log rotational_movement
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-01 18:35:54 +01:00
JaeyoungLim
a90857f651
FW separate reset integrals for messages (#20502)
This commit separates integral resets for attitude and rate control setpoints
2022-11-01 06:06:27 +01:00
JaeyoungLim
3f5d7f38cd
Handle waypoint altitude acceptance radius for boats (#20508)
This corrects the waypoint handling logic to include boat type vehicles
2022-10-31 09:13:13 +01:00
PX4 BuildBot
80af8262b5 Update submodule mavlink to latest Sat Oct 29 12:39:05 UTC 2022
- mavlink in PX4/Firmware (f8b38591ac0bd31a87cb38ae4b2f7dd74400cda2): dda5a18ddb
    - mavlink current upstream: d012c7afd5
    - Changes: dda5a18ddb...d012c7afd5

    d012c7af 2022-10-27 Hamish Willee - update pymavlink to latest (#1906)
e1058881 2022-10-27 Hamish Willee - BATTERY_STATUS_V2 - update to 20221013 RFC version (#1846)
27007cc3 2022-10-25 Hamish Willee - fix typo MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST (#1904)
00007aca 2022-10-19 Hamish Willee - SET_DEFAULT_INTERVAL may be 0 (#1903)
af35d3a4 2022-10-09 Ashish Kurmi - ci: add minimum GitHub token permissions for workflow (#1898)
33dde554 2022-10-09 Siddharth Bharat Purohit - add vendor specs for cubepilot (#1901)
2022-10-29 10:56:25 -04:00
Thomas Stastny
498937c56c fw rate control: initialize rate control resets to false in stabilized mode
before there was a corner case where if in an auto mode that sets a reset command on the attitude setpoint message (e.g. auto takeoff), if the mode was then switched stabilized, this reset bool would never be changed back to false and the integrators would reset every cycle
2022-10-28 09:26:51 +02:00
Zachary Lowell
824e02a8b6
Qurt tasks implementation (#20499) 2022-10-27 14:46:47 -07:00
Silvan Fuhrer
5edbc2f80a Navigator: remove update of reposition setpoint at Transition command
This was previously required to reset the flight speed after a VTOL transition,
but is now no longer required as the DO_CHANGE_SPEED commands are handles directly
in the controllers.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-10-27 11:04:22 +02:00
Silvan Fuhrer
473b471fb6 Navigator: add guards for using mission_item.loiter_radius only if finite and >FLT_EPS
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-10-27 10:28:05 +02:00
Silvan Fuhrer
605d4c47b9 Navigator: initialize _mission_item for all navigation modes in Navigator::Navigator()
This fixes the issue where the init happended in the initializer list, at which point
the params were not yet initialized and thus resulted in random values for the init
values of _mission_item.loiter_radius and .acceptance_radius.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-10-27 10:28:05 +02:00
Junwoo Hwang
c2b2ae55d9 payload_deliverer: Refactor & Handle vehicle command conflicts
Refactor
- Require reboot for PD_GRIPPER_EN parameter change
- Define gripper ACTION_NONE for readability. This makes implicit assumption that -1 equals no-action commanded more explicit
- Tidy the scattered vcmd_ack struct handling cases into a single function
- Refactor to remove return in the middle of function: avoids future complications where a programmer may expect the logic at the end of the function to be executed, but isn't

Vehicle Command Handling
- Cancel the previous running vehicle command if we receive a different vehicle command
- Reject vehicle command if we get a same one that is getting executed
- Save the source system & component of currently running vehicle command
- Added note about new discovered edge case of having same entity sending different gripper commands consequently, where an unexpected ack result may be received
2022-10-27 07:51:17 +02:00
Junwoo Hwang
6529e39f8b payload_deliverer & gripper: Improve intermediate state & vcmd_ack
Gripper:
- Don't command gripper (via uORB `gripper` topic, which maps into an
actuator via Control Allocation) if we are already at the state we want
(e.g. Grabbed / Released) or in the intermediate state to the state we
want -> This prevents spamming on `gripper` topic

Payload Deliverer:
- Add read-once function for Gripper's released / grabbed state
- Send vehicle_command_ack for both release/grab actions.

TODO: target_system & target_component for the released/grabbed vcmd_ack
is incomplete, since we are not keeping track of the vehicle_command
that corresponds to this. This needs to be dealt with in the future, not
sure what the best solution it is for now.

Possible solutions:
- Queue-ing the vehicle command?
- Tying the gripper's action to specific vehicle command one-on-one, to make sure if we send multiple vehicle commands, we know
which command resulted in the action exactly?)

Only command Gripper grab when we are actually initializing gripper

- Previously, on every parameter update, gripper grab was being
commanded
- This commit narrows that scope to only when we are actually
initializing the gripper

Handle gripper de-initialization upon parameter change

- Also added some local state initialization code to init() function of
Gripper
- This will now make init / de-init more graceful & controlled compared
to before
2022-10-27 07:51:17 +02:00
Junwoo Hwang
36a3c716d6 Send IN_PROGRESS command ack when actuating gripper
- This hopefully then alerts the GCS that the command is getting
processed
- Referenced commander's `handle_command` function to implement this. As
it seems like GCS needs the acknowledgement of the command being
processed to execute such commands properly
- Also send FAILED command ack if we can't actuate the gripper

Fix wrong GRIPPER_ACTION conversion from floating point to int32_t

- Due to the MAVLink spec, we actually just convert enums into floating
point, so in PX4 we need to convert the float directly into integer as
well (although there can be precision issues on large numbers)
- This is a limitation in MAVLink spec, and should hopefully be
changed in MAVLink v2
2022-10-27 07:51:17 +02:00
Zachary Lowell
740d2fccb1
qurt: update for functional logger 2022-10-25 21:07:15 -04:00
Daniel Agar
a242a0210e
Update world_magnetic_model to latest Mon 24 Oct 2022 09:29:11 PM EDT 2022-10-25 09:20:01 -04:00
Daniel Agar
c32cf21b63 commander: estimator check shorten messages
- otherwise these are awkwardly split in mavlink
2022-10-25 08:02:47 +02:00
Daniel Agar
a7b909234b commander: estimator nav test is not an arming check 2022-10-25 08:01:30 +02:00
Daniel Agar
6f861ba889 ekf2: pos/vel reset helpers pass new variance
- optical flow velocity reset use already computed _flow_vel_ne
2022-10-24 10:59:58 -04:00
thomas
f9f466854b abort front transition in vtol module instead of in navigator/rtl.cpp 2022-10-24 13:55:41 +02:00
thomas
26c36a96f2 remove unnecessary check. correct int comparison. 2022-10-24 13:55:41 +02:00
thomas
bf98503dec better return altitude initialisation 2022-10-24 13:55:41 +02:00
thomas
f771c7ff63 back transition if RTL is called during front transition 2022-10-24 13:55:41 +02:00
Hamish Willee
96a305322a
params/uorb docs: rename mixer to control allocation (#20447) 2022-10-24 13:22:26 +02:00
Igor Mišić
1c5750b292 mavlink: add support for uAvionix transmitters 2022-10-24 11:56:17 +02:00
Igor Mišić
4e6c094a54 mavlink/CMakeLists: add uAvionix dialect 2022-10-24 11:56:17 +02:00
Daniel Agar
ed558e199f ekf2: remove realignYawGPS() (replaced with yaw estimator) 2022-10-21 09:01:30 -04:00
Silvan Fuhrer
c267cf71c3 FW Position Control: fix entering of no-position-estimate failsafes
Affects the states AUTO_ALTITUDE and AUTO_CLIMBRATE. Those modes should only be entered
if armed (as they are pure failsafe modes). Also allow though to enter them even if
the position setpoint(s) are invalid, as they are not needed.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-10-21 09:51:38 +02:00
Silvan Fuhrer
67b2c835e0 FW Positon control: do not use position_setpoint.valid to validate current position_setpoint
Instead of checking the .valid flag of position_setpoint, check for ISFINITE() of lat, lon, alt
    when pulling the position_setpoint triplet. This fixes problems where the .valid flag didn't
    reflect the proper state of the setpoint (e.g. .valid was true, .lat though NAN)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-10-21 09:51:38 +02:00
bresch
96e7ea7a08 ekf2: remove old mag declination auto-code 2022-10-20 18:16:25 -04:00
bresch
f0a0a3e545 ekf2_test: compare mag decl fusion sympy vs symforce 2022-10-20 18:16:25 -04:00
bresch
2f3ea88099 ekf2: migrate mag declination to SymForce 2022-10-20 18:16:25 -04:00
Daniel Agar
5030b21d2e ekf2: replace quatToInverseRotMat if only used once 2022-10-20 14:15:32 -04:00
Daniel Agar
fb3adc3faa
ekf2: move baro compensation to delayed time horizon and add validity check
- this removes an unnecessary virtual call and simplifies things a bit

Co-authored-by: bresch <brescianimathieu@gmail.com>
2022-10-20 09:17:55 -04:00
Daniel Agar
b400b7fcc4
vehicle_angular_velocity: ESC RPM notch filters minimize filter resets (#20449)
- vehicle_angular_velocity: ESC RPM notch filters minimize filter resets
 - only allow one filter init per axis per cycle
 - "park" ESC notch filters at min frequency instead of full disable
 - relax timeout before a notch filter is disabled
 - add new parameter IMU_GYRO_DNF_MIN for configuring the minimum notch filter frequency
2022-10-20 09:05:23 -04:00
Daniel Agar
fe80e7aa46
commander: respect COM_CPU_MAX for overload and adjust default threshold 2022-10-19 20:25:06 -04:00
Daniel Agar
309465858a
commander: elapsed time checks avoid subtracting unsigned integers
- avoid the possibility of unsigned underflow from subtracting two HRT timestamps (uint64_t)
 - most of these aren't problematic, but people tend to replicate the pattern, so it's better to be safe
 - likely wasn't a problem when people were using hrt_absolute_time() in place, but if using an existing timestamp there's the possibility it's older than a more recent topic update
2022-10-19 20:21:36 -04:00
Daniel Agar
cea185268e
msg ROS2 compatibility, microdds_client improvements (timesync, reduced code size, added topics, etc), fastrtps purge
- update all msgs to be directly compatible with ROS2
 - microdds_client improvements
   - timesync
   - reduced code size
   - add to most default builds if we can afford it
   - lots of other little changes
 - purge fastrtps (I tried to save this multiple times, but kept hitting roadblocks)
2022-10-19 19:36:47 -04:00
Daniel Agar
e211e0ca0e commander: limit some estimator checks to prearm 2022-10-19 19:06:56 -04:00
Daniel Agar
f9509b442c
ekf2: height aid source consistency (#20405)
- working towards keeping all height source (baro/ev/gnss/rng) handling as consistent as possible, possibly refactoring these out into separate classes later
2022-10-19 15:35:07 -04:00