Skip to content
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

URDFTools can take a Collection<InputStream> as the first parameters to allow for splitting the URDF up into multiple files #172

Merged
merged 24 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
26bcbdf
Initial attempt at getting the URDF to be split up, it loads properly…
PotatoPeeler3000 Mar 12, 2024
2dfe0e0
Added Gazebo models so the URDF is loaded properly
PotatoPeeler3000 Mar 12, 2024
ecdc44e
Fix breaking tests
PotatoPeeler3000 Mar 12, 2024
04ce97e
Fix merging all the gazebos
PotatoPeeler3000 Mar 12, 2024
0b4374f
Added fix for handleing implicit joint definitions
PotatoPeeler3000 Mar 12, 2024
3559164
Files cleanup because AI isn't the brightest
PotatoPeeler3000 Mar 12, 2024
024de25
Added tests for loading multiple URDF's, created a couple simple URDF…
PotatoPeeler3000 Mar 21, 2024
2414126
Prevent loading duplicate joints by checking if they already exist
PotatoPeeler3000 Mar 21, 2024
8ea0cd2
Updated tests, added a few more, prints are more clear
PotatoPeeler3000 Mar 22, 2024
429fe06
More testing on real robot, still have lots of problems with logger
Mar 23, 2024
28958c7
Got working while logging, need to go through and combine commits
PotatoPeeler3000 Mar 25, 2024
f8b5db4
Tested loading a real log without the composed robot
PotatoPeeler3000 Mar 25, 2024
c052427
More comments
PotatoPeeler3000 Mar 25, 2024
444d3a5
Addressed PR comments. Added more documentation, updated variable nam…
PotatoPeeler3000 Apr 2, 2024
7c369cb
Added method to check if the model is a root model, added docs
PotatoPeeler3000 Apr 2, 2024
4e70560
Update tests to check that the correct name is gotten
PotatoPeeler3000 Apr 2, 2024
0c1eb00
Change method to take in a parent and a child, and the name and paren…
PotatoPeeler3000 Apr 2, 2024
c2b182e
Update RobotModelLoader.java to before PR
PotatoPeeler3000 Apr 2, 2024
f301869
Save still needs work
PotatoPeeler3000 Apr 4, 2024
47e9a82
Fix tests, add better doc for them
Apr 5, 2024
8f2c61b
Fix comments
Apr 5, 2024
f2b98ca
Inline method, add new constructor to allow for more options
Apr 5, 2024
223f9bd
Don't need to worry about parent model being set because the URDF can…
Apr 5, 2024
e818a89
Don't initialize the variable, set to null just needed for reference
Apr 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions scs2-examples/src/main/resources/urdf/limbA.urdf
PotatoPeeler3000 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" ?>
<robot name="limbA" xmlns:xacro="http://ros.org/wiki/xacro">

<joint name="jointA" type="revolute">
<axis xyz="0 1 0"/>
<origin rpy="0 0 0" xyz="0.1 0 0.2"/>
<parent link="baseLink"/>
<child link="bodyAB"/>
<limit effort="190" lower="-1.1" upper="0.4141" velocity="5.89"/>
</joint>
<link name="bodyAB">
<inertial>
<mass value="0.025"/>
<origin rpy="0 0 0" xyz="0 0 0.1"/>
<inertia ixx="1.0e-8" ixy="0" ixz="0" iyy="1.0e-8" iyz="0" izz="1.0e-8"/>
</inertial>
<visual>
<geometry>
<cylinder radius="0.0125" length="0.4"/>
</geometry>
<material>
<color rgba="0.92 0.85 0.2 1"/>
</material>
<origin rpy="0 0 0" xyz="0 0 0.1"/>
</visual>
</link>
<joint name="jointB" type="revolute">
<axis xyz="0 1 0"/>
<origin rpy="0 0 0" xyz="0 0 0.2"/>
<parent link="bodyAB"/>
<child link="endEffectorLink"/>
<limit effort="190" lower="-1.1" upper="0.4141" velocity="5.89"/>
<mimic joint="jointA" multiplier="1.25" offset="0"/>
</joint>
<link name="endEffectorLink">
<inertial>
<mass value="5"/>
<origin rpy="0 0 0" xyz="0 0 0.1"/>
<inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.005"/>
</inertial>
<visual>
<geometry>
<box size="0.0125 0.0125 0.2"/>
</geometry>
<material>
<color rgba="0.2 0.7 0.9 1"/>
</material>
<origin rpy="0 0 0" xyz="0 0 0.1"/>
</visual>
</link>
<joint name="jointC" type="revolute">
<axis xyz="1 0 0"/>
<origin rpy="0 0 0" xyz="0.1 0 0.0"/>
<parent link="baseLink"/>
<child link="head"/>
<limit effort="190" lower="-1.1" upper="0.4141" velocity="5.89"/>
</joint>
<link name="head">
<visual>
<geometry>
<sphere radius="0.1"/>
</geometry>
<material>
<color rgba="0.2 0.7 0.9 1"/>
</material>
<origin rpy="0 0 0" xyz="0.1 0 0.3"/>
</visual>
</link>
</robot>
69 changes: 69 additions & 0 deletions scs2-examples/src/main/resources/urdf/limbB.urdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" ?>
<robot name="limbB" xmlns:xacro="http://ros.org/wiki/xacro">

