462 Commits

Author SHA1 Message Date
Martina Rivizzigno
55563eba49 MPC_SPOOLUP_TIME -> COM_SPOOLUP_TIME 2022-06-24 19:44:43 +02:00
Junwoo Hwang
8bae4e5c0e FollowMe : Replace First order target position filter with Second order position and velocity filter
Follow me : tidied second order filter implementation

Added velocity filtered info to uORB follow target status message, and rebase to potaito/new-follow-me-task

FollowMe : Rebasing and missing definition fixes on target position second order filter

Follow Me : Remove Alpha filter delay compensation code, since second order filter is used for pose filtering now

Followme : Remove unused target pose estimation update function

Follow Target : Added Target orientation estimation logic

Follow Target : Replaced offset vector based setpoint to rate controlled orbital angle control

Follow Target : Bug fixes and first working version of rate based control logic, still buggy

Follow Target : Added target orientation, follow angle, orbit angle value into follow_target_status uORB message for debugging

Follow Target : Fix orbit angle step calculation typo bug

Follow Target : Few more fixes

Follow Target : Few fixes and follow angle value logging bug fix

Follow Target : Added lowpass alpha filter for yaw setpoint filtering

Follow Target : Remove unused filter delay compensation param

Follow Target : Add Yaw setpoint filter initialization logic and bufix for when unwrap had an input of NAN angle value

Follow Target : Add Yaw setpoint filtering enabler parameter

Follow Target : Change Target Velocity Deadzone to 1.0 m/s, to accomodate walking speed of 1.5 m/s

Follow Target : Add Orbit Tangential Velocity calculation for velocity setpoint and logging uORB topics

Follow target : Fix indentation in yaw setpoint filtering logic

Follow Target : Fix Follow Target Estimator timeout logic bug that was making the 2nd order pose filter reset to raw value every loop

Follow Target : Remove debug printf statement for target pose filter reset check

Follow Target : Add pose filter natural frequency parameter for filter testing

Follow Target : Make target following side param selectable and add target pose filter natural frequency param description

Follow Target : Add Terrain following altitude mode and make 2D altitude mode keep altitude relative to the home position, instead of raw local position origin

Follow Target : Log follow target estimator & status at full rate for filter characteristics test

Follow Target : Implementing RC control user input for Follow Target control

Follow Target : edit to conform to updated unwrap_pi function

Follow Target : Make follow angle, distance and height RC command input configurable

Follow Target : Make Follow Target not interruptable by moving joystick in Commander

Follow Target : reconfigure yaw, pitch and roll for better user experience in RC adjusting configurations, and add angular rate limit taking target distance into account

Follow Target : Change RC channels used for adjustments and re-order header file for clarity

Follow Target : Fix Parameters custom parent macro, since using DEFINE_PARAMETERS alone misses the parameter updates of the parent class, FlightTask

Follow Target : Fix Orbit Tangential speed actually being angular rate bug, which was causing a phenomenon of drnoe getting 'dragged' towards the target velocity direction

Follow Target : Final tidying and refactoring for master merge - step 1

Add more comments on header file

Follow Target : tidy, remove unnecessary debug uORB elements from follow_target_status message

Follow Target : Turn off Yaw filtering by default

Follow Target : Tidy maximum orbital velocity calculation

Follow Target : add yaw setpoint filter time constant parameter for testing and fix NAV_FT_HT title

Follow Target : Add RC adjustment window logic to prevent drone not catching up the change of follow target parameters

Follow Target : fixes

Follow Target: PR tidy few edits remove, and update comments

Follow Target : apply comments and reviews

Follow Target : Edit according to review comments part 2

Follow Target : Split RC adjustment code and other refactors

- Splitted the RC adjustment into follow angle, height and distance
- Added Parameter change detection to reset the follow properties
- Added comments and removed yaw setpoint filter enabler logic

Follow Target : Modify orbit angle error bufferzone bug that was causing excessive velocity setpoints when setpoint catched up with raw orbit setpoint

Follow Target : Remove buffer zone velocity ramp down logic and add acceleration and rate limited Trajectory generation library for orbit angle and velocity setpoint

Follow Target : Remove internally tracked data from local scope function's parameters to simplify code

Follow Target : Fix to track unwrapped orbit angle, with no wrapping

Follow Target : Apply user adjustment deadzone to reduce sensitivity

Follow Target : Apply suggestions from PR review round 2 by @potaito

