Commit 9f289a9f authored by Florent Lamiraux's avatar Florent Lamiraux
Browse files

[Path] Make operator() deprecated

  Use method eval instead.
parent 688abef4
Pipeline #12859 failed with stage
in 54 seconds
......@@ -118,37 +118,36 @@ namespace hpp {
/// \name Evalutation of the path
/// \{
/// \deprecated Use operator()(value_type, bool)
Configuration_t operator () (const value_type& time) const
HPP_CORE_DEPRECATED
{
bool unused;
return (*this) (time, unused);
}
/// Configuration at time
/// \deprecated use configAtTime instead
Configuration_t operator () (const value_type& time, bool& success) const
HPP_CORE_DEPRECATED
{
return configAtParam (paramAtTime(time), success);
return eval (time, success);
}
/// Configuration at time
/// \deprecated use eval instead
bool operator () (ConfigurationOut_t result, const value_type& time)
const
{
value_type s = paramAtTime (time);
bool success = impl_compute (result, s);
if (!success) return false;
return applyConstraints (result, s);
return eval(result, time);
}
/// Configuration at time
Configuration_t eval (const value_type& time, bool& success) const
{
return this->operator() (time, success);
return configAtParam (paramAtTime(time), success);
}
/// Configuration at time
bool eval (ConfigurationOut_t result, const value_type& time)
const
{
return this->operator() (result, time);
value_type s = paramAtTime (time);
bool success = impl_compute (result, s);
if (!success) return false;
return applyConstraints (result, s);
}
/// Get the configuration at a parameter without applying the constraints.
......
......@@ -116,16 +116,16 @@ namespace hpp {
inline Configuration_t initial () const
{
bool success;
return (*original_)(reversed_?timeRange().second:timeRange().first,
success);
return original_->eval(reversed_?timeRange().second:
timeRange().first, success);
}
/// Get the final configuration
inline Configuration_t end () const
{
bool success;
return (*original_)(reversed_?timeRange().first:timeRange().second,
success);
return original_->eval(reversed_?timeRange().first:
timeRange().second, success);
}
protected:
......
......@@ -214,16 +214,19 @@ namespace hpp {
value_type l = fabs (subInterval.second - subInterval.first);
if(l<=0){
hppDout(notice,"Call Extract with a length null");
return StraightPath::create(device_,((*this) (subInterval.first, success)),((*this) (subInterval.first, success)),0.);
return StraightPath::create(device_,
(eval(subInterval.first, success)),
(eval(subInterval.first, success)),
0.);
}
hppDout(notice,"%% EXTRACT PATH : path interval : "<<timeRange().first<<" ; "<<timeRange().second);
hppDout(notice,"%% EXTRACT PATH : sub interval : "<<subInterval.first<<" ; "<<subInterval.second);
Configuration_t q1 ((*this) (subInterval.first, success));
Configuration_t q1 (eval(subInterval.first, success));
if (!success) throw projection_error
("Failed to apply constraints in KinodynamicPath::extract");
Configuration_t q2 ((*this) (subInterval.second, success));
Configuration_t q2 (eval(subInterval.second, success));
if (!success) throw projection_error
("Failed to apply constraints in KinodynamicPath::extract");
......
......@@ -80,7 +80,7 @@ namespace hpp {
{
const value_type& tColl = report->parameter;
bool success;
qColl_ = (*collSpline) (tColl, success);
qColl_ = collSpline->eval(tColl, success);
assert(success);
CollisionValidationReportPtr_t collisionReport =
......@@ -103,7 +103,7 @@ namespace hpp {
collSpline->length();
tFree = std::min(tFree, freeSpline->length()); // can be slightly above freeSpline length due to round-offs
qFree_ = (*freeSpline) (tFree, success);
qFree_ = freeSpline->eval(tFree, success);
assert(success);
hppDout (info, "qFree = " << pinocchio::displayConfig (qFree_));
// Compute contact point in configuration qColl
......
......@@ -210,7 +210,7 @@ namespace hpp {
} else {
const value_type t = 0.5; //path->timeRange().first + path->length() / 2;
bool success;
const Configuration_t q1((*path) (t, success));
const Configuration_t q1(path->eval(t, success));
if (!success) {
hppDout (info, "RHP stopped because it could not project a configuration");
return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment