Fix costmap-resize reinit leak: refresh snapshot instead of recreating planner state
makePlan() no longer tears down and reallocates Spline_Inf/Curve_common when the costmap size or footprint changes — the snapshot is only used to detect the change, so refresh it in place. Destructor now frees the two allocations. initialize() validates the costmap pointer before use. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -90,7 +90,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual ~CustomPlanner(){};
|
||||
~CustomPlanner() override;
|
||||
|
||||
private:
|
||||
void publishStats(int solution_cost, int solution_size,
|
||||
@@ -101,10 +101,10 @@ private:
|
||||
const std::vector<robot_geometry_msgs::Point>& footprint,
|
||||
std::vector<robot_geometry_msgs::Point>& out_footprint);
|
||||
|
||||
Pose pointOnAngleBisector(Pose& A, Pose& B, Pose& C, double length = 1.0);
|
||||
|
||||
bool countRobotDirectionChangeAngle(vector<Pose>& savePosesOnEdge, int& total_edge);
|
||||
|
||||
Pose pointOnAngleBisector(Pose& A, Pose& B, Pose& C, double length);
|
||||
|
||||
inline bool isOppositeSign(double angleA, double angleB)
|
||||
{
|
||||
return (angleA > 0 && angleB < 0) || (angleA < 0 && angleB > 0);
|
||||
@@ -172,4 +172,3 @@ private:
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user