Support capsules in URDF import.
PiperOrigin-RevId: 489980760 Change-Id: I1c21e736a86f6637a00e2062727d2e6fd5694c42
This commit is contained in:
committed by
Copybara-Service
parent
45b3af78a0
commit
638c9a6994
@@ -470,6 +470,14 @@ mjCGeom* mjXURDF::Geom(XMLElement* geom_elem, mjCBody* pbody, bool collision) {
|
||||
ReadAttr(temp, "radius", 1, pgeom->size, text, true, true);
|
||||
}
|
||||
|
||||
// capsule
|
||||
else if ((temp = FindSubElem(elem, "capsule"))) {
|
||||
pgeom->type = mjGEOM_CAPSULE;
|
||||
ReadAttr(temp, "radius", 1, pgeom->size, text, true, true);
|
||||
ReadAttr(temp, "length", 1, pgeom->size+1, text, true, true);
|
||||
pgeom->size[1] /= 2; // MuJoCo uses half-length
|
||||
}
|
||||
|
||||
// mesh
|
||||
else if ((temp = FindSubElem(elem, "mesh"))) {
|
||||
// set geom type and read mesh attributes
|
||||
|
||||
Reference in New Issue
Block a user