Commit Graph

13526 Commits

Author SHA1 Message Date
bresch 81a80e0d56 Airmode - Minor rewording 2018-03-23 10:35:08 +01:00
Beat Küng 2b6ca2cf82 uavcan_main: use parameter_update to check for param updates
this avoids calling param_get() on every loop iteration.
2018-03-23 10:35:08 +01:00
Beat Küng 72d22c4297 cleanup uavcan_main: replace warnx with PX4_{INFO,ERR,DEBUG} 2018-03-23 10:35:08 +01:00
bresch 99ce9cc2a8 Airmode - Add support for UAVCAN 2018-03-23 10:35:08 +01:00
bresch 6976232a20 Airmode - Add airmode parameter for multicopter mixer 2018-03-23 10:35:08 +01:00
Daniel Agar 44e3bd6c1c navigator follow_target move to matrix lib 2018-03-22 11:16:34 -04:00
Beat Küng a8ddd9ef64 syslink_bridge: include <cstring> to fix compilation issue
GCC error:
error: 'memcpy' was not declared in this scope
2018-03-22 08:19:08 +01:00
Beat Küng b512d11e54 refactor fw_pos_control_l1: replace BlockParam* with Param* classes
Also change naming convention: add _ prefix to class attributes
2018-03-22 08:19:08 +01:00
Beat Küng 51ca01ce04 FixedwingAttitudeControl: remove SuperBlock dependency 2018-03-22 08:19:08 +01:00
Beat Küng 0fdd53f4c2 refactor simulator: replace BlockParam* with Param* classes 2018-03-22 08:19:08 +01:00
Beat Küng 7937f9e82c refactor Battery: replace BlockParam* with Param* classes 2018-03-22 08:19:08 +01:00
Beat Küng 408cfd6ce1 err.h: remove unused declarations 2018-03-22 08:19:08 +01:00
Beat Küng 68ce62f173 Commander.hpp: remove usage of BlockParam & SuperBlock 2018-03-22 08:19:08 +01:00
Daniel Agar 3a0a896a9c sensors move to matrix lib 2018-03-22 08:17:32 +01:00
Daniel Agar ad2b96b523 mavlink move to matrix lib 2018-03-22 07:46:16 +01:00
Daniel Agar ac7242987c delete unused tailsitter_recovery library (#9103) 2018-03-21 14:09:36 -04:00
Daniel Agar b7bfeb442e fw_att_control move to matrix lib math 2018-03-21 14:08:47 -04:00
Roman d9fbf85c20 ekf2: remove early advertising of wind estimate topic
- if it's not estimating wind it won't publish it below (was fixed)

Signed-off-by: Roman <bapstroman@gmail.com>
2018-03-21 18:46:58 +01:00
Roman 372a519ac4 wind estimator: added airspeed and sideslip gate sizes for innovation tests
Signed-off-by: Roman <bapstroman@gmail.com>
2018-03-21 18:46:58 +01:00
Daniel Agar 3600225ed4 wind_estimator trim module documentation to fit in limit 2018-03-21 18:46:58 +01:00
Daniel Agar f1bb61769f wind_estimator fix LPWORK/HPWORK confusion and cleanup 2018-03-21 18:46:58 +01:00
Roman 8400d42988 wind estimator: fixed minor comments
Signed-off-by: Roman <bapstroman@gmail.com>
2018-03-21 18:46:58 +01:00
Roman 86b525ad2c wind_estimator: use ModuleParams class to handle parameters
Signed-off-by: Roman <bapstroman@gmail.com>
2018-03-21 18:46:58 +01:00
Roman d2ebb0c7a2 ekf2: advertise wind topic early to make sure ekf2 get the first instance
Signed-off-by: Roman <bapstroman@gmail.com>
2018-03-21 18:46:58 +01:00
Roman 5b067df01e wind_estimator: cleanup
Signed-off-by: Roman <bapstroman@gmail.com>
2018-03-21 18:46:58 +01:00
Roman 33c1bcb983 wind_estimator: set missing task_id
Signed-off-by: Roman <bapstroman@gmail.com>
2018-03-21 18:46:58 +01:00
Roman 53e22661d4 wind_estimator: unsubscribe from topics and unadvertise wind topic
Signed-off-by: Roman <bapstroman@gmail.com>
2018-03-21 18:46:58 +01:00
Roman 7c0f043116 added module which implements wind & airspeed scale factor estimator via
work queue

Signed-off-by: Roman <bapstroman@gmail.com>
2018-03-21 18:46:58 +01:00
sanderux d87b7ac7f4 Fix scale application on FW throttle baro compensation 2018-03-20 00:13:36 +01:00
Daniel Agar b6b7fddb9f TECS and L1 switch to matrix math library (#9101) 2018-03-19 18:09:54 -04:00
Alessandro Simovic cd250831d5 commander: removed duplicated startup tune
Addressing review comments in PR #9096
2018-03-19 14:15:52 +01:00
Beat Küng 76aa044105 navigator mission: add yaw offset to vehicle's yaw for ROI cmds and disabled gimbal yaw 2018-03-19 09:42:41 +01:00
Beat Küng a0372c6183 vmount: implement VEHICLE_CMD_DO_SET_ROI_WPNEXT_OFFSET 2018-03-19 09:42:41 +01:00
Beat Küng aaa67632ca navigator: remove redundant switch block for ROI handling 2018-03-19 09:42:41 +01:00
Thomas Stastny 52e5e0df14 fw_att_control: schedule trims for airspeed and flap deployment (#8937) 2018-03-16 16:55:44 -04:00
barzanisar 34dd68bee1 Update syslink_main.cpp 2018-03-16 14:56:40 +01:00
barzanisar a6e35ab7f7 Beat's changes to make QGC connect with crazyflie 2018-03-16 14:56:40 +01:00
Matthias Grob ed0b6db2de mc_att_control: clarify comment about yaw feed forward 2018-03-15 17:57:46 +01:00
Matthias Grob ff25c7f48a ensure attitude setpoint initialization before arming
- On initialization _v_att_sp got filled with zeros
  leaving invalid quaternions
- While not armed mc_pos_control did not publish any
  attitude setpoint which makes no sense
- The attitude control just uses the data in _v_att_sp
  if it was (ever) updated or not
2018-03-15 17:16:14 +01:00
Matthias Grob e32b04fff1 mc_att_control: catch numerical out of domain case
While operating on exactly normalized float quaternions
it can aparently still happen that one of the elements
gets just slightly above 1 or below -1 and hence out of
the domain of the acosf and asinf functions resulting in
NaN. The constrain function uses stricly smaller/bigger
comparisons and catches all tested cases.
2018-03-15 17:16:14 +01:00
Matthias Grob 42f4e62a04 mc_att_control: clarify corner case comment 2018-03-15 17:16:14 +01:00
Matthias Grob 9f69447e22 mc_att_control: replace nasty corner case condition
I found a better solution for the condition of the numerical
corner case and also tried to comment it more clearly.
2018-03-15 17:16:14 +01:00
Matthias Grob d2ead02fb5 mc_att_control: catch numerical corner cases
- Delete left over identity matrix.

- Corner case with a zero element when using the signum function:
We always need a sign also for zero.

- Corner case with arbitrary yaw but and 180 degree roll or pitch:
Reduced attitude control calculation always rotates around roll
because there's no right choice when neglecting yaw. In that small
corner case it's better to just use full attitude contol and hence
rotate around the most efficient roll/pitch combination.
2018-03-15 17:16:14 +01:00
Matthias Grob dc28c47544 mc_att_control: correct head comment 2018-03-15 17:16:14 +01:00
Matthias Grob c4fb2b26fd mc_att_control: prepare yaw weight from gain ratio
According to the paper the quaternion controller is built on
the yaw weight represents the ratio between the roll/pitch and
the yaw attitude control time constant. It also states that as a
thumb rule a value of ~0.4 works alright for most multicopter
platforms. The default attitude gains of PX4 which were determined
independent of the paper from experimental results have a ratio of
2.8/6.5 = 0.43 which matches.
2018-03-15 17:16:14 +01:00
Matthias Grob 6317d36ec9 mc_att_control: remove time constant parameter
Because the parameter does not make sense from a control theory
perspective. Either you have a gain with the unit 1/s or an inverse
gain or time constant with the unit s. But the time constant parameter
was neither bound to any exact unit nor did it apply instead of a gain.
Rather it adjusted multiple gains from rate and attitude control
according to an arbitrary scale. This can only by accident lead to
good tuning.
2018-03-15 17:16:14 +01:00
Matthias Grob ba5f2254cd mc_att_control: add reduced quaternion attitude control
to prioritize yaw compared to roll and pitch by combining
the shortest rotation to achieve a total thrust vector with
the full attitude respecting the desired yaw
not by scaling down the control output with the gains
2018-03-15 17:16:14 +01:00
Matthias Grob 9ff9692270 mc_att_control: switch to quaternion attitude control (no yaw reduction yet) 2018-03-15 17:16:14 +01:00
Daniel Agar 1abf90c6d4 EKF2 only publish wind_estimate if wind velocity is being estimated
- refactor body wind velocity calculation
2018-03-15 07:18:58 +01:00
Daniel Agar 7607c71ca8 fw_pos_control_l1 project virtual waypoint to handle landing overshoot 2018-03-14 16:39:19 -04:00