Commit eed181ed authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

all StateId in python API are now unsigned short

parent df5636ae
...@@ -431,7 +431,7 @@ module hpp ...@@ -431,7 +431,7 @@ module hpp
/// \param state2 index of second state. /// \param state2 index of second state.
/// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states /// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states
/// \return id of the root path computed /// \return id of the root path computed
short limbRRT(in double state1, in double state2, in unsigned short numOptimizations) raises (Error); short limbRRT(in unsigned short state1, in unsigned short state2, in unsigned short numOptimizations) raises (Error);
/// Provided a path has already been computed and interpolated, generate a continuous path /// Provided a path has already been computed and interpolated, generate a continuous path
/// between two indicated states. The states do not need to be consecutive, but increasing in Id. /// between two indicated states. The states do not need to be consecutive, but increasing in Id.
...@@ -444,7 +444,7 @@ module hpp ...@@ -444,7 +444,7 @@ module hpp
/// \param path index of the path considered for the generation /// \param path index of the path considered for the generation
/// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states /// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states
/// \return id of the root path computed /// \return id of the root path computed
short limbRRTFromRootPath(in double state1, in double state2, in unsigned short path, in unsigned short numOptimizations) raises (Error); short limbRRTFromRootPath(in unsigned short state1, in unsigned short state2, in unsigned short path, in unsigned short numOptimizations) raises (Error);
/// Linear interpolation of many configurations into a path /// Linear interpolation of many configurations into a path
/// \param configs list of configurations /// \param configs list of configurations
...@@ -462,7 +462,7 @@ module hpp ...@@ -462,7 +462,7 @@ module hpp
/// \param comPath index of the path considered of the com path /// \param comPath index of the path considered of the com path
/// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states /// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states
/// \return id of the root path computed /// \return id of the root path computed
short comRRT(in double state1, in double state2, in unsigned short comPath, in unsigned short numOptimizations) raises (Error); short comRRT(in unsigned short state1, in unsigned short state2, in unsigned short comPath, in unsigned short numOptimizations) raises (Error);
/// Provided a path has already been computed and interpolated, generate a continuous path /// Provided a path has already been computed and interpolated, generate a continuous path
/// between two indicated states. The states do need to be consecutive. /// between two indicated states. The states do need to be consecutive.
...@@ -476,7 +476,7 @@ module hpp ...@@ -476,7 +476,7 @@ module hpp
/// \param rootPositions1 com positions to track for 3rd phase /// \param rootPositions1 com positions to track for 3rd phase
/// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states /// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states
/// \return id of the root path computed /// \return id of the root path computed
floatSeq comRRTFromPos(in double state1, floatSeq comRRTFromPos(in unsigned short state1,
in unsigned short comTraj1, in unsigned short comTraj1,
in unsigned short comTraj2, in unsigned short comTraj2,
in unsigned short comTraj3, in unsigned short comTraj3,
...@@ -496,7 +496,7 @@ module hpp ...@@ -496,7 +496,7 @@ module hpp
/// \param rootPositions1 com positions to track for 3rd phase /// \param rootPositions1 com positions to track for 3rd phase
/// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states /// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states
/// \return id of the root path computed /// \return id of the root path computed
floatSeq comRRTFromPosBetweenState(in double state1,in double state2, floatSeq comRRTFromPosBetweenState(in unsigned short state1,in unsigned short state2,
in unsigned short comTraj1, in unsigned short comTraj1,
in unsigned short comTraj2, in unsigned short comTraj2,
in unsigned short comTraj3, in unsigned short comTraj3,
...@@ -516,7 +516,7 @@ module hpp ...@@ -516,7 +516,7 @@ module hpp
/// \param rootPositions1 com positions to track for 3rd phase /// \param rootPositions1 com positions to track for 3rd phase
/// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states /// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states
/// \return id of the root path computed /// \return id of the root path computed
floatSeq effectorRRTFromPosBetweenState(in double state1,in double state2, floatSeq effectorRRTFromPosBetweenState(in unsigned short state1,in unsigned short state2,
in unsigned short comTraj1, in unsigned short comTraj1,
in unsigned short comTraj2, in unsigned short comTraj2,
in unsigned short comTraj3, in unsigned short comTraj3,
...@@ -535,7 +535,7 @@ module hpp ...@@ -535,7 +535,7 @@ module hpp
/// \param rootPositions1 com positions to track for 3rd phase /// \param rootPositions1 com positions to track for 3rd phase
/// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states /// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states
/// \return id of the root path computed /// \return id of the root path computed
floatSeq effectorRRT(in double state1, floatSeq effectorRRT(in unsigned short state1,
in unsigned short comTraj1, in unsigned short comTraj1,
in unsigned short comTraj2, in unsigned short comTraj2,
in unsigned short comTraj3, in unsigned short comTraj3,
...@@ -550,7 +550,7 @@ module hpp ...@@ -550,7 +550,7 @@ module hpp
/// \param rootPositions1 com positions to track /// \param rootPositions1 com positions to track
/// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states /// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states
/// \return id of the root path computed /// \return id of the root path computed
floatSeq effectorRRTOnePhase(in double state1, in double state2, floatSeq effectorRRTOnePhase(in unsigned short state1, in unsigned short state2,
in unsigned short comTraj, in unsigned short comTraj,
in unsigned short numOptimizations) raises (Error); in unsigned short numOptimizations) raises (Error);
...@@ -561,7 +561,7 @@ module hpp ...@@ -561,7 +561,7 @@ module hpp
/// \param rootPositions1 com positions to track /// \param rootPositions1 com positions to track
/// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states /// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states
/// \return id of the root path computed /// \return id of the root path computed
floatSeqSeq generateEffectorBezierArray(in double state1, in double state2, floatSeqSeq generateEffectorBezierArray(in unsigned short state1, in unsigned short state2,
in unsigned short comTraj, in unsigned short comTraj,
in unsigned short numOptimizations) raises (Error); in unsigned short numOptimizations) raises (Error);
...@@ -574,7 +574,7 @@ module hpp ...@@ -574,7 +574,7 @@ module hpp
/// \param rootPositions1 com positions to track /// \param rootPositions1 com positions to track
/// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states /// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states
/// \return id of the root path computed /// \return id of the root path computed
floatSeq comRRTOnePhase(in double state1, in double state2, floatSeq comRRTOnePhase(in unsigned short state1, in unsigned short state2,
in unsigned short comTraj, in unsigned short comTraj,
in unsigned short numOptimizations) raises (Error); in unsigned short numOptimizations) raises (Error);
...@@ -592,7 +592,7 @@ module hpp ...@@ -592,7 +592,7 @@ module hpp
/// \param rootPositions1 com positions to track for 3rd phase /// \param rootPositions1 com positions to track for 3rd phase
/// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states /// \param numOptimizations Number of iterations of the shortcut algorithm to apply between each states
/// \return id of the root path computed /// \return id of the root path computed
floatSeq effectorRRTFromPath(in double state1, in unsigned short refPath, floatSeq effectorRRTFromPath(in unsigned short state1, in unsigned short refPath,
in double path_from, in double path_to, in double path_from, in double path_to,
in unsigned short comTraj1, in unsigned short comTraj1,
in unsigned short comTraj2, in unsigned short comTraj2,
...@@ -608,7 +608,7 @@ module hpp ...@@ -608,7 +608,7 @@ module hpp
/// \param state1 index of first state. /// \param state1 index of first state.
/// \param state2 index of end state. /// \param state2 index of end state.
/// \param rootPositions com positions to track /// \param rootPositions com positions to track
short generateEndEffectorBezier(in double state1,in double state2, short generateEndEffectorBezier(in unsigned short state1,in unsigned short state2,
in unsigned short comTraj) raises (Error); in unsigned short comTraj) raises (Error);
/// Project a given state into a given COM position /// Project a given state into a given COM position
...@@ -618,7 +618,7 @@ module hpp ...@@ -618,7 +618,7 @@ module hpp
/// \param targetCom 3D vector for the com position /// \param targetCom 3D vector for the com position
/// \param max_num_sample number of samples that can be used at worst before failing /// \param max_num_sample number of samples that can be used at worst before failing
/// \return projected configuration /// \return projected configuration
floatSeq projectToCom(in double state, in floatSeq targetCom, in unsigned short max_num_sample) raises (Error); floatSeq projectToCom(in unsigned short state, in floatSeq targetCom, in unsigned short max_num_sample) raises (Error);
/// Retrieve the configuration at a given state /// Retrieve the configuration at a given state
/// between two indicated states. The states do not need to be consecutive, but increasing in Id. /// between two indicated states. The states do not need to be consecutive, but increasing in Id.
...@@ -630,13 +630,13 @@ module hpp ...@@ -630,13 +630,13 @@ module hpp
/// \param limb name of the limb for which the request aplies /// \param limb name of the limb for which the request aplies
/// \param state1 current state considered /// \param state1 current state considered
/// \return whether the limb is in contact at this state /// \return whether the limb is in contact at this state
short isLimbInContact(in string limbname, in double state1) raises (Error); short isLimbInContact(in string limbname, in unsigned short state1) raises (Error);
/// Is limb in contact during the motion from the current state to the next one /// Is limb in contact during the motion from the current state to the next one
/// \param limb name of the limb for which the request aplies /// \param limb name of the limb for which the request aplies
/// \param state1 current state considered /// \param state1 current state considered
/// \return whether the limb is in contact at this state /// \return whether the limb is in contact at this state
short isLimbInContactIntermediary(in string limbname, in double state1) raises (Error); short isLimbInContactIntermediary(in string limbname, in unsigned short state1) raises (Error);
/// Generate intermediary state /// Generate intermediary state
/// \param state1 initial state considered /// \param state1 initial state considered
......
...@@ -2183,11 +2183,10 @@ namespace hpp { ...@@ -2183,11 +2183,10 @@ namespace hpp {
return ps->addPath(resPath); return ps->addPath(resPath);
} }
CORBA::Short RbprmBuilder::limbRRT(double state1, double state2, unsigned short numOptimizations) throw (hpp::Error) CORBA::Short RbprmBuilder::limbRRT(unsigned short s1, unsigned short s2, unsigned short numOptimizations) throw (hpp::Error)
{ {
try try
{ {
std::size_t s1((std::size_t)state1), s2((std::size_t)state2);
if(lastStatesComputed_.size () < s1 || lastStatesComputed_.size () < s2 ) if(lastStatesComputed_.size () < s1 || lastStatesComputed_.size () < s2 )
{ {
throw std::runtime_error ("did not find a states at indicated indices: " + std::string(""+s1) + ", " + std::string(""+s2)); throw std::runtime_error ("did not find a states at indicated indices: " + std::string(""+s1) + ", " + std::string(""+s2));
...@@ -2204,11 +2203,10 @@ namespace hpp { ...@@ -2204,11 +2203,10 @@ namespace hpp {
} }
} }
CORBA::Short RbprmBuilder::limbRRTFromRootPath(double state1, double state2, unsigned short path, unsigned short numOptimizations) throw (hpp::Error) CORBA::Short RbprmBuilder::limbRRTFromRootPath(unsigned short s1, unsigned short s2, unsigned short path, unsigned short numOptimizations) throw (hpp::Error)
{ {
try try
{ {
std::size_t s1((std::size_t)state1), s2((std::size_t)state2);
if(lastStatesComputed_.size () < s1 || lastStatesComputed_.size () < s2 ) if(lastStatesComputed_.size () < s1 || lastStatesComputed_.size () < s2 )
{ {
throw std::runtime_error ("did not find a states at indicated indices: " + std::string(""+s1) + ", " + std::string(""+s2)); throw std::runtime_error ("did not find a states at indicated indices: " + std::string(""+s1) + ", " + std::string(""+s2));
...@@ -2238,16 +2236,15 @@ namespace hpp { ...@@ -2238,16 +2236,15 @@ namespace hpp {
{ {
res->appendPath(makePath(fullBody()->device_,problemSolver()->problem(), *pit,*(pit+1))); res->appendPath(makePath(fullBody()->device_,problemSolver()->problem(), *pit,*(pit+1)));
} }
return problemSolver()->addPath(res); return (CORBA::Short)problemSolver()->addPath(res);
} }
CORBA::Short RbprmBuilder::comRRT(double state1, double state2, unsigned short path, unsigned short numOptimizations) throw (hpp::Error) CORBA::Short RbprmBuilder::comRRT(unsigned short s1, unsigned short s2, unsigned short path, unsigned short numOptimizations) throw (hpp::Error)
{ {
try try
{ {
std::size_t s1((std::size_t)state1), s2((std::size_t)state2); // temp
// temp assert(s2 == s1 +1);
assert(s2 == s1 +1);
if(lastStatesComputed_.size () < s1 || lastStatesComputed_.size () < s2 ) if(lastStatesComputed_.size () < s1 || lastStatesComputed_.size () < s2 )
{ {
throw std::runtime_error ("did not find a states at indicated indices: " + std::string(""+s1) + ", " + std::string(""+s2)); throw std::runtime_error ("did not find a states at indicated indices: " + std::string(""+s1) + ", " + std::string(""+s2));
...@@ -2283,11 +2280,11 @@ assert(s2 == s1 +1); ...@@ -2283,11 +2280,11 @@ assert(s2 == s1 +1);
return res; return res;
} }
hpp::floatSeq* RbprmBuilder::rrt(t_rrt functor, double state1, double state2, hpp::floatSeq* RbprmBuilder::rrt(t_rrt functor, unsigned short s1, unsigned short s2,
unsigned short cT1, unsigned short cT2, unsigned short cT3, unsigned short cT1, unsigned short cT2, unsigned short cT3,
unsigned short numOptimizations) throw (hpp::Error) unsigned short numOptimizations) throw (hpp::Error)
{ {
hppDout(notice,"########## begin rrt for state "<<state1<<" ###########"); hppDout(notice,"########## begin rrt for state "<<s1<<" ###########");
unsigned int seed = (unsigned int) (time(NULL)) ; unsigned int seed = (unsigned int) (time(NULL)) ;
std::cout<<"seed rrt = "<<seed<<std::endl; std::cout<<"seed rrt = "<<seed<<std::endl;
hppDout(notice,"seed rrt = "<<seed); hppDout(notice,"seed rrt = "<<seed);
...@@ -2296,7 +2293,6 @@ assert(s2 == s1 +1); ...@@ -2296,7 +2293,6 @@ assert(s2 == s1 +1);
try try
{ {
std::vector<CORBA::Short> pathsIds; std::vector<CORBA::Short> pathsIds;
std::size_t s1((std::size_t)state1), s2((std::size_t)state2);
hppDout(notice,"index first state = "<<s1<<" ; index second state : "<<s2); hppDout(notice,"index first state = "<<s1<<" ; index second state : "<<s2);
if(lastStatesComputed_.size () < s1 || lastStatesComputed_.size () < s2 ) if(lastStatesComputed_.size () < s1 || lastStatesComputed_.size () < s2 )
{ {
...@@ -2407,7 +2403,7 @@ assert(s2 == s1 +1); ...@@ -2407,7 +2403,7 @@ assert(s2 == s1 +1);
pathsIds.push_back(AddPath(resPath,problemSolver())); pathsIds.push_back(AddPath(resPath,problemSolver()));
hpp::floatSeq* dofArray = new hpp::floatSeq(); hpp::floatSeq* dofArray = new hpp::floatSeq();
dofArray->length(pathsIds.size()); dofArray->length((_CORBA_ULong)pathsIds.size());
for(std::size_t i=0; i< pathsIds.size(); ++i) for(std::size_t i=0; i< pathsIds.size(); ++i)
{ {
(*dofArray)[(_CORBA_ULong)i] = pathsIds[i]; (*dofArray)[(_CORBA_ULong)i] = pathsIds[i];
...@@ -2420,7 +2416,7 @@ assert(s2 == s1 +1); ...@@ -2420,7 +2416,7 @@ assert(s2 == s1 +1);
} }
} }
hpp::floatSeq* RbprmBuilder::comRRTFromPos(double state1, hpp::floatSeq* RbprmBuilder::comRRTFromPos(unsigned short state1,
unsigned short cT1, unsigned short cT1,
unsigned short cT2, unsigned short cT2,
unsigned short cT3, unsigned short cT3,
...@@ -2430,7 +2426,7 @@ assert(s2 == s1 +1); ...@@ -2430,7 +2426,7 @@ assert(s2 == s1 +1);
} }
hpp::floatSeq* RbprmBuilder::comRRTFromPosBetweenState(double state1, double state2, hpp::floatSeq* RbprmBuilder::comRRTFromPosBetweenState(unsigned short state1, unsigned short state2,
unsigned short cT1, unsigned short cT1,
unsigned short cT2, unsigned short cT2,
unsigned short cT3, unsigned short cT3,
...@@ -2440,7 +2436,7 @@ assert(s2 == s1 +1); ...@@ -2440,7 +2436,7 @@ assert(s2 == s1 +1);
} }
hpp::floatSeq* RbprmBuilder::effectorRRTFromPosBetweenState(double state1, double state2, hpp::floatSeq* RbprmBuilder::effectorRRTFromPosBetweenState(unsigned short state1, unsigned short state2,
unsigned short cT1, unsigned short cT1,
unsigned short cT2, unsigned short cT2,
unsigned short cT3, unsigned short cT3,
...@@ -2450,7 +2446,7 @@ assert(s2 == s1 +1); ...@@ -2450,7 +2446,7 @@ assert(s2 == s1 +1);
} }
hpp::floatSeq* RbprmBuilder::effectorRRT(double state1, hpp::floatSeq* RbprmBuilder::effectorRRT(unsigned short state1,
unsigned short cT1, unsigned short cT1,
unsigned short cT2, unsigned short cT2,
unsigned short cT3, unsigned short cT3,
...@@ -2459,7 +2455,7 @@ assert(s2 == s1 +1); ...@@ -2459,7 +2455,7 @@ assert(s2 == s1 +1);
return rrt(&interpolation::effectorRRT, state1, state1+1, cT1, cT2, cT3, numOptimizations); return rrt(&interpolation::effectorRRT, state1, state1+1, cT1, cT2, cT3, numOptimizations);
} }
hpp::floatSeq* RbprmBuilder::effectorRRTFromPath(double state1, hpp::floatSeq* RbprmBuilder::effectorRRTFromPath(unsigned short s1,
unsigned short refpath, double path_from, double path_to, unsigned short refpath, double path_from, double path_to,
unsigned short cT1, unsigned short cT1,
unsigned short cT2, unsigned short cT2,
...@@ -2470,7 +2466,7 @@ assert(s2 == s1 +1); ...@@ -2470,7 +2466,7 @@ assert(s2 == s1 +1);
try try
{ {
std::vector<CORBA::Short> pathsIds; std::vector<CORBA::Short> pathsIds;
std::size_t s1((std::size_t)state1), s2((std::size_t)state1+1); std::size_t s2(s1+1);
if(lastStatesComputed_.size () < s1 || lastStatesComputed_.size () < s2 ) if(lastStatesComputed_.size () < s1 || lastStatesComputed_.size () < s2 )
{ {
throw std::runtime_error ("did not find a states at indicated indices: " + std::string(""+s1) + ", " + std::string(""+s2)); throw std::runtime_error ("did not find a states at indicated indices: " + std::string(""+s1) + ", " + std::string(""+s2));
...@@ -2505,7 +2501,7 @@ assert(s2 == s1 +1); ...@@ -2505,7 +2501,7 @@ assert(s2 == s1 +1);
pathsIds.push_back(AddPath(resPath,problemSolver())); pathsIds.push_back(AddPath(resPath,problemSolver()));
hpp::floatSeq* dofArray = new hpp::floatSeq(); hpp::floatSeq* dofArray = new hpp::floatSeq();
dofArray->length(pathsIds.size()); dofArray->length((_CORBA_ULong)pathsIds.size());
for(std::size_t i=0; i< pathsIds.size(); ++i) for(std::size_t i=0; i< pathsIds.size(); ++i)
{ {
(*dofArray)[(_CORBA_ULong)i] = pathsIds[i]; (*dofArray)[(_CORBA_ULong)i] = pathsIds[i];
...@@ -2518,7 +2514,7 @@ assert(s2 == s1 +1); ...@@ -2518,7 +2514,7 @@ assert(s2 == s1 +1);
} }
} }
hpp::floatSeq* RbprmBuilder::rrtOnePhase(t_rrt functor,double state1,double state2, hpp::floatSeq* RbprmBuilder::rrtOnePhase(t_rrt functor,unsigned short state1,unsigned short state2,
unsigned short comTraj, unsigned short comTraj,
unsigned short numOptimizations) throw (hpp::Error) unsigned short numOptimizations) throw (hpp::Error)
{ {
...@@ -2555,10 +2551,10 @@ assert(s2 == s1 +1); ...@@ -2555,10 +2551,10 @@ assert(s2 == s1 +1);
intervals.push_back(interval); intervals.push_back(interval);
PathPtr_t reducedPath = core::SubchainPath::create(p1,intervals); PathPtr_t reducedPath = core::SubchainPath::create(p1,intervals);
resPath->appendPath(reducedPath); resPath->appendPath(reducedPath);
pathsIds.push_back(problemSolver()->addPath(resPath)); pathsIds.push_back((CORBA::Short)problemSolver()->addPath(resPath));
hpp::floatSeq* dofArray = new hpp::floatSeq(); hpp::floatSeq* dofArray = new hpp::floatSeq();
dofArray->length(pathsIds.size()); dofArray->length((_CORBA_ULong)pathsIds.size());
for(std::size_t i=0; i< pathsIds.size(); ++i) for(std::size_t i=0; i< pathsIds.size(); ++i)
{ {
(*dofArray)[(_CORBA_ULong)i] = pathsIds[i]; (*dofArray)[(_CORBA_ULong)i] = pathsIds[i];
...@@ -2567,21 +2563,21 @@ assert(s2 == s1 +1); ...@@ -2567,21 +2563,21 @@ assert(s2 == s1 +1);
} }
hpp::floatSeq* RbprmBuilder::effectorRRTOnePhase(double state1,double state2, hpp::floatSeq* RbprmBuilder::effectorRRTOnePhase(unsigned short state1,unsigned short state2,
unsigned short comTraj, unsigned short comTraj,
unsigned short numOptimizations) throw (hpp::Error) unsigned short numOptimizations) throw (hpp::Error)
{ {
return rrtOnePhase(&interpolation::effectorRRT,state1,state2,comTraj,numOptimizations); return rrtOnePhase(&interpolation::effectorRRT,state1,state2,comTraj,numOptimizations);
} }
hpp::floatSeq* RbprmBuilder::comRRTOnePhase(double state1,double state2, hpp::floatSeq* RbprmBuilder::comRRTOnePhase(unsigned short state1,unsigned short state2,
unsigned short comTraj, unsigned short comTraj,
unsigned short numOptimizations) throw (hpp::Error) unsigned short numOptimizations) throw (hpp::Error)
{ {
return rrtOnePhase(&interpolation::comRRT,state1,state2,comTraj,numOptimizations); return rrtOnePhase(&interpolation::comRRT,state1,state2,comTraj,numOptimizations);
} }
hpp::floatSeqSeq* RbprmBuilder::generateEffectorBezierArray(double state1,double state2, hpp::floatSeqSeq* RbprmBuilder::generateEffectorBezierArray(unsigned short state1, unsigned short state2,
unsigned short comTraj, unsigned short comTraj,
unsigned short numOptimizations) throw (hpp::Error) unsigned short numOptimizations) throw (hpp::Error)
{ {
...@@ -2638,7 +2634,7 @@ assert(s2 == s1 +1); ...@@ -2638,7 +2634,7 @@ assert(s2 == s1 +1);
PathPtr_t path = (*it_pv)->pathAtRank(id_path); PathPtr_t path = (*it_pv)->pathAtRank(id_path);
PathVectorPtr_t pv = PathVector::create(path->outputSize(),path->outputDerivativeSize()); PathVectorPtr_t pv = PathVector::create(path->outputSize(),path->outputDerivativeSize());
pv->appendPath(path); pv->appendPath(path);
pathIds.push_back(problemSolver()->addPath(pv)); pathIds.push_back((CORBA::Short)problemSolver()->addPath(pv));
} }
// convert pathIds to floatSeq : // convert pathIds to floatSeq :
hpp::floatSeq* dofArray = new hpp::floatSeq(); hpp::floatSeq* dofArray = new hpp::floatSeq();
...@@ -2656,12 +2652,11 @@ assert(s2 == s1 +1); ...@@ -2656,12 +2652,11 @@ assert(s2 == s1 +1);
CORBA::Short RbprmBuilder::generateEndEffectorBezier(double state1, double state2, CORBA::Short RbprmBuilder::generateEndEffectorBezier(unsigned short s1, unsigned short s2,
unsigned short cT)throw (hpp::Error){ unsigned short cT)throw (hpp::Error){
try try
{ {
hppDout(notice,"Begin generateEndEffectorBezier"); hppDout(notice,"Begin generateEndEffectorBezier");
std::size_t s1((std::size_t)state1), s2((std::size_t)state2);
hppDout(notice,"index first state = "<<s1<<" ; index second state : "<<s2); hppDout(notice,"index first state = "<<s1<<" ; index second state : "<<s2);
if(lastStatesComputed_.size () < s1 || lastStatesComputed_.size () < s2 ) if(lastStatesComputed_.size () < s1 || lastStatesComputed_.size () < s2 )
{ {
...@@ -2675,7 +2670,7 @@ assert(s2 == s1 +1); ...@@ -2675,7 +2670,7 @@ assert(s2 == s1 +1);
State& state1=lastStatesComputed_[s1], state2=lastStatesComputed_[s2]; State& state1=lastStatesComputed_[s1], state2=lastStatesComputed_[s2];
hppDout(notice,"start generateEndEffectorBezier"); hppDout(notice,"start generateEndEffectorBezier");
interpolation::generateEndEffectorBezier(fullBody(),problemSolver(),paths[cT],state1,state2); interpolation::generateEndEffectorBezier(fullBody(),problemSolver(),paths[cT],state1,state2);
return problemSolver()->paths().size()-1; return (CORBA::Short)(problemSolver()->paths().size()-1);
} }
catch(std::runtime_error& e) catch(std::runtime_error& e)
{ {
...@@ -2683,7 +2678,7 @@ assert(s2 == s1 +1); ...@@ -2683,7 +2678,7 @@ assert(s2 == s1 +1);
} }
} }
hpp::floatSeq* RbprmBuilder::projectToCom(double state, const hpp::floatSeq& targetCom, unsigned short max_num_sample) throw (hpp::Error) hpp::floatSeq* RbprmBuilder::projectToCom(unsigned short state, const hpp::floatSeq& targetCom, unsigned short /*max_num_sample*/) throw (hpp::Error)
{ {
try try
{ {
...@@ -2885,11 +2880,10 @@ assert(s2 == s1 +1); ...@@ -2885,11 +2880,10 @@ assert(s2 == s1 +1);
} }
CORBA::Short RbprmBuilder::isLimbInContact(const char* limbName, double state1) throw (hpp::Error) CORBA::Short RbprmBuilder::isLimbInContact(const char* limbName, unsigned short s) throw (hpp::Error)
{ {
try try
{ {
std::size_t s((std::size_t)state1);
if(lastStatesComputed_.size () < s) if(lastStatesComputed_.size () < s)
{ {
throw std::runtime_error ("did not find a states at indicated indices: " + std::string(""+s)); throw std::runtime_error ("did not find a states at indicated indices: " + std::string(""+s));
...@@ -2905,11 +2899,10 @@ assert(s2 == s1 +1); ...@@ -2905,11 +2899,10 @@ assert(s2 == s1 +1);
} }
} }
CORBA::Short RbprmBuilder::isLimbInContactIntermediary(const char* limbName, double state1) throw (hpp::Error) CORBA::Short RbprmBuilder::isLimbInContactIntermediary(const char* limbName, unsigned short s) throw (hpp::Error)
{ {
try try
{ {
std::size_t s((std::size_t)state1);
if(lastStatesComputed_.size () < s+1) if(lastStatesComputed_.size () < s+1)
{ {
throw std::runtime_error ("did not find a states at indicated indices: " + std::string(""+s)); throw std::runtime_error ("did not find a states at indicated indices: " + std::string(""+s));
......
...@@ -270,40 +270,40 @@ namespace hpp { ...@@ -270,40 +270,40 @@ namespace hpp {
virtual CORBA::Short generateCurveTrajParts(const hpp::floatSeqSeq& positions, const hpp::floatSeq& partitions) throw (hpp::Error); virtual CORBA::Short generateCurveTrajParts(const hpp::floatSeqSeq& positions, const hpp::floatSeq& partitions) throw (hpp::Error);
virtual CORBA::Short generateRootPath(const hpp::floatSeqSeq& rootPositions, virtual CORBA::Short generateRootPath(const hpp::floatSeqSeq& rootPositions,
const hpp::floatSeq& q1, const hpp::floatSeq& q2) throw (hpp::Error); const hpp::floatSeq& q1, const hpp::floatSeq& q2) throw (hpp::Error);
virtual CORBA::Short limbRRT(double state1, double state2, unsigned short numOptimizations) throw (hpp::Error); virtual CORBA::Short limbRRT(unsigned short state1, unsigned short state2, unsigned short numOptimizations) throw (hpp::Error);
virtual CORBA::Short limbRRTFromRootPath(double state1, double state2, unsigned short path, unsigned short numOptimizations) throw (hpp::Error); virtual CORBA::Short limbRRTFromRootPath(unsigned short state1, unsigned short state2, unsigned short path, unsigned short numOptimizations) throw (hpp::Error);
virtual CORBA::Short configToPath(const hpp::floatSeqSeq& configs) throw (hpp::Error); virtual CORBA::Short configToPath(const hpp::floatSeqSeq& configs) throw (hpp::Error);
virtual CORBA::Short comRRT(double state1, double state2, unsigned short path, unsigned short numOptimizations) throw (hpp::Error); virtual CORBA::Short comRRT(unsigned short state1, unsigned short state2, unsigned short path, unsigned short numOptimizations) throw (hpp::Error);
typedef core::PathPtr_t (*t_rrt)