Skip to content

Commit

Permalink
delete pour
Browse files Browse the repository at this point in the history
  • Loading branch information
andipeng committed May 28, 2024
1 parent d10ea6a commit f58b062
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 146 deletions.
139 changes: 0 additions & 139 deletions predicators/spot_utils/move_and_pour.py

This file was deleted.

Binary file modified predicators/spot_utils/perception/no_detection_artifacts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions predicators/spot_utils/perception/plant-short/plant1.txt

This file was deleted.

2 changes: 0 additions & 2 deletions predicators/spot_utils/perception/plant-short/plant2.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Detected LanguageID(potted plant) at position -- X: 0.220 Y: -0.410 Z: 0.179 rotation -- W: 1.0000 X: 0.0000 Y: 0.0000 Z: 0.0000
Robot pose: position -- X: 3.858 Y: -0.051 Z: 0.151 rotation -- W: -0.1692 X: -0.0010 Y: -0.0006 Z: 0.9856
Hand pose: position -- X: 3.306 Y: -0.049 Z: -0.069 rotation -- W: -0.1694 X: -0.0076 Y: 0.0005 Z: 0.9855
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Detected LanguageID(potted plant) at position -- X: 0.923 Y: -0.274 Z: 0.134 rotation -- W: 1.0000 X: 0.0000 Y: 0.0000 Z: 0.0000
Robot pose: position -- X: 2.464 Y: -0.468 Z: 0.123 rotation -- W: -0.4515 X: -0.0017 Y: -0.0006 Z: 0.8923
Hand pose: position -- X: -0.145 Y: -0.394 Z: 1.741 rotation -- W: -0.3294 X: -0.7136 Y: 0.3309 Z: 0.5222
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Detected LanguageID(potted plant) at position -- X: 0.980 Y: -0.268 Z: -0.131 rotation -- W: 1.0000 X: 0.0000 Y: 0.0000 Z: 0.0000
Robot pose: position -- X: 1.852 Y: -0.317 Z: 0.029 rotation -- W: 0.2490 X: 0.0311 Y: 0.0058 Z: -0.9680
Hand pose: position -- X: 0.075 Y: 0.240 Z: 0.962 rotation -- W: 0.2966 X: 0.6067 Y: -0.3155 Z: -0.6666
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Detected LanguageID(potted plant) at position -- X: 0.994 Y: -0.582 Z: 0.143 rotation -- W: 1.0000 X: 0.0000 Y: 0.0000 Z: 0.0000
Robot pose: position -- X: 3.652 Y: 0.111 Z: -0.088 rotation -- W: -0.1436 X: -0.0009 Y: -0.0005 Z: 0.9896
Hand pose: position -- X: 3.104 Y: 0.112 Z: -0.307 rotation -- W: -0.1438 X: -0.0079 Y: 0.0005 Z: 0.9896
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Detected LanguageID(potted plant) at position -- X: 0.504 Y: 1.954 Z: 0.843 rotation -- W: 1.0000 X: 0.0000 Y: 0.0000 Z: 0.0000
Robot pose: position -- X: 2.543 Y: -0.501 Z: 0.124 rotation -- W: -0.2786 X: -0.0007 Y: -0.0019 Z: 0.9604
Hand pose: position -- X: 1.992 Y: -0.501 Z: -0.111 rotation -- W: -0.2787 X: -0.0075 Y: 0.0002 Z: 0.9604
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Detected LanguageID(potted plant) at position -- X: 0.501 Y: 2.020 Z: 0.769 rotation -- W: 1.0000 X: 0.0000 Y: 0.0000 Z: 0.0000
Robot pose: position -- X: 1.910 Y: -0.327 Z: 0.189 rotation -- W: 0.3682 X: -0.0260 Y: -0.0118 Z: -0.9293
Hand pose: position -- X: -0.155 Y: 0.098 Z: 1.046 rotation -- W: 0.2218 X: 0.6180 Y: -0.4710 Z: -0.5891

This file was deleted.

13 changes: 13 additions & 0 deletions predicators/spot_utils/sample_and_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ def reward_function(input_traj: List[Tuple[float, float]]) -> float:
reward += -np.linalg.norm(np.array([desired_trajectory[i][0], desired_trajectory[i][1]]) - np.array([waypoint[0], waypoint[1]]))
return reward

# ANDI to modify
#def reward_network(input_traj: List[Tuple[float, float]]) -> float:
# self.cost_nn = MLP(input_dim, 1, [], output_activation=None).to(self.device)
# self.optimizer = optim.Adam(self.cost_nn.parameters(), lr=params["lr"])

#def calc_cost(self, traj):
# traj = torch.tensor(traj, dtype=torch.float32).to(self.device)
# return self.cost_nn(traj).item()

# Example sampler.
spot_home_pose = get_spot_home_pose()
max_reward = -np.inf
Expand All @@ -95,6 +104,10 @@ def reward_function(input_traj: List[Tuple[float, float]]) -> float:
if reward_function(curr_traj) > max_reward:
max_reward = reward_function(curr_traj)
max_reward_traj = curr_traj
# ANDI TO MODIFY + ADD
# if calc_cost(curr_traj) < max_cost:
# min_cost = calc_cost(curr_traj)
# min_cost_traj = curr_traj
assert max_reward_traj is not None

print(max_reward_traj)
Expand Down

0 comments on commit f58b062

Please sign in to comment.