-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix publishing only top level model pose in pose publisher #2697
Conversation
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
This is related to #2321. There, I proposed adding a new parameter to publish absolute poses. Any thoughts on that? |
Setting The confusing part currently is how |
This is true, but if the plugin is inside a nested model, it would publish relative poses right? I think having a separate flag to publish the absolute pose regardless of the hierarchy of the model would be good to have. I think it would be less confusing. But I see now that this PR is fixing a bug and I don't want to request a new feature here. I'll keep #2321 open, but won't block this PR.
Agreed! |
I think it's saying that both of the parameters have to be true in order for the pose to be published? So this does not work, i.e. (non-nested) model pose was not published: <publish_model_pose>true</publish_model_pose>
<publish_nested_model_pose>false</publish_nested_model_pose> This line prevented the (non-nested) model pose to be published:
the logic requires both I used the pose_publisher.sdf example world for manual testing. |
ah ok I see. Yes that sounds good to me. |
I see. For some reason, I misread it as "it's not working when both parameters are set to true". |
if (!fillPose) | ||
{ | ||
fillPose = this->publishNestedModelPose && this->publishModelPose; | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, if I understand this correctly, the truth table is:
publish_model_pose |
publish_nested_model_pose |
Top level model is published |
---|---|---|
T | T | T |
T | F | T |
T | X | F |
F | T | F |
F | F | F |
F | X | F |
X | T | T (This is what we want to change in gz-sim10?) |
X | F | F |
X | X | F |
whereas before, it was
publish_model_pose |
publish_nested_model_pose |
Top level model is published |
---|---|---|
T | T | T |
T | F | F (This is the only difference) |
T | X | F |
F | T | F |
F | F | F |
F | X | F |
X | T | T |
X | F | F |
X | X | F |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes my interpretation is the same as what's described in the tables above.
The code change in gz-sim10 would be:
this->dataPtr->publishModelPose =
_sdf->Get<bool>("publish_model_pose",
- this->dataPtr->publishNestedModelPose).first;
+ this->dataPtr->publishdModelPose).first;
and the entry in that table would become:
publish_model_pose |
publish_nested_model_pose |
Top level model is published |
---|---|---|
X | T | F |
🦟 Bug fix
Fixes #2690
Summary
The pose publisher system should now publish top level model pose with these settings:
This PR preserves the behavior and backward compatibility logic that were added in #1342, i.e.
The system should only publish nested model pose with these params:
Backward behavior - if
<publish_model_pose>
is not specified, it defaults to the same value as<publish_nested_model_pose>
- we should remove this behavior in gz-sim10 / jetty. I added a todo note for this.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.