Skip to content

Commit

Permalink
Invoke OMPL debug print only when debug logging is enabled (backport #…
Browse files Browse the repository at this point in the history
…2608) (#2762)

---------

Co-authored-by: Igor Medvedev <[email protected]>
Co-authored-by: Sebastian Castro <[email protected]>
  • Loading branch information
3 people authored Mar 21, 2024
1 parent 44a2edb commit 01c86ec
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -755,9 +755,13 @@ void ompl_interface::ModelBasedPlanningContext::postSolve()
RCLCPP_DEBUG(LOGGER, "There were %d valid motions and %d invalid motions.", v, iv);

// Debug OMPL setup and solution
std::stringstream debug_out;
ompl_simple_setup_->print(debug_out);
RCLCPP_DEBUG(LOGGER, "%s", rclcpp::get_c_string(debug_out.str()));
RCLCPP_DEBUG(LOGGER, "%s",
[&] {
std::stringstream debug_out;
ompl_simple_setup_->print(debug_out);
return debug_out.str();
}()
.c_str());
}

bool ompl_interface::ModelBasedPlanningContext::solve(planning_interface::MotionPlanResponse& res)
Expand Down

0 comments on commit 01c86ec

Please sign in to comment.