def set_pose(self, pose: Pose): """Use with caution since it disrupts the physics simulation. Sets the pose of the chassis. """ position, orientation = pose.as_bullet() self._client.resetBasePositionAndOrientation(self._bullet_id, position, orientation) self._clear_step_cache()
def move_to(self, pose: Pose): if not self._bullet_cid: self._make_constraint(pose) position, orientation = pose.as_bullet() # TODO: Consider to remove offset when collision is improved # Move contraints slightly up to avoid ground collision ground_position = position + [0, 0, 0.2] self._client.changeConstraint(self._bullet_cid, ground_position, orientation)
def reset_pose(self, pose: Pose): """Only call this before it needs to do anything physics-wise""" position, orientation = pose.as_bullet() self._client.resetBasePositionAndOrientation( self._bullet_id, np.sum([position, [0, 0, self._height * 0.5]], axis=0), orientation, )
def move_to(self, pose: Pose): """Moves the constraint to the given pose. The attached shape will attempt to follow.""" if not self._bullet_cid: self._make_constraint(pose) position, orientation = pose.as_bullet() # TODO: Consider to remove offset when collision is improved # Move constraints slightly up to avoid ground collision ground_position = position + [0, 0, 0.2] self._client.changeConstraint(self._bullet_cid, ground_position, orientation)
def set_pose(self, pose: Pose): position, orientation = pose.as_bullet() self._client.resetBasePositionAndOrientation(self._bullet_id, position, orientation)
def set_pose(self, pose: Pose): position, orientation = pose.as_bullet() self._client.resetBasePositionAndOrientation(self.bullet_id, position, orientation) self._bullet_constraint.move_to(pose)