Skip to content

Commit

Permalink
Remove references to physics view
Browse files Browse the repository at this point in the history
  • Loading branch information
cgokmen committed Dec 13, 2023
1 parent 6e31953 commit 66a46a8
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions omnigibson/prims/entity_prim.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,26 +1084,23 @@ def get_coriolis_and_centrifugal_forces(self):
n-array: (N,) shaped per-DOF coriolis and centrifugal forces experienced by the entity, if articulated
"""
assert self.articulated, "Cannot get coriolis and centrifugal forces for non-articulated entity!"
self._verify_physics_view_is_valid()
return self._physics_view.get_coriolis_and_centrifugal_forces().reshape(self.n_dof)
return self._articulation_view.get_coriolis_and_centrifugal_forces().reshape(self.n_dof)

def get_generalized_gravity_forces(self):
"""
Returns:
n-array: (N, N) shaped per-DOF gravity forces, if articulated
"""
assert self.articulated, "Cannot get generalized gravity forces for non-articulated entity!"
self._verify_physics_view_is_valid()
return self._physics_view.get_generalized_gravity_forces().reshape(self.n_dof)
return self._articulation_view.get_generalized_gravity_forces().reshape(self.n_dof)

def get_mass_matrix(self):
"""
Returns:
n-array: (N, N) shaped per-DOF mass matrix, if articulated
"""
assert self.articulated, "Cannot get mass matrix for non-articulated entity!"
self._verify_physics_view_is_valid()
return self._physics_view.get_mass_matrices().reshape(self.n_dof, self.n_dof)
return self._articulation_view.get_mass_matrices().reshape(self.n_dof, self.n_dof)

def get_jacobian(self):
"""
Expand All @@ -1113,8 +1110,7 @@ def get_jacobian(self):
(i.e.: there is an additional "floating" joint tying the robot to the world frame)
"""
assert self.articulated, "Cannot get jacobian for non-articulated entity!"
self._verify_physics_view_is_valid()
return self._physics_view.get_jacobians().squeeze(axis=0)
return self._articulation_view.get_jacobians().squeeze(axis=0)

def get_relative_jacobian(self):
"""
Expand Down

0 comments on commit 66a46a8

Please sign in to comment.