Revert submodule update changes, fall back to potaito/new-followme-task

Follow Target : [Debug] Expose max vel and acceleration settings as parameters, instead of using Multicopter Position Controller
's settings

Follow Target : Use matrix::isEqualF() function to compare floats

Follow Target : Add Acceleration feedback enabler parameter and Velocity ramp in initial commit for overshoot phenomenon improvement

Follow Target : Implement Velocity feed forward limit and debug logging values

Follow Target : Apply Velocity Ramp-in for Acceleration as well & Apply it to total velocity setpoint and not just orbit tangential velocity component

Follow Target : Don't set Acceleration setpoint if not commanded

Follow Target : Use Jerk limited orbit angle control. Add orbit angle tracking related uORB values"

Follow Target : Add Orbit Angle Setpoint Rate Tracking filter, to take into consideration for calculating velocity setpoint for trajectory generator for orbit angle

Revert "Follow Target : Add Orbit Angle Setpoint Rate Tracking filter, to take into consideration for calculating velocity setpoint for trajectory generator for orbit angle"

This reverts commit a3f48ac7652adb70baf3a2fed3ea34d77cbd6a70.

Follow Target : Take Unfiltered target velocity into acount for target course calculation to fix overshoot orbit angle 180 deg flip problem

Follow Target : Remove Yaw Filter since it doesn't make a big difference in yaw jitterness

Follow Target : Remove velocity ramp in control & remove debug values from follow_target_status.msg

Follow Target : Tidy Follow Target Status message logging code

Follow Target : Remove jerk and acceleration settings from Follow Target orbit trajectory generation

Follow Target : Change PublicationMulti into Publication, since topics published are single instances

Follow Target : Edit comments to reflect changes in the final revision of Follow Target

Follow Target : Apply incorrectly merged conflicts during rebase & update Sticks function usage for getThrottled()

Follow Target : Apply final review comments before merge into Alessandro's PR

Apply further changes from the PR review, like units

Use RC Sticks' Expo() function for user adjustments to decrease sensitivity around the center (0 value)

Update Function styles to lowerCamelCase

And make functions const & return the params, rather than modifying them
internally via pointer / reference

Specify kFollowPerspective enum as uint8_t, so that it can't be set to negative value when converted from the parameter 'FLW_TGT_FP'

Fix bug in updateParams() to reset internally tracked params if they actually changed.

Remove unnecessary comments

Fix format of the Follow Target code

Fix Follow Perspective Param metadata

follow-me: use new trajectory_setpoint msg

Convert FollowPerspective enum into a Follow Angle float value

1. Increases flexibility in user's side, to set any arbitrary follow
angle [deg]
2. Removes the need to have a dedicated Enum, which can be a hassle to
make it match MAVSDK's side
3. A step in the direction of adding a proper Follow Mode (Perspective)
mode support, where we can support kite mode (drone behaves as if it is
hovering & getting dragged by the target with a leash) or a constant
orbit angle mode (Drone always on the East / North / etc. side, for
cinematic shots)

Continue fixing Follow Target MAVSDK code to match MAVSDK changes

- Support Follow Angle configuration instead of Follow Direction
- Change follow position tolerance logic to use the follow angle
*Still work in progress!

Update Follow Me MAVSDK Test Code to match MAVSDK v2 spec

- Add RC Adjustment Test case
- Change follow direction logic to follow angle based logic completely
- Cleanup on variable names and comment on code

follow-me: disable SITL test

Need to update MAVSDK with the following PR:
https://github.com/mavlink/MAVSDK/pull/1770

SITL is failing now because the follow-me
perspectives are no longer defined the
same way in MAVSDK and in the flight task.

update copyright year

follow-me: mark uORB topics optional

Apply review comments

more copyright years

follow-me sitl test: simpler "state machine"

flight_mode_manager: exclude AutoFollowTarget and Orbit on flash contrained boards

Remove unnecessary follow_target_status message properties

