-
Notifications
You must be signed in to change notification settings - Fork 98
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 static URDF models with fixed joints #1193
Conversation
This demonstrates a bug that prevents models with fixed joint reduction from being declared as static. Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Add a boolean flag to indicate when setStaticFlag has been set, since all the other variables in SDFExtension have these flags. Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Codecov Report
@@ Coverage Diff @@
## sdf9 #1193 +/- ##
==========================================
+ Coverage 87.94% 88.33% +0.39%
==========================================
Files 64 63 -1
Lines 10118 10075 -43
==========================================
+ Hits 8898 8900 +2
+ Misses 1220 1175 -45
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
699faa3
to
985f38a
Compare
src/SDFExtension.cc
Outdated
@@ -74,6 +75,7 @@ SDFExtension::SDFExtension(const SDFExtension &_ge) | |||
this->material = _ge.material; | |||
this->visual_blobs = _ge.visual_blobs; | |||
this->collision_blobs = _ge.collision_blobs; | |||
this->isSetStaticFlag = _ge.isSetStaticFlag; |
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.
Can we do something about this line in codecov ?
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.
I just removed the SDFExtension copy constructor and destructor so the class can follow the rule of zero. That should improve coverage.
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.
coverage checker is green; removed 45 missed lines
Delete destructor and copy constructor. Signed-off-by: Steve Peters <scpeters@openrobotics.org>
🦟 Bug fix
Allows URDF models with fixed joint reduction to be declared as
<static>
Summary
Our URDF parser extensions allow a
<static>1</static>
tag inside a<gazebo/>
element (with noreference
attribute) to declare the model as static. Currently, theSDFExtension
data structure does not indicate whether any value for<static>
was specified or not, so every<gazebo>
block will cause a<static>0</static>
value to be added to the resulting SDFormat model. As of #1148, every URDF fixed joint that is reduced (ie. without<preserveFixedJoint>1</preserveFixedJoint>
) will add a<gazebo>
block with<frame>
elements, which would prevent those models from being marked as static. This is illustrated with thefixed_joint_static.urdf
example added in 2dc5c1f with a failing test.A fix is included in 6580927?w=1 (without whitespace) by adding a flag to indicate when the
<static>
element has been set in anSDFExtension
.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.