Skip to content

Commit

Permalink
Add set robot pose (#38)
Browse files Browse the repository at this point in the history
* merge renderer.py: add texture to objects, ignore base

* merge Change kuka_kmr default position

* Add set_robot_pose function

* Fix mistake with old version initial_config

* Reformat black

* Add reinitialization of self.collision after robot pose  is changed
  • Loading branch information
kzorina authored Jul 5, 2023
1 parent 682fdfa commit 7ff6495
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion guided_tamp_benchmark/models/robots/kuka_kmr_iiwa_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def initial_configuration(self) -> List[float]:
"""Return the initial configuration of the robot."""
return [
0.2,
1.5,
2.2,
-np.pi,
0,
-np.pi / 4,
Expand Down
9 changes: 9 additions & 0 deletions guided_tamp_benchmark/tasks/base_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ def get_robot_pose(self) -> np.array:
"""Returns the robot base pose as a 4x4 numpy array"""
return self.demo.robot_pose

def set_robot_pose(self, pose: np.array):
"""Sets the robot base pose (4x4 numpy array)"""
self.demo.robot_pose = pose
if self.robot.robot_type == "fixed":
"Move (recreate) box under the robot"
box_pose, box_size = create_box(self)
self.furniture[-1] = Box(pose=box_pose, box_size=box_size)
self.collision = Collision(self)

def get_furniture(self) -> list[FurnitureObject]:
"""Returns the list of furniture instances"""
return self.furniture
Expand Down

0 comments on commit 7ff6495

Please sign in to comment.