FoundationPose always publishes hypothesis.score = 0.0 in Detection3DArray output
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- backend-api-design, machine-learning
Research direction
Read isaac_ros_foundationpose/src/foundationpose_impl/pose_decoder.cpp, especially findMaxScoreIndex(), decode() and buildResult(). Trace how the selected hypothesis score is chosen and added to the Detection3DArray; the issue identifies the current loss point and provides a suggested fix. Done means detection mode publishes the selected score, with tracking mode retaining its documented zero score.
Written by the indexing model from the issue text.
Description
FoundationPose always publishes hypothesis.score = 0.0 in Detection3DArray output
Description
FoundationPoseNode publishes its result on pose_estimation/output as a vision_msgs/Detection3DArray, but results[0].hypothesis.score is always 0.0. The score network does run and its scores are copied to the host to pick the best hypothesis, but the winning score is then discarded and never written into the message.
Affected: 4.5.0 (reproduced with the ros-jazzy-isaac-ros-foundationpose 4.5.0 Debian), and the code is unchanged in 5.0.0 (v5.0-0, 7772773).
Where
isaac_ros_foundationpose/src/foundationpose_impl/pose_decoder.cpp
findMaxScoreIndex()(L39) copies all scores to the host but returns only the index.decode()(L113) uses that index to pick the pose and callsbuildResult(pose_matrix, mesh_data, stamp)without the score.buildResult()(L84-L86) creates theObjectHypothesisWithPoseand sets onlypose, sohypothesis.scorekeeps its default of0.0(andhypothesis.class_idstays empty).
vision_msgs::msg::ObjectHypothesisWithPose hyp;
hyp.pose.pose = det.bbox.center;
det.results.push_back(hyp);
To reproduce
- Run any FoundationPose detection-mode launch (for example
isaac_ros_foundationpose_core.launch.py) on an object that gets posed correctly. ros2 topic echo /pose_estimation/output --field detections- Every detection shows
results[0].hypothesis.score: 0.0, whatever the input frame or the quality of the pose.
Expected
hypothesis.score holds the score-network output for the selected pose hypothesis, so that downstream nodes can log it, threshold it or compare frames. In tracking mode, where no score network runs, leaving it at 0.0 (and documenting that) would be fine.
Suggested fix
Return the max value along with its index and pass it through:
-int findMaxScoreIndex(cudaStream_t stream, const float * scores_device, int N)
+std::pair<int, float> findMaxScore(cudaStream_t stream, const float * scores_device, int N)
{
...
- return static_cast<int>(
- std::max_element(scores_host.begin(), scores_host.end()) - scores_host.begin());
+ auto it = std::max_element(scores_host.begin(), scores_host.end());
+ return {static_cast<int>(it - scores_host.begin()), *it};
}
DecodeResult buildResult(
const Eigen::Matrix4f & pose_matrix,
std::shared_ptr<const MeshData> mesh_data,
- const RosMessageStamp & stamp)
+ const RosMessageStamp & stamp,
+ float score = 0.0f)
{
...
vision_msgs::msg::ObjectHypothesisWithPose hyp;
hyp.pose.pose = det.bbox.center;
+ hyp.hypothesis.score = score;
det.results.push_back(hyp);
// decode()
- int best_idx = findMaxScoreIndex(stream_, scores.data, scores.count);
+ auto [best_idx, best_score] = findMaxScore(stream_, scores.data, scores.count);
...
- return buildResult(pose_matrix, mesh_data, stamp);
+ return buildResult(pose_matrix, mesh_data, stamp, best_score);
It would also help to say in the docs what range the score has (it is the raw score-network output, not a normalised confidence) and that it only ranks hypotheses for the same mesh.
Environment
- Isaac ROS 4.5.0 Debians (
release-4.5apt repo), ROS 2 Jazzy, Ubuntu 24.04, x86_64 - TensorRT 10.13.3.9, CUDA 13.0
- Dominant language
- C++
- Stars
- 515
- Forks
- 57
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA-ISAAC-ROS/isaac_ros_pose_estimation
-
License clarification — vendored nvdiffrast sources in isaac_ros_pose_estimation (Apache-2.0)May be free again @yuanknv claimed this 42 days ago, and no pull request is open. Openverify to close
NVIDIA-ISAAC-ROS/isaac_ros_pose_estimation#98 · 2 comments · 2 assignees ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Not getting the same result as offline foundationposeMay be free again @yuanknv claimed this 168 days ago, and no pull request is open. Opencoming soon!
NVIDIA-ISAAC-ROS/isaac_ros_pose_estimation#95 · 8 comments · 1 assignee ·
-
FoundationPose decoder: tf_to_center sign is inverted, causing 2*R*c translation errorPossibly taken @yuanknv claimed this 180 days ago. Open
NVIDIA-ISAAC-ROS/isaac_ros_pose_estimation#92 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
All issues in NVIDIA-ISAAC-ROS/isaac_ros_pose_estimation
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
sandialabs/Fenix#172 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
scp-fs2open/fs2open.github.com#7953 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SteveMacenski/slam_toolbox#907 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day