Skip to content

feat(tfmini): add TFMINI-S variant - #29976

Open
ddwolf87 wants to merge 3 commits into
PX4:mainfrom
ddwolf87:ddwolf87/tfmini-s-variant
Open

ddwolf87 wants to merge 3 commits into
PX4:mainfrom
ddwolf87:ddwolf87/tfmini-s-variant

Conversation

@ddwolf87

Copy link
Copy Markdown
Contributor

Summary

Gives the Benewake TFmini-S its own SENS_TFMINI_HW value (5) and
relabels value 1 as the discontinued TFmini, as suggested by @hamishwillee
in #29633 (comment).

Problem

Value 1 (TFMINI / TFMINI-S) applies the original TFmini's 0.4 m
minimum to both models. The TFmini-S datasheet specifies a 10 cm blind
zone and a 0.1–12 m operating range, so value-1 users lose the usable
0.1–0.4 m readings — the driver reports them as out of range. This is
the same issue #29575 fixed for the TFmini Plus.

Solution

  • 5 (TFMINI-S): min 0.1 m, max 12 m, 2° FoV — from the TFmini-S
    datasheet (PD-TFmini-S-Datasheet-A01:
    operating range 0.1 m~12 m @ 90 % reflectivity, FoV 2°; product manual
    SJ-PM-TFmini-S A01, Table 1)
  • value 1 relabelled TFMINI (discontinued), limits unchanged (0.4 m minimum)
  • default moves 1 → 5: the TFmini-S is the current product the docs
    already treat as the default; installations that explicitly set 1
    are unaffected. The release notes Upgrade Guide carries a migration
    note for never-touched installations on original TFmini hardware

Testing

Configuration values are taken from the manufacturer datasheet. I don't
have a TFmini-S unit on hand, so this is not bench-verified — happy to
adjust if that's a blocker.

Assisted-by: GLM:glm-5.3-flash

The shared SENS_TFMINI_HW value 1 clamps the TFMINI-S to the original
TFmini's 0.4 m minimum, discarding the 0.1-0.4 m range that the
TFmini-S datasheet specifies (blind zone shortened to 10 cm). Give
TFMINI-S its own value 5 with the datasheet limits (0.1-12 m, 2 deg
FoV), keep value 1 for the discontinued TFmini, and make 5 the default
so fresh setups don't fall back to the discontinued model's limits.

As suggested in PX4#29633.

Assisted-by: GLM:glm-5.3-flash

Signed-off-by: jiakun <53556221+ddwolf87@users.noreply.github.com>
@github-actions github-actions Bot added kind:feature Request or change that adds new functionality. scope:sensors Sensor pipeline, calibration, voting, or sensor validation. labels Nov 23, 2026
Assisted-by: GLM:glm-5.3-flash
Signed-off-by: jiakun <53556221+ddwolf87@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

No broken links found in changed files.

PX4 only saves a parameter that differs from its default, so a
SENS_TFMINI_HW of 1 set while 1 was the default was never stored:
every discontinued TFmini moves to 5 on upgrade, whether or not it
was set explicitly. Drop that condition from the upgrade note.

Rename the stale TFMINI / TFMINI-S label in the TFmini Plus release
note, correct the TFmini-S PX4 minimum in the rangefinder table, link
the TFmini-S release note to its upgrade item, and add the reboot
that SENS_TFMINI_HW requires.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>

@hamishwillee hamishwillee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I've pushed cc22b96 with some doc fixes:

  • The Upgrade Guide note said to set SENS_TFMINI_HW=1 only if you "never explicitly set" it. PX4 doesn't save a parameter that equals its default, so a 1 set while 1 was the default was never stored. Every TFmini installation moves to 5 on upgrade, so the note now says to set 1 on any discontinued TFmini. (This also means the PR description's "installations that explicitly set 1 are unaffected" doesn't hold.)
  • The #29575 release note still used the TFMINI / TFMINI-S label, and rangefinders.md still gave the TFmini-S a 0.4m PX4 minimum.
  • I added the reboot to the SENS_TFMINI_HW step and linked the TFmini-S release note to its Upgrade Guide item.

Two questions inline.

max: 4
default: 1
max: 5
default: 5

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UVify IFO-S airframe (ROMFS/px4fmu_common/init.d/airframes/4073_ifo-s) sets SENS_TFMINI_CFG 103 but not SENS_TFMINI_HW, so it picks up this new default. If it ships with an original TFmini, it would need param set-default SENS_TFMINI_HW 1 to keep its 0.4m minimum. Do you know which sensor it uses?


switch (hw_model) {
case 1: // TFMINI / TFMINI-S (12m, 100 Hz)
case 1: // TFMINI (discontinued) (12m, 100 Hz)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that 1 covers only the original TFmini, should its FoV go back to that sensor's own datasheet value? #29575 set 1 to 2° from the TFmini-S datasheet, when 1 still covered the TFmini-S. If the original TFmini's datasheet gives 2.3° (the value before #29575), restore it here and drop the "now reports a 2° field of view (was 2.3°)" sentence from the #29575 entry in releases/main.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:feature Request or change that adds new functionality. scope:sensors Sensor pipeline, calibration, voting, or sensor validation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants