PyBullet: add signed distance field support, with example/signedDistanceField.py

See also data\toys\concave_box.urdf and data\toys\concave_box.cdf

data\toys\concave_box.cdf was generated from concave_box.obj using
//GenerateSDF.exe -r "32 32 32" -d "-1.6 -1.6 -.6 1.6 1.6 .6" concave_box.obj
//SDF is based on code from DiscreGrid, https://github.com/InteractiveComputerGraphics/Discregrid
This commit is contained in:
Erwin Coumans
2018-04-16 22:57:43 +02:00
parent 982453abc6
commit 552cb5852a
11 changed files with 1121 additions and 24 deletions

View File

@@ -436,9 +436,16 @@ bool UrdfParser::parseGeometry(UrdfGeometry& geom, XMLElement* g, ErrorLogger* l
geom.m_capsuleHeight = m_urdfScaling * urdfLexicalCast<double>(shape->Attribute("length"));
}
}
else if (type_name == "mesh")
else if ((type_name == "mesh") || (type_name == "cdf"))
{
geom.m_type = URDF_GEOM_MESH;
if ((type_name == "cdf"))
{
geom.m_type = URDF_GEOM_CDF;
}
else
{
geom.m_type = URDF_GEOM_MESH;
}
geom.m_meshScale.setValue(1,1,1);
std::string fn;