fix tebplanner

This commit is contained in:
Robofish 2026-03-09 14:47:17 +08:00
parent a829de6565
commit 37554e7dd7
3 changed files with 8 additions and 6 deletions

View File

@ -54,6 +54,7 @@
#include <std_msgs/msg/color_rgba.hpp>
#include <rclcpp/rclcpp.hpp>
#include <nav2_util/lifecycle_node.hpp>
#include "teb_local_planner/planner_interface.h"
#include "teb_local_planner/teb_config.h"

View File

@ -41,6 +41,7 @@
#include <math.h>
#include <nav2_util/lifecycle_node.hpp>
// teb stuff
#include "teb_local_planner/teb_config.h"
@ -130,12 +131,12 @@ public:
*/
TebOptimalPlanner(nav2_util::LifecycleNode::SharedPtr node, const TebConfig& cfg, ObstContainer* obstacles = NULL,
TebVisualizationPtr visual = TebVisualizationPtr(), const ViaPointContainer* via_points = NULL);
/**
* @brief Destruct the optimal planner.
*/
virtual ~TebOptimalPlanner();
/**
* @brief Initializes the optimal planner
* @param node Shared pointer for rclcpp::Node

View File

@ -64,11 +64,11 @@ namespace teb_local_planner
TebOptimalPlanner::TebOptimalPlanner() : cfg_(nullptr), obstacles_(NULL), via_points_(NULL), cost_(HUGE_VAL), prefer_rotdir_(RotType::none),
initialized_(false), optimized_(false)
{
{
}
TebOptimalPlanner::TebOptimalPlanner(nav2_util::LifecycleNode::SharedPtr node, const TebConfig& cfg, ObstContainer* obstacles, TebVisualizationPtr visual, const ViaPointContainer* via_points)
{
{
initialize(node, cfg, obstacles, visual, via_points);
}
@ -76,7 +76,7 @@ TebOptimalPlanner::~TebOptimalPlanner()
{
clearGraph();
// free dynamically allocated memory
//if (optimizer_)
//if (optimizer_)
// g2o::Factory::destroy();
//g2o::OptimizationAlgorithmFactory::destroy();
//g2o::HyperGraphActionLibrary::destroy();