예제 #1
0
파일: chassis.py 프로젝트: valaxkong/SMARTS
 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()
예제 #2
0
파일: bullet.py 프로젝트: zbzhu99/SMARTS
 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)
예제 #3
0
파일: bullet.py 프로젝트: zbzhu99/SMARTS
 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,
     )
예제 #4
0
 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)
예제 #5
0
 def set_pose(self, pose: Pose):
     position, orientation = pose.as_bullet()
     self._client.resetBasePositionAndOrientation(self._bullet_id, position,
                                                  orientation)
예제 #6
0
 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)