diff --git a/predicators/behavior_utils/option_model_fns.py b/predicators/behavior_utils/option_model_fns.py index 08eefce5ff..f098264cf4 100644 --- a/predicators/behavior_utils/option_model_fns.py +++ b/predicators/behavior_utils/option_model_fns.py @@ -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])) @@ -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])) @@ -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])) @@ -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])) @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( diff --git a/predicators/main.py b/predicators/main.py index b6313b7d49..68c537c983 100644 --- a/predicators/main.py +++ b/predicators/main.py @@ -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() diff --git a/predicators/settings.py b/predicators/settings.py index 1869da78c7..679d831537 100644 --- a/predicators/settings.py +++ b/predicators/settings.py @@ -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