Commit Graph

1430 Commits

Author SHA1 Message Date
Kurt Kiefer 597372bec9 Gather RSSI data from Spektrum Telemetry receivers
On SPM4649T receivers with firmware versions at least 1.1RC9, the
serial data will contain an rssi value in dbm, as outlined in the
Remote Receiver Interfacing document section 8.3.1.

If the value received is greater than or equal to zero, the receiver
does not support rssi data, and the incoming value will be ignored.
However, if the value is negative, we can use the rssi value.

When we have a valid rssi, it gets mapped to a percentage from 0 to
100 as expected by mavlink. This mapping is constructed as a
logarithmic function over Spektrum's published minimum and maximum
rssi values, -92dBm to -42dBm as 0 to 100:
100 Log10[1 + (x - min) * (9 / (max - min))]

This change updates all calls to the dsm input rountes to return
the rssi value.

Note that one place this doesn't work with the px4io enabled.
There is a comment left in the absence of analog rssi that:
"we do not actually get digital RSSI regs[PX4IO_P_RAW_RC_NRSSI]".
This restriction has been left in place, as removing it exposes a
problem where the frequency of the control tick is greater than
that of valid dsm frames so the rssi isn't valid every cycle.
2018-07-22 08:42:30 +02:00
Dennis Mannhart b5731e0ccd FlightTaskOffboard: only start task if control mode flags are met 2018-07-20 09:26:18 +02:00
Dennis Mannhart eb7139bc56 FlightTaskManualAltitude: respect maximum altitude if there is a valid distance sensor 2018-07-20 09:26:18 +02:00
Dennis Mannhart c907e7a9dc FlighttaskManualAlititude: replace SENS_FLOW_MINRNG with hagl_min 2018-07-20 09:26:18 +02:00
Dennis Mannhart 4af9d79986 FlighttaskManualPosition: check if estimator velocity maximum is finite
before applying limits
2018-07-20 09:26:18 +02:00
MaEtUgR efed766919 FlightTasks: small rebase naming and typo fixes 2018-07-20 09:26:18 +02:00
Dennis Mannhart 29fb5089bd FlightTasks: construct all tasks in constructor 2018-07-20 09:26:18 +02:00
Dennis Mannhart b1530d1a81 FlightTasks: create struct that contains FlightTask and FlightTaskIndex 2018-07-20 09:26:18 +02:00
Dennis Mannhart 83cc2b0e72 FlightTaskAuto: reset lock position to NAN 2018-07-20 09:26:18 +02:00
Dennis Mannhart c12dcb4eed FlightTaskAuto: take care of case when triplet.lat/lon are invalid, which corresponds
to position lock.
2018-07-20 09:26:18 +02:00
Dennis Mannhart 65ad6edaf0 ManualSmoothingXY: remove empty lines 2018-07-20 09:26:18 +02:00
Dennis Mannhart b9d5189fe5 ManualSmoothing: direction change with maximum acceleration 2018-07-20 09:26:18 +02:00
Dennis Mannhart 33d0a4e8ed FlightTaskAuto: replace target with destination for checks 2018-07-20 09:26:18 +02:00
Dennis Mannhart 92e93639d3 FlightTaskAuto: require valid position in 3D 2018-07-20 09:26:18 +02:00
Dennis Mannhart c4c01358b9 FlightTaskManualAltitude: do terrain following when distance sensor active and
below minimum distance to ground.
2018-07-20 09:26:18 +02:00
Dennis Mannhart bd85f5f993 FlightTask: set min_distance_to_ground to NAN as default and when
distance sensor is used to SENS_FLOW_MINRNG
2018-07-20 09:26:18 +02:00
Dennis Mannhart ee7d5c3f38 FlightTaskAuto: remove unused member variable 2018-07-20 09:26:18 +02:00
Dennis Mannhart e408870857 FlightTaskManual: remove unused override 2018-07-20 09:26:18 +02:00
Dennis Mannhart be6f3a5b48 FlightTaskOffboard: valid position and velocity is required 2018-07-20 09:26:18 +02:00
Dennis Mannhart bd2de0e585 FlightTaskAuto: valid target is required and valid reference 2018-07-20 09:26:18 +02:00
Dennis Mannhart 4713f47668 FlightTaskManualPosition: valid position/velocity in xy required 2018-07-20 09:26:18 +02:00
Dennis Mannhart 72a213aff7 FlightTaskManualAltitude: valid altitude/climb-rate is required 2018-07-20 09:26:18 +02:00
Dennis Mannhart fc4fa169df FlightTaskManualStabilized: valid yaw is required 2018-07-20 09:26:18 +02:00
Dennis Mannhart 2af253fa9f FlightTaskManual: sticks not to be finite
activation method not needed
2018-07-20 09:26:18 +02:00
Dennis Mannhart 6a7a7d7ff7 FlightTask: check if states are valid. if not valid, set them to NAN 2018-07-20 09:26:18 +02:00
Dennis Mannhart b2af9c3f58 FlightTasks: error to char string message 2018-07-20 09:26:18 +02:00
Dennis Mannhart afd02aca92 FlightTask: fail activation if required states are not available 2018-07-20 09:26:18 +02:00
Dennis Mannhart 3ea7f8783f FlightTaskManualAltitude: fix comment 2018-07-20 09:26:18 +02:00
Dennis Mannhart a0c3c80b37 FlightTaskManualStabilized make reset counter for heading static 2018-07-20 09:26:18 +02:00
Dennis Mannhart 68dd2d739a ManualSmoothingXY indent 2018-07-20 09:26:18 +02:00
Dennis Mannhart 1317844a94 ManualSmoothingXY fix comments and style 2018-07-20 09:26:18 +02:00
Dennis Mannhart 250afd49a9 ManualSmoothingZ: update comments 2018-07-20 09:26:18 +02:00
Dennis Mannhart 216279b576 FlightTask: activate tasks with setpoints in use 2018-07-20 09:26:18 +02:00
Dennis Mannhart 389f897b04 mc_pos_control: member initialization during deceleration 2018-07-20 09:26:18 +02:00
Dennis Mannhart 46f91154a4 Smoothing: initialize ModuleParam in body of constructor because of compiler error 2018-07-20 09:26:18 +02:00
Dennis Mannhart 742e9f7b15 FlightTaskManualStabilzied: check for absolute yaw 2018-07-20 09:26:18 +02:00
Dennis Mannhart cfa412b55f make format 2018-07-20 09:26:18 +02:00
Dennis Mannhart afbeafebd8 replace heading_reset_counter 2018-07-20 09:26:18 +02:00
Dennis Mannhart 9ec47f2b74 replace reset counter logic for estimator reset for manual controlled mode 2018-07-20 09:26:18 +02:00
MaEtUgR 70802ba15a FlightTaskManual: Yaw lock with deadzone and expo
More than a year ago I started the easy to use math::Functions to handle
the always used mathematical SISO functions to be tested and available.