- As it eats up FLASH and consumes uLog bandwidth
2022-06-16 16:14:57 -04:00
Matthias Grob
92b6862485 Commander: replace arm requirements 2022-06-16 10:25:32 -04:00
Matthias Grob
3b3d8b9942 Commander: execute pre arm check with preflight checks 2022-06-16 10:25:32 -04:00
Matthias Grob
aa575d6af0 Commander: move first preflight check run to constructor 2022-06-16 10:25:32 -04:00
Matthias Grob
c59809b14a Commander: remove system_sensors_initialized
and system_hotplug_timeout. They're not in use for over 2 years.
Instead control LED with preflight checks.
2022-06-15 14:02:00 -04:00
Matthias Grob
f5e7b1e6a8 Commander: switch battery bitflied to dedicated datatype 2022-06-08 11:32:26 +02:00
Matthias Grob
bd50a52c9c Commander: fix startup sound interrupted by safety button initialization
The safetyButtonHandler() reports that the safety statatus
changed on the first loop iteration when safety is disabled which makes
sense to inform the system that safety is off but the tune for the user
should not be played because it interrupts the startup tune.
2022-06-08 05:12:05 -04:00
Matthias Grob
44c4b8fa85 Style refactoring related to safety button 2022-06-08 05:12:05 -04:00
Matthias Grob
83c15fca9f Commander: switch back to Hold mode after autonomous landing 2022-06-01 12:08:32 +12:00
Matthias Grob
33df8b24f2 Commander: differentiate clearly between to arm and to disarm transition 2022-06-01 12:08:32 +12:00
Matthias Grob
400e1f8214 Commander: only initialize to tablet mode and don't switch back on RC loss 2022-06-01 12:08:32 +12:00
Matthias Grob
c03f5b9481 Commander: fix overlooked rebase naming error 2022-05-25 21:10:19 +02:00
alessandro
29c4119e24
Match commander uORB var names to message names (#19707)
* match vehicle_status

* match home_position

* match vehicle_command_ack

* match actuator_armed

* match vehicle_control_mode

* match commander_state
2022-05-25 17:08:48 +02:00
Matthias Grob
0be474430c Commander: don't disarm on landing amid a mission 2022-05-24 13:42:03 +02:00
Igor Misic
08dcc72e1f commander/safety: replace safety.msg with Safety class (#19558) 2022-05-23 06:54:37 +02:00
Daniel Agar
c40631c136
commander: handle RC loss timeout if manual_control_setpoint stops publishing (#19680)
Co-authored-by: Matthias Grob <maetugr@gmail.com>
2022-05-20 19:37:30 -04:00
Julian Oes
33a77c225c commander: lockdown is not termination
We use lockdown to prevent outputs like motors and servos from being
active in HITL simulation. This means that we can't treat the lockdown
flag as a flight_terminated, otherwise we can't arm in HITL at all.
2022-05-20 09:43:32 -04:00
Nico van Duijn
04071b9456 Commander: ignore MAV_CMD_REQUEST_MSG
This commit adds the MAV_CMD_REQUEST_MESSAGE to the list of vehicle
commands which are ignored without generating a warning sound.
2022-05-20 15:36:42 +02:00
Matthias Grob
38e027ee45 ArmStateMachine: remove dependency on armed.armed
To have the internal state as single source of truth
for the arming state within Commander.
2022-05-20 13:51:51 +02:00
Matthias Grob
37c485ce89 ArmStateMachine: move arm state into the class 2022-05-20 13:51:51 +02:00
Matthias Grob
47532ca07b ArmStateMachine: replace state name array with method 2022-05-20 13:51:51 +02:00
Daniel Agar
fd4b62032e
commander: publish actuator_armed first on any change 2022-05-19 12:47:50 -04:00
Silvan Fuhrer
2b7efeacca vtol_vehicle_status: replace several status bools by single vehicle_vtol_state
Replace vtol_in_rw_mode, vtol_in_trans_mode, in_transition_to_fw by vehicle_vtol_state.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-18 10:01:04 +02:00
Silvan Fuhrer
635f64a2e5 Commander: remove permanent stabilization option for fixed-wing flight
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-18 10:01:04 +02:00
Alessandro Simovic
fb71e7587c failure_detector: add motor/ESC failure detection 2022-05-12 07:58:56 +02:00
Daniel Agar
c772e5230f
commander: remove compile time dependencies on non-commander parameters
- this allows builds with mavlink fully disabled
 - move commander MAN_ARM_GESTURE, RC_MAP_ARM_SW, MC_AIRMODE checks to manual_control
2022-05-11 10:14:23 -04:00
Silvan Fuhrer
5d6c8c986d Commander: high wind speed handling updates
- add logic for detecting high wind speed in Commander,
and handle it toghether with wind speed warning
- trigger and enforce RTL if COM_WIND_MAX is breached

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-09 19:09:40 +02:00
Silvan Fuhrer
1aad82f87d Commander: add max flight time RTL
Adds COM_FLT_TIME_MAX param and logic in Commander to enforce RTL when
flight time is above this value. User can only override to LAND mode,
but not proceed flight beyond that.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-09 19:09:40 +02:00
Matthias Grob
b3776134b8 Commander: ensure diconnected battery is cleared from bit field 2022-05-06 10:32:27 -04:00
Alex Mikhalev
45dff7f71a commander: Add prearm check for flight termination 2022-04-25 11:57:37 -04:00
Junwoo Hwang
af839c828d Set Tune's Volume for Power-Off in Commander to default volume of tune_control message 2022-04-25 11:47:43 -04:00
bresch
3c6b72c33b commander: improve set_in_air_position
- set local home using global pos and global home
- set local home using GNSS pos and global home
- set global home using global ref of local frame and local home
2022-04-19 15:29:25 +02:00
bresch
d2f2ba59a4 commander: refactor home position setter
- always try to set local or global home position when possible
- set global home with GNSS position if global pos from EKF isn't
  available
- reset home when significantly moved from home before takeoff (checking
  lpos or gpos or GNSS)
- reset home on takeoff transition
- reset home on mavlink arm command
- remove "home required accuracy" parameters, rely on validity flags
2022-04-19 15:29:25 +02:00
Thomas Debrunner
f6bdc42977 param-reset: Add option to reset all configurable params, but not the ones that store vehicle information 2022-04-14 07:57:48 +02:00
Matthias Grob
f968a5947d ArmStateMachine: port arming_state_names into the class 2022-04-06 10:02:14 +02:00
Matthias Grob
074080c816 Commander: separate out arm state machine to class
Pure refactoring and just the first step to avoid conflicts on the way.
2022-04-06 10:02:14 +02:00
Igor Misic
80aef942cd safety and safety button: refactoring #19413 2022-04-05 07:57:37 +02:00
Daniel Agar
8c3ba7adb4 commander: silence GPS no longer validity PX4_WARN 2022-04-04 14:43:11 -04:00
Daniel Agar
0c31f63896 sensors: add baro calibration and cleanup
- sensor_baro.msg use SI (pressure in Pascals)
 - update all barometer drivers to publish directly and remove PX4Barometer helper
 - introduce baro cal (offset) mainly as a mechanism to adjust
relative priority
 - commander: add simple baro cal that sets baro offsets to align with
GPS altitude (if available)
 - create new sensors_status.msg to generalize sensor reporting
2022-03-26 16:08:41 -04:00
Daniel Agar
875a2cc423 commander: remove loop counters and update UI LED control to use monotonic time 2022-03-24 22:43:26 -04:00
Daniel Agar
879622547c commander: only process one vehicle_command/action_request per cycle
- things like arming requests can be dependent on current nav state
that might requested by a previous command, but the state machine
transition will only happen after command processing
2022-03-24 22:43:26 -04:00
Jonas Perolini
e31304d7d5
Quadchute param update (#19351)
New parameter for actions after a quadchute (COM_QC_ACT)

Co-authored-by: Jonas <jonas.perolini@rigi.tech>
Co-authored-by: Matthias Grob <maetugr@gmail.com>
2022-03-24 10:27:32 +01:00
Matthias Grob
e6ed595651 Commander: make last_fail_time_us parameter a reference instead of pointer 2022-03-23 15:04:48 -04:00
Matthias Grob
eee4aaee4f Commander: remove dynamic position velocity probation period 2022-03-23 15:04:48 -04:00
Silvan Fuhrer
a7ddaf08c4 vehicle_status_flags.msg: remove condition_ prefix to reduce message size
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-03-23 10:37:51 -04:00
Matthias Grob
db1fb6acf7 Commander: no battery time based RTL when already landed 2022-03-23 10:49:38 +01:00
Matthias Grob
b85c4ec475 Commander: rename land detection subscription for consistency 2022-03-23 10:49:38 +01:00
bresch
182980526f commander: allow rearming grace period for arming switch only 2022-03-09 08:42:21 +01:00
Daniel Agar
11f617ca9b ekf2: default to in air and not at rest
- this is a more conservative default if a vehicle isn't set (no land detector running)
 - handled horizontal preflight failures in commander when disarmed
rather than overloading xy_valid and v_xy_valid flags
 - ekf2 no longer depend on arming or standby status
2022-02-22 16:59:10 -05:00