Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the ToF sensor node publishing path so that, when alignment is enabled, the published ToF image stream and associated metadata (frame/socket, dimensions) correspond to the aligned output rather than the raw ToF depth output.
Changes:
- Delay
setInOut()until after optionalImageAlignnode creation so aligned publishing can be wired correctly. - Publish
alignNode->outputAlignedinstead oftofNode->depthwheni_alignedis enabled. - Configure the publisher’s socket/frame and width/height based on the alignment target.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+68
to
+76
| auto pubSocket = aligned ? getAlignedSocketID() : boardSocket; | ||
| auto tfPrefix = getOpticalFrameName(getSocketName(pubSocket)); | ||
| auto pubWidth = ph->getParam<int>(ParamNames::WIDTH); | ||
| auto pubHeight = ph->getParam<int>(ParamNames::HEIGHT); | ||
| if(aligned) { | ||
| auto alignedSocketName = getSocketName(pubSocket); | ||
| pubWidth = ph->getOtherNodeParam<int>(alignedSocketName, ParamNames::WIDTH); | ||
| pubHeight = ph->getOtherNodeParam<int>(alignedSocketName, ParamNames::HEIGHT); | ||
| } |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A moderate active issue remains in tof.cpp where the published socket/frame/calibration may be incorrect because it falls back to the constructor’s default boardSocket instead of the effective tof.i_board_socket_id when aligned output isn’t published.
2 open issues
Review effort: Balanced
| using param_handlers::ParamNames; | ||
| if(ph->getParam<bool>(ParamNames::PUBLISH_TOPIC)) { | ||
| auto tfPrefix = getOpticalFrameName(getSocketName(boardSocket)); | ||
| auto pubSocket = aligned ? getAlignedSocketID() : boardSocket; |
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.

Overview
Author:
Issue
Issue link (if present):
Issue description:
Related PRs
Changes
ROS distro:
List of changes:
Testing
Hardware used:
Depthai library version:
Visuals from testing
Add screenshots/gifs/videos from RVIZ or other visualizers demonstrating the effect of the changes when applicable.