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

Function setPhysicsProperties

sandbox/simulation_utils.py:67–83  ·  view source on GitHub ↗
(
    geom_model: pin.GeometryModel, material: str, compliance: float
)

Source from the content-addressed store, hash-verified

65
66
67def setPhysicsProperties(
68 geom_model: pin.GeometryModel, material: str, compliance: float
69):
70 for gobj in geom_model.geometryObjects:
71 if material == "ice":
72 gobj.physicsMaterial.materialType = pin.PhysicsMaterialType.ICE
73 elif material == "plastic":
74 gobj.physicsMaterial.materialType = pin.PhysicsMaterialType.PLASTIC
75 elif material == "wood":
76 gobj.physicsMaterial.materialType = pin.PhysicsMaterialType.WOOD
77 elif material == "metal":
78 gobj.physicsMaterial.materialType = pin.PhysicsMaterialType.METAL
79 elif material == "concrete":
80 gobj.physicsMaterial.materialType = pin.PhysicsMaterialType.CONCRETE
81
82 # Compliance
83 gobj.physicsMaterial.compliance = compliance
84
85
86def removeBVHModelsIfAny(geom_model: pin.GeometryModel):

Callers 3

test_memory.pyFile · 0.90
go2_contact_id.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected