MCPcopy Create free account
hub / github.com/Simple-Robotics/Simple / addMaterialAndCompliance

Function addMaterialAndCompliance

sandbox/sim_utils.py:217–233  ·  view source on GitHub ↗
(geom_model, material: str, compliance: float)

Source from the content-addressed store, hash-verified

215
216
217def addMaterialAndCompliance(geom_model, material: str, compliance: float):
218 for gobj in geom_model.geometryObjects:
219 if material == "ice":
220 gobj.physicsMaterial.materialType = pin.PhysicsMaterialType.ICE
221 elif material == "plastic":
222 gobj.physicsMaterial.materialType = pin.PhysicsMaterialType.PLASTIC
223 elif material == "wood":
224 gobj.physicsMaterial.materialType = pin.PhysicsMaterialType.WOOD
225 elif material == "metal":
226 gobj.physicsMaterial.materialType = pin.PhysicsMaterialType.METAL
227 elif material == "concrete":
228 gobj.physicsMaterial.materialType = pin.PhysicsMaterialType.CONCRETE
229 else:
230 raise Exception("Material unknown.")
231
232 # Compliance
233 gobj.physicsMaterial.compliance = compliance
234
235
236def printSimulationPerfStats(step_timings: np.ndarray):

Callers 2

humanoid_mj.pyFile · 0.90
cassie_mj.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected