Skip to content

Commit

Permalink
Add more profiler and debug traces
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Sep 23, 2024
1 parent d6edb61 commit 538ec8c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/path-planner-cli/path-planner-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,17 +300,22 @@ static void do_plan_path()
}

// Insert custom progress callback:
planner->progressCallback_ = [](const mpp::ProgressCallbackData& pcd) {
planner->progressCallback_ = [](const mpp::ProgressCallbackData& pcd)
{
std::cout << "[progressCallback] bestCostFromStart: "
<< pcd.bestCostFromStart
<< " bestCostToGoal: " << pcd.bestCostToGoal
<< " bestPathLength: " << pcd.bestPath.size() << std::endl;
};

// PTGs config file:
std::cout << "[PTGs] Initializing PTGs..." << std::endl;

mrpt::config::CConfigFile cfg(arg_ptgs_file.getValue());
pi.ptgs.initFromConfigFile(cfg, arg_config_file_section.getValue());

std::cout << "[PTGs] Done." << std::endl;

// ==================================================
// ACTUAL PATH PLANNING
// ==================================================
Expand Down
4 changes: 4 additions & 0 deletions mrpt_path_planning/src/algos/TPS_Astar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,16 @@ PlannerOutput TPS_Astar::plan(const PlannerInput& in)
// ------------------------------------------------------------------
tree.edges_to_children.clear();

MRPT_LOG_DEBUG_STREAM("Initializing lattice...");
mrpt::system::CTimeLoggerEntry tle_lat(profiler_(), "plan.lattice");
grid_.setSize(
in.worldBboxMin.x, in.worldBboxMax.x, // x
in.worldBboxMin.y, in.worldBboxMax.y, // y
params_.grid_resolution_xy, params_.grid_resolution_yaw, // res
in.worldBboxMin.phi, in.worldBboxMax.phi // phi / yaw
);
tle_lat.stop();
MRPT_LOG_DEBUG_STREAM("Lattice init done.");

// ----------------------------------------
//
Expand Down

0 comments on commit 538ec8c

Please sign in to comment.