Skip to content
Snippets Groups Projects
Commit 27609aaa authored by Akseppal's avatar Akseppal
Browse files

Corrected manipulation::ConnectedComponent::addNode argument. Compiles and runs.

parent e39cec45
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,7 @@ class HPP_MANIPULATION_DLLAPI ConnectedComponent : public core::ConnectedCompone
/// Add roadmap node to connected component
/// \param roadmap node to be added
void addNode (const RoadmapNodePtr_t& node);
void addNode (const core::NodePtr_t& node);
RoadmapNodes_t getRoadmapNodes (const graph::NodePtr_t graphNode);
......
......@@ -61,19 +61,20 @@ namespace hpp {
other->graphNodeMap_.clear();
}
void ConnectedComponent::addNode(const RoadmapNodePtr_t& node)
void ConnectedComponent::addNode(const core::NodePtr_t& node)
{
core::ConnectedComponent::addNode(node);
// Find right graph node in map and add roadmap node to corresponding vector
GraphNodes_t::iterator mapIt = graphNodeMap_.find(roadmap_->getNode(node));
const RoadmapNodePtr_t& n = static_cast <const RoadmapNodePtr_t> (node);
GraphNodes_t::iterator mapIt = graphNodeMap_.find(roadmap_->getNode(n));
if (mapIt != graphNodeMap_.end()) {
mapIt->second.push_back(node);
mapIt->second.push_back(n);
// if graph node not found, add new map element with one roadmap node
} else {
RoadmapNodes_t newRoadmapNodeVector;
newRoadmapNodeVector.push_back(node);
newRoadmapNodeVector.push_back(n);
graphNodeMap_.insert(std::pair<graph::NodePtr_t, RoadmapNodes_t>
(roadmap_->getNode(node), newRoadmapNodeVector));
(roadmap_->getNode(n), newRoadmapNodeVector));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment