Skip to content
Snippets Groups Projects
Commit c253e1b5 authored by Tobias Gröger's avatar Tobias Gröger
Browse files

Make teb more robust

parent 1a3346f6
No related branches found
No related tags found
1 merge request!74Add laser scanner features to teb planning
......@@ -23,6 +23,7 @@
#include <armarx/navigation/local_planning/ros_conversions.h>
// #include <teb_local_planner/extension/obstacles/EllipseObstacle.h>
#include <armarx/navigation/local_planning/aron_conversions_teb.h>
#include <teb_local_planner/homotopy_class_planner.h>
namespace armarx::navigation::local_planning
......@@ -106,21 +107,35 @@ namespace armarx::navigation::local_planning
fillObstacles();
bool success;
try
{
if (!hcp_->plan(start, end, &velocity_start, !planToDest))
{
ARMARX_WARNING << deactivateSpam(5) << "Found trajectory is not feasible!";
}
success = hcp_->plan(start, end, &velocity_start, !planToDest);
}
catch (...)
{
hcp_->clearPlanner();
ARMARX_ERROR << "Caugth exception while planning: " << GetHandledExceptionString();
return std::nullopt;
}
if (!success)
{
hcp_->clearPlanner();
ARMARX_WARNING << deactivateSpam(5) << "Found trajectory is not feasible!";
return std::nullopt;
}
if (hcp_->hasDiverged())
{
hcp_->clearPlanner();
ARMARX_WARNING << deactivateSpam(5) << "Planner has diverged!";
return std::nullopt;
}
if (hcp_->getTrajectoryContainer().empty())
{
hcp_->clearPlanner();
ARMARX_INFO << deactivateSpam(5) << "Did not find any trajectory!";
return std::nullopt;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment