Skip to content
Snippets Groups Projects
Commit 04f931dd authored by Florent Lamiraux's avatar Florent Lamiraux Committed by Florent Lamiraux florent@laas.fr
Browse files

[Edge] Rename configConstraint into targetConstraint

  Make previous methods deprecated
  Rename Graph::configConstraint(EdgePtr_t) into targetConstraint.
parent abcd8d55
No related branches found
No related tags found
No related merge requests found
......@@ -191,7 +191,12 @@ namespace hpp {
virtual std::ostream& dotPrint (std::ostream& os, dot::DrawingAttributes da = dot::DrawingAttributes ()) const;
/// Constraint of the destination state and of the path
ConstraintSetPtr_t configConstraint() const;
/// \deprecated Use targetConstraint instead
ConstraintSetPtr_t configConstraint() const
HPP_MANIPULATION_DEPRECATED;
/// Constraint of the destination state and of the path
ConstraintSetPtr_t targetConstraint() const;
void setShort (bool isShort) {
isShort_ = isShort;
......@@ -212,8 +217,13 @@ namespace hpp {
/// Constructor
Edge (const std::string& name);
virtual ConstraintSetPtr_t buildConfigConstraint();
virtual ConstraintSetPtr_t buildConfigConstraint()
HPP_MANIPULATION_DEPRECATED;
/// Build path and target state constraint set.
virtual ConstraintSetPtr_t buildTargetConstraint();
/// Build path constraints
virtual ConstraintSetPtr_t buildPathConstraint();
virtual void initialize ();
......@@ -229,7 +239,7 @@ namespace hpp {
/// Constraint ensuring that a q_proj will be in to_ and in the
/// same leaf of to_ as the configuration used for initialization.
ConstraintSetPtr_t configConstraints_;
ConstraintSetPtr_t targetConstraints_;
/// The two ends of the transition.
StateWkPtr_t from_, to_;
......@@ -425,7 +435,13 @@ namespace hpp {
/// from nnear.
virtual bool generateTargetConfig (ConfigurationIn_t qStart,
ConfigurationOut_t q) const;
virtual ConstraintSetPtr_t buildConfigConstraint();
/// \deprecated Use buildTargetConstraint instead
virtual ConstraintSetPtr_t buildConfigConstraint()
HPP_MANIPULATION_DEPRECATED;
/// Build path and target state constraints
virtual ConstraintSetPtr_t buildTargetConstraint();
void buildHistogram ();
......
......@@ -122,10 +122,18 @@ namespace hpp {
/// \return The initialized projector.
ConstraintSetPtr_t configConstraint (const StatePtr_t& state) const;
/// Constraint to project onto the same leaf as config.
/// \param edges a list of edges defining the foliation.
/// \return The constraint.
ConstraintSetPtr_t configConstraint (const EdgePtr_t& edge) const;
/// Constraints of path and target state of an edge
/// \deprecated Use tagetConstraint instead.
ConstraintSetPtr_t configConstraint (const EdgePtr_t& edge) const
HPP_MANIPULATION_DEPRECATED;
/// Constraints a configuration in target state should satisfy
/// \param edge a transition
/// \return The set of constraints a configuration lying in the
/// target state of the edge should satisfy. This set
/// includes the paths constraints of the edge.
/// \sa Edge::targetConstraint.
ConstraintSetPtr_t targetConstraint (const EdgePtr_t& edge) const;
/// Get error of a config with respect to a state constraint
///
......
......@@ -41,7 +41,7 @@ namespace hpp {
Edge::Edge (const std::string& name) :
GraphComponent (name), isShort_ (false),
pathConstraints_ (),
configConstraints_ (),
targetConstraints_ (),
steeringMethod_ (),
securityMargins_ (),
pathValidation_ ()
......@@ -165,7 +165,7 @@ namespace hpp {
void Edge::initialize ()
{
configConstraints_ = buildConfigConstraint ();
targetConstraints_ = buildTargetConstraint ();
pathConstraints_ = buildPathConstraint ();
isInit_ = true;
}
......@@ -191,10 +191,16 @@ namespace hpp {
return os;
}
ConstraintSetPtr_t Edge::targetConstraint() const
{
throwIfNotInitialized ();
return targetConstraints_;
}
ConstraintSetPtr_t Edge::configConstraint() const
{
throwIfNotInitialized ();
return configConstraints_;
return targetConstraints_;
}
// Merge constraints of several graph components into a config projectors
......@@ -264,6 +270,11 @@ namespace hpp {
}
ConstraintSetPtr_t Edge::buildConfigConstraint()
{
return buildTargetConstraint();
}
ConstraintSetPtr_t Edge::buildTargetConstraint()
{
std::string n = "(" + name () + ")";
GraphPtr_t g = graph_.lock ();
......@@ -392,7 +403,7 @@ namespace hpp {
bool Edge::generateTargetConfig (ConfigurationIn_t qStart,
ConfigurationOut_t q) const
{
ConstraintSetPtr_t c = configConstraint ();
ConstraintSetPtr_t c = targetConstraint();
ConfigProjectorPtr_t proj = c->configProjector ();
proj->rightHandSideFromConfig (qStart);
if (isShort_) q = qStart;
......@@ -463,10 +474,10 @@ namespace hpp {
lastSucceeded_ = false;
return false;
}
assert (configConstraint ());
assert (configConstraint ()->configProjector ());
assert (targetConstraint());
assert (targetConstraint()->configProjector ());
value_type eps
(configConstraint ()->configProjector ()->errorThreshold ());
(targetConstraint()->configProjector ()->errorThreshold ());
if ((configs_.col(i) - configs_.col (i+1)).squaredNorm () > eps*eps) {
if (!edges_[i]->build (p, configs_.col(i), configs_.col (i+1))) {
hppDout (info, "Waypoint edge " << name()
......@@ -639,7 +650,7 @@ namespace hpp {
ConfigurationIn_t qlevelset, ConfigurationOut_t q) const
{
// First, set the offset.
ConstraintSetPtr_t cs = configConstraint ();
ConstraintSetPtr_t cs = targetConstraint();
const ConfigProjectorPtr_t cp = cs->configProjector ();
assert (cp);
......@@ -754,6 +765,11 @@ namespace hpp {
}
ConstraintSetPtr_t LevelSetEdge::buildConfigConstraint()
{
return buildTargetConstraint();
}
ConstraintSetPtr_t LevelSetEdge::buildTargetConstraint()
{
std::string n = "(" + name () + ")";
GraphPtr_t g = graph_.lock ();
......
......@@ -205,7 +205,7 @@ namespace hpp {
(ConfigurationIn_t leafConfig, ConfigurationIn_t config,
const EdgePtr_t& edge, vector_t& error) const
{
ConstraintSetPtr_t cs (configConstraint (edge));
ConstraintSetPtr_t cs (targetConstraint (edge));
ConfigProjectorPtr_t cp (cs->configProjector ());
if (cp) cp->rightHandSideFromConfig (leafConfig);
return cs->isSatisfied (config, error);
......@@ -223,7 +223,12 @@ namespace hpp {
ConstraintSetPtr_t Graph::configConstraint (const EdgePtr_t& edge) const
{
return edge->configConstraint ();
return edge->targetConstraint ();
}
ConstraintSetPtr_t Graph::targetConstraint (const EdgePtr_t& edge) const
{
return edge->targetConstraint ();
}
ConstraintSetPtr_t Graph::pathConstraint (const EdgePtr_t& edge) const
......
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