11923 Commits

Author SHA1 Message Date
bresch
b726d8df0d Add jerk parameter for auto mode MPC_JERK_AUTO. Specify when a parameter is only used in a certain manual or auto mode 2019-05-17 14:15:29 +02:00
Julian Oes
9d8015d029 modules/lib: ignore address-of-packed-member
For now we need to ignore this warning which GCC 9 shows for the MAVLink
headers.
2019-05-16 13:06:25 +02:00
Oleg Kalachev
77097b6adc commander: update commander status when offboard control mode changed 2019-05-11 10:30:57 -04:00
Matthias Grob
868b4e1746 Testing: correct license headers 2019-05-09 09:42:46 +02:00
Matthias Grob
01e9b2cde8 AttitudeControlTest: compare vectors, not every element 2019-05-09 09:42:46 +02:00
Matthias Grob
2cd0344712 AttitudeControlTest: fix style 2019-05-09 09:42:46 +02:00
Matthias Grob
63b967f5df Add unit testing possibility using googletest on POSIX 2019-05-09 09:42:46 +02:00
Roman Bapst
816aa0ffb6 VTOL transitions: use FW attitude loop (#11911)
* VTOL trans: changed that now in transition for both MC and FW the corresponding (correct) attitude controller is running
* attitude setpoint for stabilized mode is generated by tailsitter.cpp
* reset yaw setpoint during transition to avoid big yaw errors after
transition back to hover
* VT_TYPE parameter: added "reboot required" metadata
2019-05-08 10:33:13 -04:00
Matthias Grob
f30f12341f PositionControl: tiny minimal thrust length
To be able to still infer the direction of the thrust vector we
limit it to a minimal length even if MPC_THR_MIN is set to zero.

Note: This is a hotfix for certain specific applications.
The direction of the thrust vector in this corner case is very
likely to get into the tilt limit which is generally undesired.
2019-05-08 03:08:45 -05:00
bresch
02f0533ee9 Commander - Remove old code that overrides state_machine_helper logic 2019-05-07 17:45:28 +02:00
bresch
6d8d8e3c88 MC gyro cutoffs - Reduce IMU_GYRO_CUTOFF to 30Hz and disable MC_DTERM_CUTOFF.
A low gyro cutoff is needed for most medium/large size drones as the structural natural and blade-pass frequencies are low.
A higher value is still desirable for small platforms surch as racers
or well isolated autopilots and should be tuned by the user.
Specific values for config files are untouched.
The cutoff filter for the D term is disabled here as the required
cutoff frequency for the default D term of the rate controller is higher
than the gyro cutoff. In that case, enabling the D term cutoff would
just add some undesired phase lag to the derivative.
2019-05-07 12:15:51 +02:00
Daniel Agar
3d22da9cbe
wind_estimator fix true airspeed usage 2019-05-06 15:25:33 -04:00
Oleg Kalachev
7ec6f0dca6 lpe: use minimum flow altitude from uORB instead of hardcoding 2019-05-05 02:57:58 -05:00
Beat Küng
74990cadc8 uorb: avoid printf while DeviceMaster is locked
This fixes a potential dead-lock when 'uorb status' was used via MAVLink
shell.
The dead-lock chain is: DeviceMaster::lock() -> printf -> output to a pipe,
which blocks until a reader reads the data. In that case it's mavlink.
If mavlink makes a call that requires DeviceMaster::lock() (such as
orb_exists), it dead-locks.

This patch moves all printf's out of the locked state.
2019-05-02 10:26:41 +02:00
Matthias Grob
29719894f7 AttitudeControl: remove unused setter 2019-04-30 23:18:44 -05:00
Matthias Grob
269d077fae ekf2: only check ground effect if it's configured 2019-04-30 12:34:28 +02:00
Roman
f034d2da19 ekf2: fixed bug in baro ground effect triggering logic
- when either terrain data was temporarily not valid (flying at high
distance to the ground) or the vehicle was not close to the ground
(_param_ekf2_gnd_max_hgt) the ekf switched to using the land detector
ground effect flag.

Signed-off-by: Roman <bapstroman@gmail.com>
2019-04-30 12:34:28 +02:00
Daniel Agar
9bad61b86b
Improve robustness to bad and lost airspeed data (#11846) 2019-04-30 03:08:23 -04:00
Roman
2bd8b517c5 FwPositionControl: don't do takeoff help for vtol
- takeoff help is used for fixed wings, it increases the altitude setpoint
after a launch. A vtol does not need this as it's already sufficiently
high up in the air.

Signed-off-by: Roman <bapstroman@gmail.com>
2019-04-30 02:45:49 -04:00
Matthias Grob
56591954ad Commander: reevaluate RC mode on altitude lock 2019-04-29 13:24:29 -04:00
Daniel Agar
f032d0d9fc
SYS_MC_EST_GROUP mark LPE unsupported and update airframes (#11925) 2019-04-29 11:50:36 -04:00
Daniel Agar
2142459027 Revert "simulator: remove hack for diff_pressure noise"
This reverts commit 4a71984f77249230787b7d263d866d6cfa78a7ac.
2019-04-29 10:46:38 -04:00
Julian Oes
4a71984f77 simulator: remove hack for diff_pressure noise
The noise for airspeed is now applied on the Gazebo side and we can
remove this hack.
2019-04-28 18:22:21 -04:00
Matthias Grob
3bf5d6af12 commander: fix RC mode switch not getting applied after boot
the condition to enter the rc mode switch evaluation was neglecting
the first connection of an RC when "no RC switch changed". this means
depending on the actual initialization values of _last_sp_man and the
desired mode preselected on the RC while connecting it would not get
evaluated.
2019-04-26 21:04:10 +02:00
Matthias Grob
f177a68da9 commander: negate main_state_rc entering condition
pure refactor using De Morgan's law to make the condition more intuitive
since you think about when should I enter and not when should I skip
2019-04-26 21:04:10 +02:00
Matthias Grob
1f3ebd98b1 commander: split up set_main_state_rc entering condition
pure refactor of the huge condition into smaller const bool junks
2019-04-26 21:04:10 +02:00
bresch
89bc68e12b Auto - Rename MC_YAWRAUTO_MAX -> MPC_YAWRAUTO_MAX 2019-04-26 12:43:26 +02:00
bresch
581d25f77f Auto mode traj - limit yaw setpoint rate of change when generated in the flight task instead of clamping the yaw rate in the controller
Move yaw setpoint slew rate from AutoLineSmoothVel to Auto. The slew rate is now applied consistently to all the auto FlightTasks
2019-04-26 12:43:26 +02:00
mcsauder
e6b427022a Add missing underscore prefix to a member variable in mavlink_main.cpp.h and delete unnecessary struct specifiers in mavlink_main.h. 2019-04-26 11:33:17 +02:00
mcsauder
73fb30f251 Migrate an additional set of 16 variable initilializations from the Mavlink class constructor list to their respective declarations. 2019-04-26 11:33:17 +02:00
bresch
903deb7579 RTL - Skip descend state if no delay is set between descend and land 2019-04-25 18:24:04 +02:00
Julian Oes
c95394f57f navigator: fix uninitalized param values
By declaring the params above the navigator modes inheriting from
mission block we make sure the params in navigator are set before
read in the constructor of mission block.
2019-04-24 11:15:43 -04:00
Julian Oes
90ee26dd2d mavlink_mission: properly initialize padding
This prevents uninitialized padding from being written to dataman.
2019-04-24 11:15:43 -04:00
Julian Oes
4c56994d7a mavlink_system: set update_counter for safe points
This variable was not set and lead to uninitialized memory being written
to dataman.
2019-04-24 11:15:43 -04:00
Julian Oes
bf32ff32f8 dataman: make _file_write more readable
This should not be any functional change. The only difference are the
variable scopes, and early return versus nested ifs.
2019-04-24 11:15:43 -04:00
Julian Kent
dc3341db59 Fix uninitialized memory found using Valgrind 2019-04-24 11:15:43 -04:00
Roman
42d0522cdd FixedWingAttitudeControl: removed check for negative airspeed and slew rate
on airspeed scaling

Signed-off-by: Roman <bapstroman@gmail.com>
2019-04-24 14:27:37 +02:00
Daniel Agar
36aeb9defc WIP: FW attitude control limit airspeed scaling changes per iteration 2019-04-24 14:27:37 +02:00
Paul Riseborough
0f346af226 ekf2: Improve parameter description
Inhibiting bias estimation using the EKF2_AID_MASK parameter only applies to the delta velocity bias states.
2019-04-24 06:55:54 +02:00
Daniel Agar
d8a1a79f69 Mavlink: SYS_STATUS trivial style check fix 2019-04-23 08:48:11 -04:00
jdzerve
2e9d0f0751 Mavlink: Get full sensor status even if only subset has changed when composing SYS_STATUS message (#11886) 2019-04-23 08:31:13 -04:00
Roman
463b8a7528 vtol_att_control: respect min pwm values
Signed-off-by: Roman <bapstroman@gmail.com>
2019-04-17 09:13:27 +02:00
Mark Sauder
74bc6870ed simulator: uorb and initialization cleanup (#11825)
* Cherry pick the vehicle_imu PR #9756 src/modules/simulator directory work to submit as standalone PR.

* Modify the accelsim init method mag_report usage to match usage in measure() and mag_measure() methods in the class.

* Incorporate review comments in the accelsim.cpp init() method and also make the same modifications in gyrosim.cpp.

* Delete unneeded mag_report initialization from accelsim init() method.

* Deprecate unneeded measure() call from accelsim.cpp init() and gyrosim.cpp init().
2019-04-16 08:29:53 +02:00
Gabriel Moreno
f9324fb76a mavlink: set correct distance_sensor timestamp. Fixes #11840
When PX4FLOW is connected to PX4 through MAVLink (e.g., through a USB
port), the timestamp assigned to the distance_sensor was wrong. This fix
uses the same timestamp assigned to the optical_flow message created from
the same OPTICAL_FLOW_RAD MAVLink message.

Signed-off-by: Gabriel Moreno <gabrielm@cs.cmu.edu>
2019-04-15 20:31:15 +02:00
Daniel Agar
d36b06f779 fw_pos_control_l1: FW_LND_EARLYCFG disable by default
- change to boolean param
2019-04-13 17:35:12 +02:00
Beat Küng
3135f9f0d2 sih: avoid static variable + style fixes 2019-04-12 09:25:07 +02:00
romain
65f623bd73 acceleration added when hitting the ground 2019-04-12 09:25:07 +02:00
romain
7be1cc389e removed arguments from constructor 2019-04-12 09:25:07 +02:00
Beat Küng
744b50b478 send MAVLink GROUND_TRUTH at 25 Hz, only in SIH mode. And minor cleanup 2019-04-12 09:25:07 +02:00
romain
9adb4410bd newline added at the end of files 2019-04-12 09:25:07 +02:00