Skip to content

Prevent publishing empty messages in pose publisher#3262

Merged
iche033 merged 1 commit intomainfrom
iche033/pose_pub_empty
Jan 12, 2026
Merged

Prevent publishing empty messages in pose publisher#3262
iche033 merged 1 commit intomainfrom
iche033/pose_pub_empty

Conversation

@iche033
Copy link
Copy Markdown
Contributor

@iche033 iche033 commented Jan 10, 2026

🦟 Bug fix

Summary

Add a check to make sure we don't publish pose messages if it's empty, otherwise you get a bunch of empty msgs.

To test:

Add the pose publisher system to your favorite static model., e.g. edit shapes.df and add the following system to the ground_plane model:

      <plugin filename="libgz-sim-pose-publisher-system.so"
        name="gz::sim::systems::PosePublisher">
        <publish_link_pose>true</publish_link_pose>
        <publish_sensor_pose>false</publish_sensor_pose>
        <publish_collision_pose>false</publish_collision_pose>
        <publish_visual_pose>false</publish_visual_pose>
        <publish_nested_model_pose>true</publish_nested_model_pose>
        <publish_model_pose>true</publish_model_pose>
        <use_pose_vector_msg>true</use_pose_vector_msg>
        <static_publisher>true</static_publisher>
        <static_update_frequency>1</static_update_frequency>
      </plugin>

Run sim:

gz sim -v 4 -r shapes.sdf

Now echo the /model/ground_plane/pose topic to see that no messages should be published. Before this fix, there'll be a lot of empty messages (empty lines)

gz topic -e -t /model/ground_plane/pose

Echo the pose_static topic to make sure data are published:

/model/ground_plane/pose_static

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

Generated-by: Remove this if GenAI was not used.

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.

Signed-off-by: Ian Chen <ichen@openrobotics.org>
@github-project-automation github-project-automation Bot moved this from Inbox to In review in Core development Jan 12, 2026
@iche033 iche033 merged commit 80246e0 into main Jan 12, 2026
15 checks passed
@iche033 iche033 deleted the iche033/pose_pub_empty branch January 12, 2026 18:17
@github-project-automation github-project-automation Bot moved this from In review to Done in Core development Jan 12, 2026
@iche033
Copy link
Copy Markdown
Contributor Author

iche033 commented Jan 12, 2026

@Mergifyio backport gz-sim10 gz-sim9 gz-sim8

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jan 12, 2026

backport gz-sim10 gz-sim9 gz-sim8

✅ Backports have been created

Details

mergify Bot pushed a commit that referenced this pull request Jan 12, 2026
Signed-off-by: Ian Chen <ichen@openrobotics.org>
(cherry picked from commit 80246e0)
mergify Bot pushed a commit that referenced this pull request Jan 12, 2026
Signed-off-by: Ian Chen <ichen@openrobotics.org>
(cherry picked from commit 80246e0)
mergify Bot pushed a commit that referenced this pull request Jan 12, 2026
Signed-off-by: Ian Chen <ichen@openrobotics.org>
(cherry picked from commit 80246e0)
iche033 added a commit that referenced this pull request Jan 12, 2026
Signed-off-by: Ian Chen <ichen@openrobotics.org>
(cherry picked from commit 80246e0)
iche033 added a commit that referenced this pull request Jan 12, 2026
Signed-off-by: Ian Chen <ichen@openrobotics.org>
(cherry picked from commit 80246e0)
iche033 added a commit that referenced this pull request Jan 12, 2026
Signed-off-by: Ian Chen <ichen@openrobotics.org>
(cherry picked from commit 80246e0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants