Skip to content

Fix entity type values in sim tools and docs (backport #927) - #949

Closed
mergify[bot] wants to merge 1 commit into
humblefrom
mergify/bp/humble/pr-927
Closed

Fix entity type values in sim tools and docs (backport #927)#949
mergify[bot] wants to merge 1 commit into
humblefrom
mergify/bp/humble/pr-927

Conversation

@mergify

@mergify mergify Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦟 Bug fix

Summary

Fix the entity type values used by the delete_entity and set_entity_pose tools and the ros_gz_sim_demos documentation so they match ros_gz_interfaces/msg/Entity.msg.

The previous CLI help text and README table were inconsistent with the entity type constants defined in ros_gz_interfaces/msg/Entity.msg. This could cause users to pass the wrong entity type value when using --type.

### Entity Type Reference
When using the `set_entity_pose` and `delete_entity` commands, you can specify the entity type using the `--type` flag. The following type values are available:
| Value | Entity Type |
|-------|-------------|
| 0 | NONE |
| 1 | LIGHT |
| 2 | LINK |
| 3 | VISUAL |
| 4 | COLLISION |
| 5 | SENSOR |
| 6 | MODEL (default) |

int entity_type = 6; // Default to MODEL type
app.add_option("--type", entity_type,
"Entity type: 0=NONE, 1=LIGHT, 2=LINK, 3=VISUAL, 4=COLLISION, "
"5=SENSOR, 6=MODEL(default)");

int entity_type = 6; // Default to MODEL type
app.add_option("--type", entity_type,
"Entity type: 0=NONE, 1=LIGHT, 2=LINK, 3=VISUAL, 4=COLLISION, "
"5=SENSOR, 6=MODEL(default)");

# Entity type: constant definition
uint8 NONE = 0
uint8 LIGHT = 1
uint8 MODEL = 2
uint8 LINK = 3
uint8 VISUAL = 4
uint8 COLLISION = 5
uint8 SENSOR = 6
uint8 JOINT = 7

Backport Policy

  • This is safe to backport to the following versions:
    • Jetty
    • Ionic
    • Harmonic
    • Fortress
  • This should not be backported
  • I am not sure
  • Other (fill in yourself)

Checklist

  • Signed all commits for DCO
  • Added a screen capture or video to the PR description that demonstrates the fix (as needed)
  • 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)
  • Updated Bazel files (if adding new files). Created an issue otherwise.
  • 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 "Assisted-by" to your commits. (See this policy for more info.)

This is an automatic backport of pull request #927 done by [Mergify](https://mergify.com).

Signed-off-by: C88-YQ <1409947012@qq.com>
(cherry picked from commit 2ee8a5c)

# Conflicts:
#	ros_gz_sim/src/delete_entity.cpp
#	ros_gz_sim/src/set_entity_pose.cpp
#	ros_gz_sim/test/test_delete_entity.cpp
#	ros_gz_sim/test/test_set_entity_pose.cpp
#	ros_gz_sim_demos/README.md
@mergify

mergify Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of 2ee8a5c has failed:

On branch mergify/bp/humble/pr-927
Your branch is up to date with 'origin/humble'.

You are currently cherry-picking commit 2ee8a5c.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   ros_gz_sim/src/delete_entity.cpp
	deleted by us:   ros_gz_sim/src/set_entity_pose.cpp
	deleted by us:   ros_gz_sim/test/test_delete_entity.cpp
	deleted by us:   ros_gz_sim/test/test_set_entity_pose.cpp
	both modified:   ros_gz_sim_demos/README.md

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants