From 17cd5a2a63290a743e10064000ac01f97c8f2f26 Mon Sep 17 00:00:00 2001 From: StoneT2000 Date: Mon, 4 Mar 2024 17:03:03 -0800 Subject: [PATCH] fix bug where articulation get net contact forces was oriented wrong despite having right shape --- mani_skill2/utils/structs/articulation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mani_skill2/utils/structs/articulation.py b/mani_skill2/utils/structs/articulation.py index 8418b88c5..c7f210cc8 100644 --- a/mani_skill2/utils/structs/articulation.py +++ b/mani_skill2/utils/structs/articulation.py @@ -275,7 +275,10 @@ def get_net_contact_forces(self, link_names: Union[List[str], Tuple[str]]): query = self._net_contact_force_queries[tuple(link_names)] self.px.gpu_query_contact_body_impulses(query) return ( - query.cuda_impulses.torch().clone().reshape(-1, len(link_names), 3) + query.cuda_impulses.torch() + .clone() + .reshape(len(link_names), -1, 3) + .transpose(1, 0) / self._scene.timestep ) else: