diff --git a/crane_x7_examples_py/crane_x7_examples_py/utils.py b/crane_x7_examples_py/crane_x7_examples_py/utils.py index ffddb3dc..210e1c65 100644 --- a/crane_x7_examples_py/crane_x7_examples_py/utils.py +++ b/crane_x7_examples_py/crane_x7_examples_py/utils.py @@ -27,24 +27,20 @@ def plan_and_execute( logger = get_logger('plan_and_execute') logger.info('Planning trajectory') if multi_plan_parameters is not None: - plan_result = planning_component.plan( - multi_plan_parameters=multi_plan_parameters - ) + plan_result = planning_component.plan(multi_plan_parameters=multi_plan_parameters) elif single_plan_parameters is not None: - plan_result = planning_component.plan( - single_plan_parameters=single_plan_parameters - ) + plan_result = planning_component.plan(single_plan_parameters=single_plan_parameters) else: plan_result = planning_component.plan() # execute the plan - result = None if plan_result: logger.info('Executing plan') robot_trajectory = plan_result.trajectory - result = robot.execute(robot_trajectory, controllers=[]) + execute_result = robot.execute(robot_trajectory, controllers=[]) else: logger.error('Planning failed') - result = False + execute_result = False + time.sleep(sleep_time) - return result + return execute_result