Function
transform_object
(
viz: MeshcatVisualizer, shape: hppfcl.ShapeBase, shape_name: str, M: pin.SE3
)
Source from the content-addressed store, hash-verified
| 109 | |
| 110 | |
| 111 | def transform_object( |
| 112 | viz: MeshcatVisualizer, shape: hppfcl.ShapeBase, shape_name: str, M: pin.SE3 |
| 113 | ) -> None: |
| 114 | if isinstance(shape, (hppfcl.Plane, hppfcl.Halfspace)): |
| 115 | T = M.copy() |
| 116 | T.translation += M.rotation @ (shape.d * shape.n) |
| 117 | T = T.homogeneous |
| 118 | else: |
| 119 | T = M.homogeneous |
| 120 | |
| 121 | # Update viewer configuration. |
| 122 | viz.viewer[shape_name].set_transform(T) |
| 123 | return |
| 124 | |
| 125 | |
| 126 | def delete_object(viz: MeshcatVisualizer, name: str): |
Tested by
no test coverage detected