Skip to content

Commit

Permalink
cli: add flags to control obstacles bbox and clipping
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Sep 26, 2024
1 parent 68b68b0 commit 6d7d174
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions apps/path-planner-cli/path-planner-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ TCLAP::ValueArg<std::string> arg_goal_pose(
"\"[x y phi_deg]\" or \"[x y]\"", cmd);

TCLAP::ValueArg<double> argBBoxMargin(
"", "bbox-margin", "Margin to add to the start-goal bbox poses", false, 1.0,
"", "bbox-margin", "Margin to add to the start-goal bbox poses", false, 2.0,
"A distance [meters]", cmd);

TCLAP::ValueArg<std::string> arg_goal_vel(
Expand Down Expand Up @@ -118,6 +118,10 @@ TCLAP::SwitchArg arg_showTree(
"", "show-tree",
"Shows the whole search tree instead of just the best path", cmd);

TCLAP::SwitchArg arg_ignoreObstaclesBbox(
"", "ignore-obstacles-bbox",
"Ignore obstacles for estimating the problem world bounding box", cmd);

TCLAP::SwitchArg arg_noRefine(
"", "no-refine", "Skips the post-plan refine stage", cmd);

Expand Down Expand Up @@ -207,7 +211,17 @@ static void do_plan_path()

pi.obstacles.emplace_back(obs);

auto bbox = obs->obstacles()->boundingBox();
mrpt::math::TBoundingBoxf bbox;

if (!arg_ignoreObstaclesBbox.isSet())
{
bbox = obs->obstacles()->boundingBox();
}
else
{
// This will ensure the next updateWithPoint() will set the bbox:
bbox = mrpt::math::TBoundingBoxf::PlusMinusInfinity();
}

// Make sure goal and start are within bbox:
{
Expand Down

0 comments on commit 6d7d174

Please sign in to comment.