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

graph::Edge now stores the RelativeMotion matrix

parent 85803c44
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <hpp/core/constraint-set.hh> #include <hpp/core/constraint-set.hh>
#include <hpp/core/steering-method.hh> #include <hpp/core/steering-method.hh>
#include <hpp/core/relative-motion.hh>
#include <hpp/core/path.hh> #include <hpp/core/path.hh>
#include "hpp/manipulation/config.hh" #include "hpp/manipulation/config.hh"
...@@ -59,6 +60,8 @@ namespace hpp { ...@@ -59,6 +60,8 @@ namespace hpp {
class HPP_MANIPULATION_DLLAPI Edge : public GraphComponent class HPP_MANIPULATION_DLLAPI Edge : public GraphComponent
{ {
public: public:
typedef core::RelativeMotion RelativeMotion;
/// Destructor /// Destructor
virtual ~Edge (); virtual ~Edge ();
...@@ -120,6 +123,11 @@ namespace hpp { ...@@ -120,6 +123,11 @@ namespace hpp {
return pathValidation_->get(); return pathValidation_->get();
} }
const RelativeMotion::matrix_type& relativeMotion () const
{
return relMotion_;
}
/// Get direction of the path compare to the edge /// Get direction of the path compare to the edge
/// \return true is reverse /// \return true is reverse
virtual bool direction (const core::PathPtr_t& path) const; virtual bool direction (const core::PathPtr_t& path) const;
...@@ -187,6 +195,7 @@ namespace hpp { ...@@ -187,6 +195,7 @@ namespace hpp {
SteeringMethod_t* steeringMethod_; SteeringMethod_t* steeringMethod_;
/// Path validation associated to the edge /// Path validation associated to the edge
mutable RelativeMotion::matrix_type relMotion_;
PathValidation_t* pathValidation_; PathValidation_t* pathValidation_;
/// Weak pointer to itself. /// Weak pointer to itself.
......
...@@ -254,10 +254,9 @@ namespace hpp { ...@@ -254,10 +254,9 @@ namespace hpp {
// TODO this path validation will not contain obstacles added after // TODO this path validation will not contain obstacles added after
// its creation. // its creation.
pathValidation_->set(problem->pathValidationFactory ()); pathValidation_->set(problem->pathValidationFactory ());
using core::RelativeMotion; relMotion_ = RelativeMotion::matrix (g->robot());
RelativeMotion::matrix_type matrix (RelativeMotion::matrix (g->robot())); RelativeMotion::fromConstraint (relMotion_, g->robot(), constraint);
RelativeMotion::fromConstraint (matrix, g->robot(), constraint); pathValidation_->get()->filterCollisionPairs (relMotion_);
pathValidation_->get()->filterCollisionPairs (matrix);
return constraint; return constraint;
} }
......
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