Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

FoundationPose always publishes hypothesis.score = 0.0 in Detection3DArray output

Open Beginner friendly
#102 0 comments 0 reactions 0 assignees View on GitHub

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

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 calls buildResult(pose_matrix, mesh_data, stamp) without the score.
  • buildResult() (L84-L86) creates the ObjectHypothesisWithPose and sets only pose, so hypothesis.score keeps its default of 0.0 (and hypothesis.class_id stays empty).
vision_msgs::msg::ObjectHypothesisWithPose hyp;
hyp.pose.pose = det.bbox.center;
det.results.push_back(hyp);

To reproduce

  1. Run any FoundationPose detection-mode launch (for example isaac_ros_foundationpose_core.launch.py) on an object that gets posed correctly.
  2. ros2 topic echo /pose_estimation/output --field detections
  3. 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.5 apt 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA-ISAAC-ROS/isaac_ros_pose_estimation

All issues in NVIDIA-ISAAC-ROS/isaac_ros_pose_estimation

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.