Skip to content

Commit 03c2423

Browse files
wkentarostepjam
authored andcommitted
Add pyrep.objects.object.Object.get_velocity
1 parent 758b94c commit 03c2423

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pyrep/objects/object.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,14 @@ def set_pose(self, pose: List[float], relative_to=None,
219219
self.set_position(pose[:3], relative_to, reset_dynamics)
220220
self.set_quaternion(pose[3:], relative_to, reset_dynamics)
221221

222+
def get_velocity(self) -> Tuple[List[float], List[float]]:
223+
"""Get the velocity of this object.
224+
225+
:return: A pair of linear and angular velocity.
226+
"""
227+
linear_vel, angular_vel = sim.simGetObjectVelocity(self._handle)
228+
return linear_vel, angular_vel
229+
222230
def get_parent(self) -> Union['Object', None]:
223231
"""Gets the parent of this object in the scene hierarchy.
224232

0 commit comments

Comments
 (0)