Skip to content

Commit 3e70948

Browse files
IPA-KUT-CLipa-kut
authored andcommitted
feature: executePlanToPose
1 parent f3fe583 commit 3e70948

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

include/ur_manipulation/moveit_custom_api.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class MoveitCustomApi
5555
void executeCartesianTrajForWaypoints(std::vector<geometry_msgs::Pose> waypoints, double eef = 0.001, double jump_thresh = 0.0);
5656
void executeCartesianTrajtoPose(geometry_msgs::Pose target, std::string label);
5757
void adjustTrajectoryToFixTimeSequencing(moveit_msgs::RobotTrajectory &trajectory);
58+
void executePlanToPose(geometry_msgs::Pose target, std::string label);
5859

5960
private:
6061
moveit::planning_interface::PlanningSceneInterface planning_scene_interface;

src/moveit_custom_api.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,3 +666,20 @@ moveit::planning_interface::MoveGroupInterface::Plan MoveitCustomApi::
666666
}
667667
return my_plan;
668668
}
669+
670+
void MoveitCustomApi::executePlanToPose(geometry_msgs::Pose target, std::string label)
671+
{
672+
int trial = 0;
673+
while (trial < max_trials)
674+
{
675+
if (moveGroupExecutePlan(getPlanToPoseTarget(target, 3, label)))
676+
{
677+
return;
678+
}
679+
ROS_ERROR_STREAM("Execution to " << label << " trial " << trial++ << " failed. Reattempting");
680+
failure_counter_++;
681+
}
682+
ROS_ERROR_STREAM("Maxx execution attempts reached, aborting program");
683+
ros::shutdown();
684+
exit(-1);
685+
}

0 commit comments

Comments
 (0)