Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added insertion directly into planning_graph w/o planning #177

Open
wants to merge 1 commit into
base: indigo-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion descartes_core/include/descartes_core/path_planner_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class PathPlannerBase
/**
* @brief Plans a path for the given robot model and configuration parameters.
* @param model robot model implementation for which to plan a path
* @param config A map containing the parameter/value pairs.
*/
virtual bool initialize(RobotModelConstPtr model) = 0;

Expand Down
4 changes: 4 additions & 0 deletions descartes_planner/include/descartes_planner/dense_planner.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class DensePlanner : public descartes_core::PathPlannerBase
virtual bool setConfig(const descartes_core::PlannerConfig& config);
virtual void getConfig(descartes_core::PlannerConfig& config) const;
virtual bool planPath(const std::vector<descartes_core::TrajectoryPtPtr>& traj);

/** \brief Populate a Cartesian trajectory graph, but do not solve. For use by external solvers */
virtual bool insertGraph(const std::vector<descartes_core::TrajectoryPtPtr>& traj);

virtual bool getPath(std::vector<descartes_core::TrajectoryPtPtr>& path) const;
virtual bool addAfter(const descartes_core::TrajectoryPt::ID& ref_id, descartes_core::TrajectoryPtPtr tp);
virtual bool addBefore(const descartes_core::TrajectoryPt::ID& ref_id, descartes_core::TrajectoryPtPtr tp);
Expand Down
17 changes: 16 additions & 1 deletion descartes_planner/src/dense_planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ bool DensePlanner::planPath(const std::vector<descartes_core::TrajectoryPtPtr>&
return false;
}

double cost;
path_.clear();
error_code_ = descartes_core::PlannerError::EMPTY_PATH;

Expand All @@ -215,6 +214,22 @@ bool DensePlanner::planPath(const std::vector<descartes_core::TrajectoryPtPtr>&
return descartes_core::PlannerError::OK == error_code_;
}

bool DensePlanner::insertGraph(const std::vector<descartes_core::TrajectoryPtPtr>& traj)
{
if(error_code_ == descartes_core::PlannerError::UNINITIALIZED)
{
ROS_ERROR_STREAM("Planner has not been initialized");
return false;
}

if(!planning_graph_->insertGraph(&traj))
{
return false;
}

return true;
}

bool DensePlanner::getPath(std::vector<descartes_core::TrajectoryPtPtr>& path) const
{
if (path_.empty())
Expand Down