-
Notifications
You must be signed in to change notification settings - Fork 102
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 URDF fixed joint reduction of plugins #745
Merged
scpeters
merged 3 commits into
gazebosim:sdf10
from
scpeters:test_fixed_joint_reduction_plugin_10
Nov 12, 2021
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
test/integration/fixed_joint_reduction_plugin_frame_extension.urdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<robot name="chained_fixed_joint_links"> | ||
<gazebo> | ||
<plugin name='test_plugin' filename='libtest_plugin.so'> | ||
<serviceName>/test/plugin/service</serviceName> | ||
<topicName>/test/plugin/topic</topicName> | ||
<bodyName>link2</bodyName> | ||
<updateRate>100</updateRate> | ||
<xyzOffset>0 0 0</xyzOffset> | ||
<rpyOffset>0 0 0</rpyOffset> | ||
</plugin> | ||
</gazebo> | ||
|
||
<!-- Base Link --> | ||
<link name="base_link"> | ||
<collision> | ||
<origin rpy="0 0 0" xyz="0 0 0.0"/> | ||
<geometry> | ||
<box size="1.0 1.0 1"/> | ||
</geometry> | ||
</collision> | ||
<visual> | ||
<origin rpy="0 0 0" xyz="0 0 1.0"/> | ||
<geometry> | ||
<box size="0.1 0.1 2"/> | ||
</geometry> | ||
</visual> | ||
<inertial> | ||
<origin xyz="0 0 1" rpy="0 0 0"/> | ||
<mass value="1"/> | ||
<inertia | ||
ixx="1.0" ixy="0.0" ixz="0.0" | ||
iyy="1.0" iyz="0.0" | ||
izz="1.0"/> | ||
</inertial> | ||
</link> | ||
|
||
<!-- Link 1 --> | ||
<link name="link1"> | ||
<collision> | ||
<origin rpy="0 0 0" xyz="0 0 0.0"/> | ||
<geometry> | ||
<box size="1.0 1.0 1"/> | ||
</geometry> | ||
</collision> | ||
<visual> | ||
<origin rpy="0 0 0" xyz="0 0 0.0"/> | ||
<geometry> | ||
<box size="0.1 0.1 1"/> | ||
</geometry> | ||
</visual> | ||
<inertial> | ||
<origin xyz="0 0 1" rpy="0 0 0"/> | ||
<mass value="1"/> | ||
<inertia | ||
ixx="1.0" ixy="0.0" ixz="0.0" | ||
iyy="1.0" iyz="0.0" | ||
izz="1.0"/> | ||
</inertial> | ||
</link> | ||
|
||
<!-- Link 2 --> | ||
<link name="link2"> | ||
<collision> | ||
<origin rpy="0 0 0" xyz="0 0 0.0"/> | ||
<geometry> | ||
<box size="1.0 1.0 1"/> | ||
</geometry> | ||
</collision> | ||
<visual> | ||
<origin rpy="0 0 0" xyz="0 0 0.0"/> | ||
<geometry> | ||
<box size="0.1 0.1 1"/> | ||
</geometry> | ||
</visual> | ||
<inertial> | ||
<origin xyz="0 0 1" rpy="0 0 0"/> | ||
<mass value="1"/> | ||
<inertia | ||
ixx="1.0" ixy="0.0" ixz="0.0" | ||
iyy="1.0" iyz="0.0" | ||
izz="1.0"/> | ||
</inertial> | ||
</link> | ||
|
||
<!-- Joint 1 --> | ||
<joint name="joint1" type="fixed"> | ||
<parent link="base_link"/> | ||
<child link="link1"/> | ||
<origin rpy="0 0 0.7854" xyz="0 1.0 0.0"/> | ||
<dynamics damping="0.7"/> | ||
</joint> | ||
|
||
<!-- Joint 2 --> | ||
<joint name="joint2" type="fixed"> | ||
<parent link="link1"/> | ||
<child link="link2"/> | ||
<origin rpy="0 0 0.7854" xyz="0 1.0 0.0"/> | ||
<axis xyz="0 1 0"/> | ||
<dynamics damping="0.7"/> | ||
</joint> | ||
</robot> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
add a comment here that there is an extra root element in tinyxml2?
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.
ok, I think it's not an issue with the tinyxml2 API but actually a change in how we used it from #264...
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.
we changed what we store in the SDFExtension data structure here: 6dd6d07#diff-2bc5ca23bcfc66fe173f513399bec8065b1cb4e607d741566517d7368e6bce0fL1315-L1320
I'll update the PR description accordingly
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 refactored the fix in b98b827: I change the function signature so it now accepts an
XMLElement
pointer instead of anXMLDocument
iterator. Then we can callFirstChildElement()
once and pass the resulting pointer, which simplifies the implementation inReduceSDFExtensionPluginFrameReplace
I'll fix the other functions in follow-up pull requests if you think this approach is ok
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.
yep the approach looks good to me.