Repository navigation
Read the starting Focus from the camera - #2
Merged
deepanaishtaweera merged 2 commits intoOct 7, 2026
Merged
Conversation
…read The node's Focus can be stale (the lens moves it on its own, e.g. with zoom), so take the pre-command value from the camera. If no read succeeds within the timeout, say so instead of reporting a moving feature.
There was a problem hiding this comment.
🟡 Changes recommended
A failed initial camera read silently falls back to the stale node value and can still cause premature settling.
1 open finding
What changed in this PR
Updates autofocus read-back to use the camera’s current focus as its baseline and improves timeout diagnostics.
Changes:
- Refreshes focus before executing
FocusAuto. - Tracks successful post-command reads.
- Distinguishes total read failure from continued movement.
| File | Description |
|---|---|
camera_aravis2/src/camera_driver.cpp |
Updates autofocus baseline and timeout handling. |
camera_aravis2/include/camera_aravis2/camera_driver.h |
Adds the successful-read counter. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| { | ||
| RCLCPP_WARN(logger_, "'%s' still changing %llds after the command; stopped reading it back.", | ||
| read_back_param_.c_str(), static_cast<long long>(kTimeout.count())); | ||
| if (read_back_reads_ == 0 || !read_back_last_ok_) |
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.

This is a follow-up to #1.
Checked on the deck: FocusAuto settled at 9974 2.5 s after the command, and
get_parametersreturned the same value.