Skip to content
Snippets Groups Projects
Commit fd1da58e authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Add a pointer to the robot in graph::Graph

parent f32699dd
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#ifndef HPP_MANIPULATION_GRAPH_GRAPH_HH #ifndef HPP_MANIPULATION_GRAPH_GRAPH_HH
# define HPP_MANIPULATION_GRAPH_GRAPH_HH # define HPP_MANIPULATION_GRAPH_GRAPH_HH
# include "hpp/manipulation/robot.hh"
# include "hpp/manipulation/graph/node-selector.hh" # include "hpp/manipulation/graph/node-selector.hh"
# include "hpp/manipulation/fwd.hh" # include "hpp/manipulation/fwd.hh"
...@@ -39,11 +40,11 @@ namespace hpp { ...@@ -39,11 +40,11 @@ namespace hpp {
{ {
public: public:
/// Create a new Graph. /// Create a new Graph.
static GraphPtr_t create() static GraphPtr_t create(RobotPtr_t robot)
{ {
Graph* ptr = new Graph; Graph* ptr = new Graph;
GraphPtr_t shPtr (ptr); GraphPtr_t shPtr (ptr);
ptr->init (shPtr); ptr->init (shPtr, robot);
return shPtr; return shPtr;
} }
...@@ -63,8 +64,9 @@ namespace hpp { ...@@ -63,8 +64,9 @@ namespace hpp {
protected: protected:
/// Initialization of the object. /// Initialization of the object.
void init (const GraphWkPtr_t& weak) void init (const GraphWkPtr_t& weak, RobotPtr_t robot)
{ {
robot_ = robot;
wkPtr_ = weak; wkPtr_ = weak;
} }
...@@ -80,6 +82,9 @@ namespace hpp { ...@@ -80,6 +82,9 @@ namespace hpp {
/// stability constraints. /// stability constraints.
ConstraintPtr_t constraints_; ConstraintPtr_t constraints_;
/// Keep a pointer to the composite robot.
RobotPtr_t robot_;
/// Weak pointer to itself. /// Weak pointer to itself.
GraphWkPtr_t wkPtr_; GraphWkPtr_t wkPtr_;
}; // Class Graph }; // Class Graph
......
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