ArduPilot / ArduPilot/ardupilot

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

Open
#9,873 4 comments 0 reactions 0 assignees View on GitHub
Enhancement good first issue Library
Dominant language
C++
Stars
15.9k
Forks
21.4k
Avg merge
3d 17h
Merged PRs (30d)
119

Description

### 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

Open the contributing guide

Research direction

Start with libraries/AP_RangeFinder/AP_RangeFinder_PulsedLightLRF.cpp at the referenced offset handling, then trace the corresponding I2C and Serial rangefinder paths. Confirm how the existing analog offset is represented and where each interface computes distance. Done means users can compensate the sensor offset consistently across the requested interfaces.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.