Skip to content

Commit

Permalink
added is_running_rrt
Browse files Browse the repository at this point in the history
  • Loading branch information
wmcclinton committed Nov 2, 2023
1 parent 8ae90d2 commit 99a9ba9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
20 changes: 10 additions & 10 deletions predicators/behavior_utils/option_model_fns.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def graspObjectOptionModel(_state: State, env: "BehaviorEnv") -> None:
rh_orig_grasp_orn = env.robots[0].parts["right_hand"].get_orientation()

# Simulate Arm Movement
if CFG.behavior_option_model_rrt:
if CFG.is_running_rrt:
for step in plan:
env.robots[0].parts["right_hand"].set_position_orientation(
step[0:3], p.getQuaternionFromEuler(step[3:6]))
Expand Down Expand Up @@ -159,7 +159,7 @@ def graspObjectOptionModel(_state: State, env: "BehaviorEnv") -> None:
env.step(a)

# Simulate Arm Movement (Backwards)
if CFG.behavior_option_model_rrt:
if CFG.is_running_rrt:
for step in reversed(plan):
env.robots[0].parts["right_hand"].set_position_orientation(
step[0:3], p.getQuaternionFromEuler(step[3:6]))
Expand Down Expand Up @@ -218,7 +218,7 @@ def placeOntopObjectOptionModel(_init_state: State,
f"params {target_pos}")

# Simulate Arm Movement
if CFG.behavior_option_model_rrt:
if CFG.is_running_rrt:
for step in plan:
env.robots[0].parts["right_hand"].set_position_orientation(
step[0:3], p.getQuaternionFromEuler(step[3:6]))
Expand All @@ -242,7 +242,7 @@ def placeOntopObjectOptionModel(_init_state: State,
)

# Simulate Arm Movement (Backwards)
if CFG.behavior_option_model_rrt:
if CFG.is_running_rrt:
for step in reversed(plan):
env.robots[0].parts["right_hand"].set_position_orientation(
step[0:3], p.getQuaternionFromEuler(step[3:6]))
Expand Down Expand Up @@ -418,7 +418,7 @@ def placeInsideObjectOptionModel(_init_state: State,
f"params {target_pos}")

# Simulate Arm Movement
if CFG.behavior_option_model_rrt:
if CFG.is_running_rrt:
for step in plan:
env.robots[0].parts[
"right_hand"].set_position_orientation(
Expand All @@ -442,7 +442,7 @@ def placeInsideObjectOptionModel(_init_state: State,
angularVelocity=[0, 0, 0],
)
# Simulate Arm Movement (Backwards)
if CFG.behavior_option_model_rrt:
if CFG.is_running_rrt:
for step in reversed(plan):
env.robots[0].parts[
"right_hand"].set_position_orientation(
Expand Down Expand Up @@ -532,7 +532,7 @@ def placeUnderObjectOptionModel(_init_state: State,
f"params {target_pos}")

# Simulate Arm Movement
if CFG.behavior_option_model_rrt:
if CFG.is_running_rrt:
for step in plan:
env.robots[0].parts[
"right_hand"].set_position_orientation(
Expand All @@ -557,7 +557,7 @@ def placeUnderObjectOptionModel(_init_state: State,
)

# Simulate Arm Movement (Backwards)
if CFG.behavior_option_model_rrt:
if CFG.is_running_rrt:
for step in reversed(plan):
env.robots[0].parts[
"right_hand"].set_position_orientation(
Expand Down Expand Up @@ -677,7 +677,7 @@ def placeNextToObjectOptionModel(_init_state: State,
f"params {target_pos}")

# Simulate Arm Movement
if CFG.behavior_option_model_rrt:
if CFG.is_running_rrt:
for step in plan:
env.robots[0].parts[
"right_hand"].set_position_orientation(
Expand All @@ -702,7 +702,7 @@ def placeNextToObjectOptionModel(_init_state: State,
)

# Simulate Arm Movement (Backwards)
if CFG.behavior_option_model_rrt:
if CFG.is_running_rrt:
for step in reversed(plan):
env.robots[0].parts[
"right_hand"].set_position_orientation(
Expand Down
1 change: 1 addition & 0 deletions predicators/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ def _run_testing(env: BaseEnv, approach: BaseApproach) -> Metrics:
option_model_start_time = time.time()
if CFG.env == "behavior" and \
CFG.behavior_mode == 'iggui': # pragma: no cover
CFG.is_running_rrt = True
env = get_or_create_env('behavior')
assert isinstance(env, BehaviorEnv)
win = curses.initscr()
Expand Down
1 change: 1 addition & 0 deletions predicators/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class GlobalSettings:
behavior_closeness_limit = 1.00
# if this is True, then we will not use discovered failures in behavior.
behavior_ignore_discover_failures = True
is_running_rrt = False
create_training_dataset = False
simulate_nav = False

Expand Down

0 comments on commit 99a9ba9

Please sign in to comment.