ArduPilot/ardupilot

RangeFinder: Using existing Analog offset for other interfaces (I2C or Serial)

Offen

#9.873 geöffnet am 21.11.2018

 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (15.603 Forks)batch import
EnhancementLibrarygood first issue

Repository-Metriken

Stars
 (9.336 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 26T 16h) (166 gemergte PRs in 30 T)

Beschreibung

Feature request

Expand rangefinder offset

Is your feature request related to a problem? Please describe. Need some easy fix to adjust sensor offset. For example, the Garmin Lidar Lite, has an offset of approx. 25 cm on low range, and users do not have a mean to compensate.

Describe the solution you'd like Just tested using the existing analog offset within this code https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_RangeFinder/AP_RangeFinder_PulsedLightLRF.cpp#L94

uint16_t _distance_cm = be16toh(val);
float offset  = state.offset;
// remove momentary spikes
if (abs(_distance_cm - last_distance_cm) < 100) {
    state.distance_cm = (_distance_cm-offset);

Platform [x ] All [ ] AntennaTracker [ ] Copter [ ] Plane [ ] Rover [ ] Submarine

Contributor Guide