fix(backend): allow forcing sensor mode via TINYNAV_SENSOR_MODE#191
Closed
hitomi-krgr wants to merge 1 commit into
Closed
fix(backend): allow forcing sensor mode via TINYNAV_SENSOR_MODE#191hitomi-krgr wants to merge 1 commit into
hitomi-krgr wants to merge 1 commit into
Conversation
Sensor mode was detected once at backend startup by a single `ros2 node list` probe: `/insight_full` present -> looper, else realsense. Since `/insight_full` (the looper SDK node) is often slow to come up, the probe frequently runs too early and misdetects a looper rig as realsense, launching the wrong sensor procs. Add an explicit override: when TINYNAV_SENSOR_MODE is set to `looper` or `realsense`, honor it verbatim and skip node-based detection. When unset, the original detection logic is unchanged, so existing deployments are unaffected. An invalid value logs a warning and falls back to detection. Defaulting a looper rig to looper is safe even before `/insight_full` is up: the looper bridge only subscribes to the sensor topics and waits, so data flows automatically once the SDK node appears. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
I suggest we use the method from realsense detetion, If the mode is neither |
hitomi-krgr
marked this pull request as draft
July 8, 2026 12:43
Contributor
Author
|
The purpose of this change is to explicitly specify the mode to use right at startup, so it's largely orthogonal to auto-detection. If we want to add auto-detection mechanisms, we can certainly build that functionality on top of this. |
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.
Problem
Sensor mode is detected once at backend startup via a single
ros2 node listprobe in_detect_and_init_sensor: if/insight_fullis present →looper, otherwise →realsense.Because
/insight_full(the looper SDK node) is often slow to come up, this one-shot probe frequently runs before the node exists, so a looper rig gets misdetected as realsense and the wrong sensor procs are launched.Change
Add an explicit override:
TINYNAV_SENSOR_MODEis set tolooperorrealsense, honor it verbatim and skip node-based detection.Only
_detect_and_init_sensoris touched;_sensor_modesemantics and all downstream branches / the/sensor/modeAPI are untouched.Why defaulting a looper rig to looper is safe
Even if
/insight_fullisn't up yet, looper mode only launcheslooper_bridge_node+planning_node(no sensor driver). The bridge just subscribes to the sensor topics and idles (Waiting for Looper bridge inputs) until the SDK node starts publishing, then bridges automatically — no restart needed.Deployment
Looper rigs add one line to their compose
environment::RealSense rigs need no change (default detection path).
🤖 Generated with Claude Code