Skip to content

Commit 5072fbd

Browse files
committed
correct error massages and fix bug
1 parent 7e08974 commit 5072fbd

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

moveit_planners/pilz_industrial_motion_planner/src/path_free_generator.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ double PathFreeGenerator::computeBlendRadius(const std::vector<KDL::Frame>& wayp
101101
}
102102

103103
// The maximum feasible radius for this junction
104-
double local_max_radius = std::tan(segment_angle(waypoints_[i - 1], waypoints_[i], waypoints_[i + 1]) / 2.0) *
105-
std::min(dist1 / 2.0, dist2 / 2.0);
104+
double local_max_radius =
105+
std::tan((M_PI - segment_angle(waypoints_[i - 1], waypoints_[i], waypoints_[i + 1])) / 2.0) *
106+
std::min(dist1 / 2.0, dist2 / 2.0);
106107

107108
// track the tightest constraint
108109
// due to KDL::Path_RoundedComposite don't support changing radius

moveit_planners/pilz_industrial_motion_planner/src/trajectory_generator_free.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,14 @@ void TrajectoryGeneratorFree::plan(const planning_scene::PlanningSceneConstPtr&
141141
catch (const KDL::Error_MotionPlanning& e)
142142
{
143143
RCLCPP_ERROR(getLogger(), "Motion planning error: %s", e.Description());
144+
int code = e.GetType();
144145
std::ostringstream os;
145-
os << "waypoints specified in path constraints have three consicutive colinear points";
146+
if (code == 3102 || code == 3103)
147+
os << "zero distance between two points";
148+
else if (code == 3104)
149+
os << "waypoints specified in path constraints have three consicutive colinear points";
150+
else if (code == 3105 || code == 3106)
151+
os << "rounding circle of a point is bigger than the distance with one of the neighbor points";
146152
throw ConsicutiveColinearWaypoints(os.str());
147153
}
148154
// create velocity profile

0 commit comments

Comments
 (0)