Commit Graph

40797 Commits

Author SHA1 Message Date
Matthias Grob 3a239ff649 examples: remove empty fake_gyro 2022-06-24 10:05:16 -05:00
CUAVhonglang cfa8b451c7 cuav-nora: changed brick to compatible with cuav noraplus 2022-06-24 10:03:43 -05:00
CR ffb0097052 removed unused code - _constrainOneSide and _constrainAbs 2022-06-22 23:21:16 +02:00
Matthias Grob 479c85047f WeatherVane: Allow weathervane on multirotors not just VTOLs 2022-06-22 14:19:28 +02:00
Matthias Grob 54145cedc7 FlightTask: Weather vane cleanup
Remove the entire external yaw handler, dynamic memory allocation,
pointer passing logic. Directly instanciate the weather vane instance
in the flight tasks that support it.
2022-06-22 14:19:28 +02:00
Daniel Agar ab4e10dc26 paa3905: update scaling from datasheet 2022-06-21 16:59:14 -04:00
Daniel Agar 07e28fda7a paw3902: update scaling from datasheet 2022-06-21 16:59:14 -04:00
Daniel Agar dc8ed97809 ekf2: optical flow control limits constrain speed using HAGL max 2022-06-21 12:52:25 -04:00
Daniel Agar 15747239c1 mc_pos_control: always respect position estimate vxy_max if set
Co-authored-by: Matthias Grob <maetugr@gmail.com>
2022-06-21 12:52:25 -04:00
Daniel Agar 5d2dfadb0e
boards: px4_fmu-v5_uavcanv0periph disable modules to save flash 2022-06-20 21:31:27 -04:00
Daniel Agar e5f081d9ac drivers/optical_flow/paa3905: cleanup/overhaul
- remove internal accumulation and publish every valid raw sample synchronized with sensor
 - store timestamp_sample from motion interrupt
 - improve timing requirements from datasheet (minimum delays after register read/write)
2022-06-20 20:56:56 -04:00
Daniel Agar 1fbe3c4ab3 drivers/optical_flow/paw3902: cleanup/overhaul
- remove internal accumulation and publish every valid raw sample synchronized with sensor
 - store timestamp_sample from motion interrupt
 - improve timing requirements from datasheet (minimum delays after register read/write)
2022-06-20 20:56:56 -04:00
Daniel Agar d5839e2dd5 optical flow sensor pipeline overhaul
- all sources of optical flow publish sensor_optical_flow
 - sensor_optical_flow is aggregated by the sensors module, aligned with integrated gyro, and published as vehicle_optical_flow

