-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix URDF fixed joint reduction of plugins (#745)
There is special handling in the parser_urdf code to update plugin fields when links are merged together during fixed joint reduction. A test for this was added to sdf6 in #500. A portion of this test is applied directly to the sdf10 branch to illustrate a problem with ReduceSDFExtensionPluginFrameReplace in parser_urdf.cc. The original migration to use tinyxml2 in #264 changed the data structure used in SDFExtension to store XMLDocuments instead of XMLPointers, which requires an extra call to FirstChildElement, but the ReduceSDFExtension*FrameReplace functions did not receive this update. The fix here refactors the function arguments to pass the first child element directly, which simplifies the helper function implementation. Signed-off-by: Steve Peters <[email protected]>
- Loading branch information
Showing
3 changed files
with
141 additions
and
18 deletions.
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> | ||
|