I switched x, y and z stick input to the freesh programmed deadzone and
exponential functions from the library to unify and clarify their use.
I just realized yaw was left over because it lead to a drift problem in
certain new use cases.

Now I'm just adding the yaw stick to the already well working method.
2018-07-20 09:26:18 +02:00
Dennis Mannhart 2017e394b3 speed limitation during auto-takoff: remove from legacy and add to FlightTask 2018-07-20 09:26:18 +02:00
Dennis Mannhart dcdbdbd8eb FlightTaskAuto: need to remove check for yaw valid since there is a
bug in the navigator where this flag is not correctly set.
2018-07-20 09:26:18 +02:00
Dennis Mannhart 740f1f284f FlightTaskOffboard: enable triplet type takeoff, land etc 2018-07-20 09:26:18 +02:00
Dennis Mannhart 1099dd8c7d FlightTaskOffboard: first commit similar in logic to legacy code
FlightTaskOffboard: ensure supported offboard setpoints
2018-07-20 09:26:18 +02:00
Dennis Mannhart dca378fbfd FollowMe: legacy implementation. NOTE: FOLLOW-ME is already broken on legacy code. 2018-07-20 09:26:18 +02:00
Dennis Mannhart 547cdc051c FlightTask: apply gear switch depending on task 2018-07-20 09:26:18 +02:00
Dennis Mannhart c637ccb65f FlightTaskAutoLine: move altitude above ground computaiton to method 2018-07-20 09:26:18 +02:00
Dennis Mannhart 3ea0a53192 FlightTask: set landing gear up boolean to false 2018-07-20 09:26:18 +02:00
Dennis Mannhart 7d7a2dffbf Smoothing-classes: initialize to parameters 2018-07-20 09:26:18 +02:00
Dennis Mannhart 5ef2a61be5 ManualSmoothingXY: ensure that maximum speed is correctly propagated to the smoothing class 2018-07-20 09:26:18 +02:00