diff --git a/include/hpp/manipulation/graph/edge.hh b/include/hpp/manipulation/graph/edge.hh index 5a730555b6b8b3ac2b3f970680a1f77d58072126..5abb4d777283c012129227f40c6e2fff6d79e833 100644 --- a/include/hpp/manipulation/graph/edge.hh +++ b/include/hpp/manipulation/graph/edge.hh @@ -17,10 +17,10 @@ #ifndef HPP_MANIPULATION_GRAPH_EDGE_HH # define HPP_MANIPULATION_GRAPH_EDGE_HH -#include <hpp/core/constraints-set.hh> +#include <hpp/core/constraint-set.hh> #include "hpp/manipulation/fwd.hh" -#include "hpp/manipulation/graph/gripper-state.hh" +#include "hpp/manipulation/graph/node.hh" namespace hpp { namespace manipulation { @@ -32,7 +32,7 @@ namespace hpp { { public: /// Create a new Edge. - static EdgePtr_t create (const NodeWkPtr_t& from, const NodeWkPtr_t& to. + static EdgePtr_t create (const NodeWkPtr_t& from, const NodeWkPtr_t& to, const ConstraintPtr_t& constraints) { Edge* ptr = new Edge; diff --git a/include/hpp/manipulation/graph/graph.hh b/include/hpp/manipulation/graph/graph.hh index 1233156f97078a05ffda44132e2caa9971d8b470..b4a0838f31e3a01391a8fb2d86f90d01abb5acdd 100644 --- a/include/hpp/manipulation/graph/graph.hh +++ b/include/hpp/manipulation/graph/graph.hh @@ -17,8 +17,10 @@ #ifndef HPP_MANIPULATION_GRAPH_GRAPH_HH # define HPP_MANIPULATION_GRAPH_GRAPH_HH -#include "hpp/manipulation/fwd.hh" -#include "hpp/manipulation/graph/fwd.hh" +# include "hpp/manipulation/graph/node-selector.hh" + +# include "hpp/manipulation/fwd.hh" +# include "hpp/manipulation/graph/fwd.hh" namespace hpp { namespace manipulation { diff --git a/include/hpp/manipulation/graph/node-selector.hh b/include/hpp/manipulation/graph/node-selector.hh index d6708dcfa523a924b5968e40132bba2c98f52a7b..b9fc75a9ea880eae4422fa1cf975bc01ada0e26b 100644 --- a/include/hpp/manipulation/graph/node-selector.hh +++ b/include/hpp/manipulation/graph/node-selector.hh @@ -18,7 +18,7 @@ # define HPP_MANIPULATION_GRAPH_NODE_SELECTOR_HH #include "hpp/manipulation/fwd.hh" -#include "hpp/manipulation/graph/gripper-state.hh" +#include "hpp/manipulation/graph/node.hh" namespace hpp { namespace manipulation { @@ -53,7 +53,7 @@ namespace hpp { protected: /// Initialization of the object. - void init (const GraphWkPtr_t& weak) + void init (const NodeSelectorPtr_t& weak) { wkPtr_ = weak; } @@ -65,6 +65,9 @@ namespace hpp { private: /// List of the states of one end-effector, ordered by priority. std::vector< NodePtr_t > orderedStates_; + + /// Weak pointer to itself. + NodeSelectorPtr_t wkPtr_; }; // Class NodeSelector } // namespace graph } // namespace manipulation diff --git a/include/hpp/manipulation/graph/node.hh b/include/hpp/manipulation/graph/node.hh index d586c82e245385b87a817da2a09561795595d89b..27132b48b9bc94179e875724e01dec20ac67ae5c 100644 --- a/include/hpp/manipulation/graph/node.hh +++ b/include/hpp/manipulation/graph/node.hh @@ -17,7 +17,7 @@ #ifndef HPP_MANIPULATION_GRAPH_NODE_HH # define HPP_MANIPULATION_GRAPH_NODE_HH -#include <hpp/core/constraints-set.hh> +#include <hpp/core/constraint-set.hh> #include "hpp/manipulation/fwd.hh" #include "hpp/manipulation/graph/fwd.hh" @@ -43,11 +43,11 @@ namespace hpp { } /// Create a link from this node to the given node. - EdgePtr_t linkTo(const EdgePtr_t& to, const ConstraintPtr_t& constraints) + EdgePtr_t linkTo(const NodePtr_t& to, const ConstraintPtr_t& constraints) { EdgePtr_t newEdge = Edge::create(wkPtr_, to, constraints); neighbors_.push_back(newEdge); - newEdge-> + return newEdge; } /// Check whether the configuration is in this state. @@ -61,7 +61,7 @@ namespace hpp { // TODO: This is not the most efficient way. We should // compute the value of the constraint instead of apllying // the constraint. - ConfigurationOut_t cfg = config; + Configuration_t cfg = config; return constraints_->apply(cfg) && ( cfg == config ); }