Commit 6ad820a8 authored by Steve Tonneau's avatar Steve Tonneau
Browse files

[API] interpolateBetweenStates has new optional parameter to define number of...

[API] interpolateBetweenStates has new optional parameter to define number of optimizations to run between states
parent 02939add
......@@ -225,7 +225,8 @@ module hpp
/// between two indicated states. Will fail if the index of the states do not exist
/// \param state1
/// \param state2 index of second state.
void interpolateBetweenStates(in double state1, in double state2) raises (Error);
/// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states
void interpolateBetweenStates(in double state1, in double state2, in unsigned short numOptimizations) raises (Error);
/// Saves the last computed states by the function interpolate in a filename.
/// Raises an error if interpolate has not been called, or the file could not be opened.
......
......@@ -248,8 +248,9 @@ class FullBody (object):
#
# \param index of first state.
# \param index of second state.
def interpolateBetweenStates(self, state1, state2):
return self.client.rbprm.rbprm.interpolateBetweenStates(state1, state2)
# \param numOptim Number of iterations of the shortcut algorithm to apply between each states
def interpolateBetweenStates(self, state1, state2, numOptim = 10):
return self.client.rbprm.rbprm.interpolateBetweenStates(state1, state2, numOptim)
......
......@@ -644,7 +644,7 @@ namespace hpp {
}
}
void RbprmBuilder::interpolateBetweenStates(double state1, double state2) throw (hpp::Error)
void RbprmBuilder::interpolateBetweenStates(double state1, double state2, unsigned short numOptimizations) throw (hpp::Error)
{
try
{
......@@ -656,7 +656,7 @@ namespace hpp {
//create helper
// /interpolation::LimbRRTHelper helper(fullBody_, problemSolver_->problem());
core::PathVectorPtr_t path = interpolation::interpolateStates(fullBody_,problemSolver_->problem(),
lastStatesComputed_.begin()+s1,lastStatesComputed_.begin()+s2);
lastStatesComputed_.begin()+s1,lastStatesComputed_.begin()+s2, numOptimizations);
problemSolver_->addPath(path);
problemSolver_->robot()->setDimensionExtraConfigSpace(problemSolver_->robot()->extraConfigSpace().dimension()+1);
}
......
......@@ -127,7 +127,7 @@ namespace hpp {
virtual void setEndState(const hpp::floatSeq& configuration, const hpp::Names_t& contactLimbs) throw (hpp::Error);
virtual hpp::floatSeqSeq* interpolate(double timestep, double path, double robustnessTreshold) throw (hpp::Error);
virtual hpp::floatSeqSeq* interpolateConfigs(const hpp::floatSeqSeq& configs, double robustnessTreshold) throw (hpp::Error);
virtual void interpolateBetweenStates(double state1, double state2) throw (hpp::Error);
virtual void interpolateBetweenStates(double state1, double state2, unsigned short numOptimizations) throw (hpp::Error);
virtual void saveComputedStates(const char* filepath) throw (hpp::Error);
virtual void saveLimbDatabase(const char* limbname,const char* filepath) throw (hpp::Error);
virtual hpp::floatSeq* getOctreeBox(const char* limbName, double sampleId) throw (hpp::Error);
......
Supports Markdown
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