<joint name="jointA" type="revolute">
<axis xyz="0 1 0"/>
<origin rpy="0 0 0" xyz="0.1 0 0.2"/>
<parent link="baseLink"/>
<child link="bodyAB"/>
<limit effort="190" lower="-1.1" upper="0.4141" velocity="5.89"/>
</joint>
<link name="bodyAB">
<inertial>
<mass value="0.025"/>
<origin rpy="0 0 0" xyz="0 0 0.1"/>
<inertia ixx="1.0e-8" ixy="0" ixz="0" iyy="1.0e-8" iyz="0" izz="1.0e-8"/>
</inertial>
<visual>
<geometry>
<cylinder radius="0.0125" length="0.4"/>
</geometry>
<material>
<color rgba="0.92 0.85 0.2 1"/>
</material>
<origin rpy="0 0 0" xyz="0 0 0.1"/>
</visual>
</link>
<joint name="jointB" type="revolute">
<axis xyz="0 1 0"/>
<origin rpy="0 0 0" xyz="0 0 0.2"/>
<parent link="bodyAB"/>
<child link="endEffectorLink"/>
<limit effort="190" lower="-1.1" upper="0.4141" velocity="5.89"/>
<mimic joint="jointA" multiplier="1.25" offset="0"/>
</joint>
<link name="endEffectorLink">
<inertial>
<mass value="5"/>
<origin rpy="0 0 0" xyz="0 0 0.1"/>
<inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.005"/>
</inertial>
<visual>
<geometry>
<box size="0.0125 0.0125 0.2"/>
</geometry>
<material>
<color rgba="0.2 0.7 0.9 1"/>
</material>
<origin rpy="0 0 0" xyz="0 0 0.1"/>
</visual>
</link>
<joint name="jointC" type="revolute">
<axis xyz="1 0 0"/>
<origin rpy="0 0 0" xyz="0.1 0 0.0"/>
<parent link="baseLink"/>
<child link="head"/>
<limit effort="190" lower="-1.1" upper="0.4141" velocity="5.89"/>
</joint>
<link name="head">
<visual>
<geometry>
<sphere radius="0.1"/>
</geometry>
<material>
<color rgba="0.2 0.7 0.9 1"/>
</material>
<origin rpy="0 0 0" xyz="0.1 0 0.3"/>
</visual>
</link>
</robot>
32 changes: 32 additions & 0 deletions scs2-examples/src/main/resources/urdf/torso.urdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" ?>
<robot name="rootModel">
<link name="baseLink">
<visual>
<geometry>
<sphere radius="0.1"/>
</geometry>
<material>
<color rgba="0.2 0.7 0.9 1"/>
</material>
<origin rpy="0 0 0" xyz="0.1 0 0.3"/>
</visual>
</link>
<joint name="jointC" type="revolute">
<axis xyz="1 0 0"/>
<origin rpy="0 0 0" xyz="0.1 0 0.0"/>
<parent link="baseLink"/>
<child link="head"/>
<limit effort="190" lower="-1.1" upper="0.4141" velocity="5.89"/>
</joint>
<link name="head">
<visual>
<geometry>
<sphere radius="0.1"/>
</geometry>
<material>
<color rgba="0.2 0.7 0.9 1"/>
</material>
<origin rpy="0 0 0" xyz="0.1 0 0.3"/>
</visual>
</link>
</robot>
79 changes: 79 additions & 0 deletions scs2-examples/src/main/resources/urdf/torsoAndLimb.urdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" ?>
<robot name="torsoAndLimb" xmlns:xacro="http://ros.org/wiki/xacro">
<link name="baseLink">
<visual>
<geometry>
<sphere radius="0.1"/>
</geometry>
<material>
<color rgba="0.2 0.7 0.9 1"/>
</material>
<origin rpy="0 0 0" xyz="0.1 0 0.3"/>
</visual>
</link>
<joint name="jointA" type="revolute">
<axis xyz="0 1 0"/>
<origin rpy="0 0 0" xyz="0.1 0 0.2"/>
<parent link="baseLink"/>
<child link="bodyAB"/>
<limit effort="190" lower="-1.1" upper="0.4141" velocity="5.89"/>
</joint>
<link name="bodyAB">
<inertial>
<mass value="0.025"/>
<origin rpy="0 0 0" xyz="0 0 0.1"/>
<inertia ixx="1.0e-8" ixy="0" ixz="0" iyy="1.0e-8" iyz="0" izz="1.0e-8"/>
</inertial>
<visual>
<geometry>
<cylinder radius="0.0125" length="0.4"/>
</geometry>
<material>
<color rgba="0.92 0.85 0.2 1"/>
</material>
<origin rpy="0 0 0" xyz="0 0 0.1"/>
</visual>
</link>
<joint name="jointB" type="revolute">
<axis xyz="0 1 0"/>
<origin rpy="0 0 0" xyz="0 0 0.2"/>
<parent link="bodyAB"/>
<child link="endEffectorLink"/>
<limit effort="190" lower="-1.1" upper="0.4141" velocity="5.89"/>
<mimic joint="jointA" multiplier="1.25" offset="0"/>
</joint>
<link name="endEffectorLink">
<inertial>
<mass value="5"/>
<origin rpy="0 0 0" xyz="0 0 0.1"/>
<inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.005"/>
</inertial>
<visual>
<geometry>
<box size="0.0125 0.0125 0.2"/>
</geometry>
<material>
<color rgba="0.2 0.7 0.9 1"/>
</material>
<origin rpy="0 0 0" xyz="0 0 0.1"/>
</visual>
</link>
<joint name="jointC" type="revolute">
<axis xyz="1 0 0"/>
<origin rpy="0 0 0" xyz="0.1 0 0.0"/>
<parent link="baseLink"/>
<child link="head"/>
<limit effort="190" lower="-1.1" upper="0.4141" velocity="5.89"/>
</joint>
<link name="head">
<visual>
<geometry>
<sphere radius="0.1"/>
</geometry>
<material>
<color rgba="0.2 0.7 0.9 1"/>
</material>
<origin rpy="0 0 0" xyz="0.1 0 0.3"/>
</visual>
</link>
</robot>
32 changes: 32 additions & 0 deletions scs2-examples/src/main/resources/urdf/torsoChild.urdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" ?>
<robot name="child">
<link name="head">
<visual>
<geometry>
<sphere radius="0.1"/>
</geometry>
<material>
<color rgba="0.2 0.7 0.9 1"/>
</material>
<origin rpy="0 0 0" xyz="0.1 0 0.3"/>
</visual>
</link>
<joint name="jointA" type="revolute">
<axis xyz="1 0 0"/>
<origin rpy="0 0 0" xyz="0.1 0 0.3"/>
<parent link="head"/>
<child link="ear"/>
<limit effort="190" lower="-1.1" upper="0.4141" velocity="5.89"/>
</joint>
<link name="ear">
<visual>
<geometry>
<sphere radius="0.05"/>
</geometry>
<material>
<color rgba="0.1 0.2 0.3 1"/>
</material>
<origin rpy="0 0 0 " xyz="0.1 0 0.3"/>
</visual>
</link>
</robot>
21 changes: 21 additions & 0 deletions scs2-examples/src/main/resources/urdf/torsoParent.urdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" ?>
<robot name="rootModelParent">
<link name="baseLink">
<visual>
<geometry>
<sphere radius="0.1"/>
</geometry>
<material>
<color rgba="0.2 0.7 0.9 1"/>
</material>
<origin rpy="0 0 0" xyz="0.1 0 0.3"/>
</visual>
</link>
<joint name="jointC" type="revolute">
<axis xyz="1 0 0"/>
<origin rpy="0 0 0" xyz="0.1 0 0.0"/>
<parent link="baseLink"/>
<child link="head"/>
<limit effort="190" lower="-1.1" upper="0.4141" velocity="5.89"/>
</joint>
</robot>
Loading
Loading