Co-authored-by: alexklimaj <alex@arkelectron.com>
2022-06-20 20:56:56 -04:00
Chuck 32544452f0
drivers: Sagetech MXS transponder support
Co-authored-by: Megan McCormick <megan.mccormick@sagetech.com>
Co-authored-by: Chuck Faber <chuck.faber@sagetech.com>
2022-06-20 18:16:07 -04:00
Claudio Micheli 9d486b1ccd
esc_battery: account for online ESCs when averaging voltage
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2022-06-20 18:14:13 -04:00
Daniel Agar 450fcca8b8
drivers/differential_pressure/Kconfig: remove ets and ms4515 from common sensors to save flash 2022-06-20 13:04:19 -04:00
Daniel Agar 8d2e8ef422
boards: px4_fmu-v5_test disable gyro_fft module to save flash 2022-06-20 13:04:19 -04:00
Bruce Meagher 714234ca90
posix: add mavlink shell for posix targets (#19800) 2022-06-20 11:51:47 +02:00
alexklimaj 4cc3e78558 Add mag bias estimator to CAN GPS units with IMUs
- run `sensors` hub to process sensor_mag and publish vehicle_magnetometer
 - update uavcannode to use vehicle_magnetometer
2022-06-19 15:46:36 -04:00
Daniel Agar 73f45fee6e
boards: px4_fmu-v5_test disable fake_gps module to save flash 2022-06-19 14:25:06 -04:00
Daniel Agar 902b789292
boards: px4_fmu-v5_protected disable gyro_fft module to save flash 2022-06-19 14:25:01 -04:00
Daniel Agar b81a5b3efa ekf2: request mag yaw reset after calibration or sensor change 2022-06-17 21:04:05 -04:00
Daniel Agar c7cec4252c sensors: add CONFIG_SENSORS_VEHICLE_AIRSPEED for airspeed/differential pressure
- disable CONFIG_SENSORS_VEHICLE_AIRSPEED on boards only used for multicopter
2022-06-17 19:31:45 -04:00
Daniel Agar 10deb7019e enable gyro_calibration for CAN nodes
- allow saving initial gyro cal if very close to 0
2022-06-17 19:31:45 -04:00
Daniel Agar db4e09d529 Tools/kconfig: delete old migration helpers
- people are updating this without really understanding the purpose,
and it's generally no longer useful
2022-06-17 19:31:45 -04:00
Daniel Agar c46fa01195 sensors: add kconfig mechanism to optionally exclude sensor types 2022-06-17 19:31:45 -04:00
Alex Klimaj 60450e63c0
uavcannode: Fix dronecan baro units 2022-06-17 14:22:15 -04:00
Beat Küng b9475d6ebe mavlink_shell: set target system and component id
These got added in https://github.com/mavlink/mavlink/pull/1725 and need
to be set for correct routing.
2022-06-17 09:29:43 -04:00
Daniel Agar dea404a9a3 boards: disable modules to save flash
- px4_fmu-v5x_rtps disable common barometers to save flash
 - px4_fmu-v6x_default disable telemetry drivers to save flash
2022-06-16 16:14:57 -04: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
Alessandro Simovic de1fa11e96 New follow-me flight task
rename follow_me_status to follow_target_status

enable follow_target_estimator on skynode

implement the responsiveness parameter:
The responsiveness parameter should behave similarly to the previous
follow-me implementation in navigator. The difference here is that
there are now two separate gains for position and velocity fusion.
The previous implemenation in navigator had no velocity fusion.

Allow follow-me to be flown without RC

SITL tests for follow-me flight task

This includes:
- Testing the setting for the follow-me angle
- Testing that streaming position only or position
  and velocity measurements both work
- Testing that RC override works

Most of these tests are done with a simulated model
of a point object that moves on a straight line. So
nothing too spectacular. But it makes the test checks
much easier.

Since the estimator for the target actually checks new
measurements and compares them to old ones, I also added
random gausian noise to the measurements with a fixed seed
for deterministic randomness. So repeated runs produce
exactly the same results over and over.

Half of the angles are still missing in MAVSDK. Need to create
an upstream PR to add center left/right and rear left/right options.
These and the corresponding SITL tests need to be implemented
later.

sitl: Increase position tolerance during follow-me

Astro seems to barely exceed the current tolerance (4.3 !< 4.0)
causing CI to fail. The point of the CI test is not to check
the accuracy of the flight behaviour, but only the fact that the
drone is doing the expected thing. So the exact value of this
tolerance is not really important.

follow-me: gimbal control in follow-me

follow-me: create sub-routines in flight task class

follow-me: use ground-dist for emergency ascent

dist_bottom is only defined when a ground facing distance sensor exist.
It's therefore better to use dist_ground instead, which has the distance
to the home altitude if no distance sensor is available.

As a consequence it will only be possible to use follow-me in a valley
when the drone has a distance sensor.

follow-me: point gimbal to the ground in 2D mode

follow-me: another fuzzy msg handling for the estimator

follow-me: bugfix in acceleration saturation limit

follow-me: parameter for filter delay compensation

mantis: dont use flow for terrain estimation

follow-me: default responsiveness 0.5 -> 0.1

0.5 is way too jerky in real and simulated tests.

flight_task: clarify comments for bottom distance

follow-me: minor comment improvement

follow-me: [debug] log emergency_ascent

follow-me: [debug] log gimbal pitch

follow-me: [debug] status values for follow-me estimator

follow-me: setting for gimbal tracking mode

follow-me: release gimbal control at destruction

mavsdk: cosmetics 💄
2022-06-16 16:14:57 -04:00
Chris Seto 285556e463 Re-set param limits for fw tuning values to align with fw tuning guide 2022-06-16 14:22:51 -04:00
Daniel Agar c1c2858341
Update submodule GPSDrivers to latest Thu Jun 16 12:38:52 UTC 2022
- GPSDrivers in PX4/Firmware (1069570a2a90fdc7f0e081b6c2c4b418446d65d7): 016c37cd1f
    - GPSDrivers current upstream: 8c09c5426d
    - Changes: 016c37cd1f...8c09c5426d

    8c09c54 2022-06-15 Daniel Agar - sbf trivial whitespace fix

Co-authored-by: PX4 BuildBot <bot@px4.io>
2022-06-16 12:21:06 -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 0f41a5e385 ArmStateMachine: simplify how preflight checks are called 2022-06-16 10:25:32 -04:00
Igor Mišić 5dc3fecac0 boards/bitcraze: add PWM_SERVO_STOP define 2022-06-16 08:09:00 +02:00
Igor Mišić 7c1da8d608 driver/px4io: set default failsafe values 2022-06-16 08:09:00 +02:00
Igor Mišić 04c2d0fe97 drivers/pwm_out: set default failsafe values 2022-06-16 08:09:00 +02:00
Daniel Agar 1980b5c5e8
ekf2: setEkfGlobalOrigin() reset baro and hgt sensor offsets if necessary
- handle uninitalized _gps_alt_ref
 - add basic lat/lon/alt sanity checks
2022-06-16 00:59:54 -04:00
achim fc3d88bb67
boards/diatone/mamba-f405-mk2: symmetric buffers for wifi telemetry (#19808)
Symmetric buffers allow a much more reliable QGC Wifi telemetry connection especially when (virtual) joysticks are used.  (this board does not provide RX DMA on UART 4 as its timer does DSHOT).
2022-06-15 14:30:28 -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
Igor Mišić 0922f003f5 uavcan: don't print an error if there is no UAVCAN device on the CAN bus 2022-06-15 03:29:13 -04:00
bresch 680191cc75 WindEstimator: make wind process noise tuning same as EKF2 2022-06-14 18:44:30 +10:00
bresch b6f1a7aed9 migrate wind process noise parameters 2022-06-14 18:39:10 +10:00
bresch 0d256b8ff6 ekf2 wind: use noise spectral density for process noise tuning
The noise spectral density, NSD, (square root of power spectral density) is a
continuous-time parameter that makes the tuning independent from the EKF
prediction rate.
NSD corresponds to the rate at which the state uncertainty increases
when no measurements are fused into the filter.
Given that the current prediction rate of EKF2 is 100Hz, the
same tuning is obtained by dividing the std_dev legacy parameter by 10:
nsd = sqrt(std_dev^2 / 100Hz)
2022-06-14 18:39:10 +10:00
bresch e105869986 wind_estimator: use noise spectral density for process noise tuning
The noise spectral density, NSD, (square root of power spectral density) is a
continuous-time parameter that makes the tuning independent from the EKF
prediction rate.
NSD corresponds to the rate at which the state uncertainty increases
when no measurements are fused into the filter.
Given that the current prediction rate of the wind estimator is 1Hz, the
same tuning is obtained with the same values as before.
2022-06-14 18:39:10 +10:00
Junwoo Hwang 377338109c uLog message definition comment improvements
- Added more comments
- Converted to DOxygen comment format for the comments on struct members
2022-06-13 10:31:07 +02:00
Junwoo Hwang 1ddd1573be Improve uLog message struct definitions
1. Rename *_header_s structs to *_s, since the _header postfix is not
helpful
2. Rename the "key" string variables in the message structs to
"key_value_str" as the string actually contains not just the key but the
key and value pair information
3. Add comments on other uLog messages to clarify use (need more
improvement / can be even more simplified)
2022-06-13 10:31:07 +02:00