Skip to content

Commit 4d2b4e3

Browse files
committed
Update urdf.py
1 parent 86a3168 commit 4d2b4e3

File tree

1 file changed

+11
-1
lines changed
  • src/pytorch_kinematics/urdf_parser_py

1 file changed

+11
-1
lines changed

src/pytorch_kinematics/urdf_parser_py/urdf.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ def __init__(self, radius=0.0, length=0.0):
101101
xmlr.Attribute('length', float)
102102
])
103103

104+
class Capsule(xmlr.Object):
105+
def __init__(self, radius=0.0, length=0.0):
106+
self.radius = radius
107+
self.length = length
108+
109+
xmlr.reflect(Capsule, tag='capsule', params=[
110+
xmlr.Attribute('radius', float),
111+
xmlr.Attribute('length', float)
112+
])
104113

105114
class Sphere(xmlr.Object):
106115
def __init__(self, radius=0.0):
@@ -130,7 +139,8 @@ def __init__(self):
130139
'box': Box,
131140
'cylinder': Cylinder,
132141
'sphere': Sphere,
133-
'mesh': Mesh
142+
'mesh': Mesh,
143+
'capsule': Capsule
134144
})
135145

136146
def from_xml(self, node, path):

0 commit comments

Comments
 (0)