common: benewake: document I2C connection, fix TF-Luna range - #8012
Merged
Conversation
Hwurzburg
force-pushed
the
benewake-i2c-connection
branch
from
August 29, 2026 13:17
c6b2b08 to
c28b898
Compare
rmackay9
previously approved these changes
Sep 3, 2026
rmackay9
left a comment
Contributor
There was a problem hiding this comment.
Ideally we would have wiring diagrams for at least one of the lidars capable of I2C but in any case this is an improvement, thanks!
The page presented these lidar as serial and CAN only, so there was no route to the I2C option for any of them. Every model on the page except the TF03 and TF350 supports I2C. Add a Connecting via I2C section, mark I2C in the interface table for the models that have it, and note I2C in the opening sentence. Two drivers are involved. The TFS20-L has its own, RNGFND1_TYPE = 46 (BenewakeTFS20L), which was not documented anywhere on the wiki - the page told TFS20-L users to set type 27, the TF03 serial driver. The rest share the TFmini Plus I2C command protocol and use RNGFND1_TYPE = 25 (BenewakeTFmini-I2C). Both default to I2C address 0x10. Also note that RNGFND1_PIN, RNGFND1_RMETRIC, RNGFND1_SCALING and RNGFND1_STOP_PIN apply only to analog rangefinders. The issue reporter listed them alongside the working settings, but they are not read by either I2C backend. Correct the TF-Luna's range, which was given as 0.80m / 3m. Benewake specify 0.2 ~ 8m; the old figures look like the accuracy specification (+/-6cm @ 0.2 ~ 3m) mistaken for the detection range. Fixes ArduPilot#7949 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Hwurzburg
force-pushed
the
benewake-i2c-connection
branch
from
September 3, 2026 16:41
c28b898 to
c797b72
Compare
Contributor
Author
added |
rmackay9
approved these changes
Sep 3, 2026
Contributor
|
thanks very much! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7949, reported by @Strohtho.
The page described these lidar as serial and CAN only - "proprietary serial and/or CAN interfaces", with every Interface column entry reading UART or CAN. In fact every model on the page except the TF03 and TF350 can be connected over I2C, and ArduPilot has had drivers for that the whole time.
Two drivers involved
RNGFND1_TYPE= 46 (BenewakeTFS20L). This was documented nowhere on the wiki. Worse, the page's serial section told TFS20-L owners to set type 27, which is the TF03 serial driver.0x5Acommand frames inAP_RangeFinder_Benewake_TFMiniPlus.cpp) and useRNGFND1_TYPE= 25 (BenewakeTFmini-I2C). This is what @Strohtho found working on a TF-Luna.Both are
AP_RangeFinder_Backend_I2Csubclasses defaulting to address 0x10.Changes
One thing deliberately not copied from the issue
The report lists
RNGFND1_PIN,RNGFND1_RMETRIC,RNGFND1_SCALINGandRNGFND1_STOP_PINalongside the settings that worked. Those are analog-only -ratiometricandscalingare read inAP_RangeFinder_analog.cppand neither I2C backend references them. Rather than documenting them as required, the section carries a note saying they do not apply to an I2C connection.Parameter names and the type codes 25 and 46 were checked against a generated
apm.pdef.xml, which is also where the exact GCS stringBenewakeTFmini-I2Ccomes from.Also: TF-Luna range corrected
The table gave the TF-Luna as
0.80m / 3m. Benewake specify "0.2 ~ 8 m" - the old figures look like the accuracy specification ("± 6 cm @ (0.2 ~ 3 m)") mistaken for the detection range. Corrected to0.20m / 8m. It is in the same table row this PR already edits, so it is folded in here rather than raised separately.That same product page lists the TF-Luna's interfaces as "UART, I/O, I²C", which independently confirms the I2C support documented above.
Built with
python3 update.py --fast --site copter.🤖 Generated with Claude Code