Skip to content

Commit

Permalink
use os exit, verify on the hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmy Yang committed Dec 12, 2024
1 parent 84d32de commit f47cb8d
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions spot_rl_experiments/spot_rl/utils/skill_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,22 +592,27 @@ def main():
parser.add_argument("--useful_parameters", action="store_true")
_ = parser.parse_args()

while True:
reset_ros_param()
# Call the skill manager
spotskillmanager = SpotSkillManager(
use_mobile_pick=True, use_semantic_place=True, use_place_ee=True
)
executor = None
try:
while True:
reset_ros_param()
# Call the skill manager
spotskillmanager = SpotSkillManager(
use_mobile_pick=True, use_semantic_place=True, use_place_ee=True
)
executor = None
try:
rospy.set_param("skill_in_execution_lock", False)
executor = SpotRosSkillExecutor(spotskillmanager)
# While loop to run in the background
while not rospy.is_shutdown() and not executor.end:
executor.execute_skills()
except Exception as e:
print(f"Ending script: {e}\n Full exception : {traceback.print_exc()}")
except KeyboardInterrupt:
try:
rospy.set_param("skill_in_execution_lock", False)
executor = SpotRosSkillExecutor(spotskillmanager)
# While loop to run in the background
while not rospy.is_shutdown() and not executor.end:
executor.execute_skills()
except Exception as e:
print(f"Ending script: {e}\n Full exception : {traceback.print_exc()}")
sys.exit()
sys.exit(0)
except SystemExit:
os._exit(0)


if __name__ == "__main__":
Expand Down

0 comments on commit f47cb8d

Please sign in to comment.