Skip to content

Commit

Permalink
Sciurus17と共通化
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuwamai committed Jan 29, 2025
1 parent f1e1806 commit aeea090
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions crane_x7_examples_py/crane_x7_examples_py/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit aeea090

Please sign in to comment.