Skip to content
Snippets Groups Projects
Commit 269e9f19 authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

fix all compilation warnings in rbprmBuilder.impl

parent eed181ed
No related branches found
No related tags found
No related merge requests found
...@@ -364,7 +364,7 @@ namespace hpp { ...@@ -364,7 +364,7 @@ namespace hpp {
std::vector<fcl::Vec3f> res; std::vector<fcl::Vec3f> res;
const rbprm::T_Limb& limbs = device->GetLimbs(); const rbprm::T_Limb& limbs = device->GetLimbs();
rbprm::RbPrmLimbPtr_t limb; rbprm::RbPrmLimbPtr_t limb;
Matrix43 p; Eigen::Matrix3d R = Eigen::Matrix3d::Identity(); Eigen::Matrix3d cFrame = Eigen::Matrix3d::Identity(); Matrix43 p; Eigen::Matrix3d cFrame = Eigen::Matrix3d::Identity();
for(std::map<std::string, fcl::Vec3f>::const_iterator cit = state.contactPositions_.begin(); for(std::map<std::string, fcl::Vec3f>::const_iterator cit = state.contactPositions_.begin();
cit != state.contactPositions_.end(); ++cit) cit != state.contactPositions_.end(); ++cit)
{ {
...@@ -820,7 +820,7 @@ namespace hpp { ...@@ -820,7 +820,7 @@ namespace hpp {
state.nbContacts = state.contactNormals_.size(); state.nbContacts = state.contactNormals_.size();
lastStatesComputed_.push_back(state); lastStatesComputed_.push_back(state);
lastStatesComputedTime_.push_back(std::make_pair(-1., state)); lastStatesComputedTime_.push_back(std::make_pair(-1., state));
return lastStatesComputed_.size()-1; return (CORBA::Short)(lastStatesComputed_.size()-1);
} }
double RbprmBuilder::projectStateToCOM(unsigned short stateId, const hpp::floatSeq& com, unsigned short max_num_sample) throw (hpp::Error) double RbprmBuilder::projectStateToCOM(unsigned short stateId, const hpp::floatSeq& com, unsigned short max_num_sample) throw (hpp::Error)
...@@ -882,7 +882,7 @@ namespace hpp { ...@@ -882,7 +882,7 @@ namespace hpp {
rbprm::State state = generateContacts_internal(configuration,direction,acceleration,robustnessThreshold); rbprm::State state = generateContacts_internal(configuration,direction,acceleration,robustnessThreshold);
lastStatesComputed_.push_back(state); lastStatesComputed_.push_back(state);
lastStatesComputedTime_.push_back(std::make_pair(-1., state)); lastStatesComputedTime_.push_back(std::make_pair(-1., state));
return lastStatesComputed_.size()-1; return (CORBA::Short)(lastStatesComputed_.size()-1);
} catch (const std::exception& exc) { } catch (const std::exception& exc) {
throw hpp::Error (exc.what ()); throw hpp::Error (exc.what ());
} }
...@@ -956,7 +956,7 @@ namespace hpp { ...@@ -956,7 +956,7 @@ namespace hpp {
config[1]=0; config[1]=0;
hpp::floatSeq* dofArray = new hpp::floatSeq(); hpp::floatSeq* dofArray = new hpp::floatSeq();
dofArray->length(_CORBA_ULong(config.rows())); dofArray->length(_CORBA_ULong(config.rows()));
for(std::size_t j=0; j< config.rows(); j++) for(size_type j=0; j< config.rows(); j++)
{ {
(*dofArray)[(_CORBA_ULong)j] = config [j]; (*dofArray)[(_CORBA_ULong)j] = config [j];
} }
...@@ -1078,14 +1078,12 @@ namespace hpp { ...@@ -1078,14 +1078,12 @@ namespace hpp {
// randomize samples // randomize samples
std::random_shuffle(reports.begin(), reports.end()); std::random_shuffle(reports.begin(), reports.end());
unsigned short num_samples_ok (0); unsigned short num_samples_ok (0);
bool success(false);
pinocchio::Configuration_t sampleConfig = config; pinocchio::Configuration_t sampleConfig = config;
std::vector<pinocchio::Configuration_t> results; std::vector<pinocchio::Configuration_t> results;
sampling::T_OctreeReport::const_iterator candCit = finalSet.begin(); sampling::T_OctreeReport::const_iterator candCit = finalSet.begin();
for(std::size_t i=0; i< _CORBA_ULong(finalSet.size()) && num_samples_ok < numSamples; ++i, ++candCit) for(std::size_t i=0; i< _CORBA_ULong(finalSet.size()) && num_samples_ok < numSamples; ++i, ++candCit)
{ {
const sampling::OctreeReport& report = *candCit; const sampling::OctreeReport& report = *candCit;
success = false;
State state; State state;
state.configuration_ = config; state.configuration_ = config;
hpp::rbprm::projection::ProjectionReport rep = hpp::rbprm::projection::ProjectionReport rep =
...@@ -1539,7 +1537,7 @@ namespace hpp { ...@@ -1539,7 +1537,7 @@ namespace hpp {
{ {
try try
{ {
if(lastStatesComputed_.size() <= stateId+1) if(lastStatesComputed_.size() <= (std::size_t)(stateId+1))
{ {
throw std::runtime_error ("Unexisting state " + std::string(""+(stateId+1))); throw std::runtime_error ("Unexisting state " + std::string(""+(stateId+1)));
} }
...@@ -1674,7 +1672,7 @@ namespace hpp { ...@@ -1674,7 +1672,7 @@ namespace hpp {
core::PathPtr_t makePath(DevicePtr_t device, core::PathPtr_t makePath(DevicePtr_t /*device*/,
const ProblemPtr_t& problem, const ProblemPtr_t& problem,
pinocchio::ConfigurationIn_t q1, pinocchio::ConfigurationIn_t q1,
pinocchio::ConfigurationIn_t q2) pinocchio::ConfigurationIn_t q2)
...@@ -1742,7 +1740,7 @@ namespace hpp { ...@@ -1742,7 +1740,7 @@ namespace hpp {
try try
{ {
pinocchio::Configuration_t q1 = dofArrayToConfig(4, q1Seq), q2 = dofArrayToConfig(4, q2Seq); pinocchio::Configuration_t q1 = dofArrayToConfig(4, q1Seq), q2 = dofArrayToConfig(4, q2Seq);
return problemSolver()->addPath(generateTrunkPath(fullBody(), problemSolver(), rootPositions, q1, q2)); return (CORBA::Short)problemSolver()->addPath(generateTrunkPath(fullBody(), problemSolver(), rootPositions, q1, q2));
} }
catch(std::runtime_error& e) catch(std::runtime_error& e)
{ {
...@@ -1768,7 +1766,7 @@ namespace hpp { ...@@ -1768,7 +1766,7 @@ namespace hpp {
pinocchio::vector3_t speed = (*cit) - *(cit-1); pinocchio::vector3_t speed = (*cit) - *(cit-1);
res->appendPath(interpolation::ComTrajectory::create(*(cit-1),*cit,speed,zero,1.)); res->appendPath(interpolation::ComTrajectory::create(*(cit-1),*cit,speed,zero,1.));
} }
return problemSolver()->addPath(res); return (CORBA::Short)problemSolver()->addPath(res);
} }
catch(std::runtime_error& e) catch(std::runtime_error& e)
{ {
...@@ -1787,7 +1785,7 @@ namespace hpp { ...@@ -1787,7 +1785,7 @@ namespace hpp {
hpp::rbprm::interpolation::PolynomTrajectoryPtr_t path = hpp::rbprm::interpolation::PolynomTrajectory::create(curvePtr); hpp::rbprm::interpolation::PolynomTrajectoryPtr_t path = hpp::rbprm::interpolation::PolynomTrajectory::create(curvePtr);
core::PathVectorPtr_t res = core::PathVector::create(3, 3); core::PathVectorPtr_t res = core::PathVector::create(3, 3);
res->appendPath(path); res->appendPath(path);
return problemSolver()->addPath(res); return (CORBA::Short)problemSolver()->addPath(res);
} }
catch(std::runtime_error& e) catch(std::runtime_error& e)
{ {
...@@ -1814,7 +1812,7 @@ namespace hpp { ...@@ -1814,7 +1812,7 @@ namespace hpp {
res->appendPath(cutPath); res->appendPath(cutPath);
problemSolver()->addPath(res); problemSolver()->addPath(res);
} }
return returned_pathId; return (CORBA::Short)returned_pathId;
} }
catch(std::runtime_error& e) catch(std::runtime_error& e)
{ {
...@@ -1849,7 +1847,7 @@ namespace hpp { ...@@ -1849,7 +1847,7 @@ namespace hpp {
{ {
res->appendPath(interpolation::ComTrajectory::create(*(cit-1),*cit,*cdit,*cddit,dt)); res->appendPath(interpolation::ComTrajectory::create(*(cit-1),*cit,*cdit,*cddit,dt));
} }
return problemSolver()->addPath(res); return (CORBA::Short)problemSolver()->addPath(res);
} }
catch(std::runtime_error& e) catch(std::runtime_error& e)
{ {
...@@ -1860,7 +1858,7 @@ namespace hpp { ...@@ -1860,7 +1858,7 @@ namespace hpp {
floatSeqSeq* RbprmBuilder::computeContactPoints(unsigned short cId) throw (hpp::Error) floatSeqSeq* RbprmBuilder::computeContactPoints(unsigned short cId) throw (hpp::Error)
{ {
if(lastStatesComputed_.size() <= cId + 1) if(lastStatesComputed_.size() <= (std::size_t)(cId + 1))
{ {
throw std::runtime_error ("Unexisting state " + std::string(""+(cId+1))); throw std::runtime_error ("Unexisting state " + std::string(""+(cId+1)));
} }
...@@ -1961,7 +1959,7 @@ namespace hpp { ...@@ -1961,7 +1959,7 @@ namespace hpp {
floatSeqSeq* RbprmBuilder::computeContactPointsForLimb(unsigned short cId, const char *limbName) throw (hpp::Error) floatSeqSeq* RbprmBuilder::computeContactPointsForLimb(unsigned short cId, const char *limbName) throw (hpp::Error)
{ {
if(lastStatesComputed_.size() <= cId + 1) if(lastStatesComputed_.size() <= (std::size_t)(cId + 1))
{ {
throw std::runtime_error ("Unexisting state " + std::string(""+(cId+1))); throw std::runtime_error ("Unexisting state " + std::string(""+(cId+1)));
} }
...@@ -2180,7 +2178,7 @@ namespace hpp { ...@@ -2180,7 +2178,7 @@ namespace hpp {
{ {
core::PathVectorPtr_t resPath = core::PathVector::create(path->outputSize(), path->outputDerivativeSize()); core::PathVectorPtr_t resPath = core::PathVector::create(path->outputSize(), path->outputDerivativeSize());
resPath->appendPath(path); resPath->appendPath(path);
return ps->addPath(resPath); return (CORBA::Short)ps->addPath(resPath);
} }
CORBA::Short RbprmBuilder::limbRRT(unsigned short s1, unsigned short s2, unsigned short numOptimizations) throw (hpp::Error) CORBA::Short RbprmBuilder::limbRRT(unsigned short s1, unsigned short s2, unsigned short numOptimizations) throw (hpp::Error)
...@@ -2422,7 +2420,7 @@ namespace hpp { ...@@ -2422,7 +2420,7 @@ namespace hpp {
unsigned short cT3, unsigned short cT3,
unsigned short numOptimizations) throw (hpp::Error) unsigned short numOptimizations) throw (hpp::Error)
{ {
return rrt(&interpolation::comRRT, state1,state1+1, cT1, cT2, cT3, numOptimizations); return rrt(&interpolation::comRRT, state1,(unsigned short)(state1+1), cT1, cT2, cT3, numOptimizations);
} }
...@@ -2452,7 +2450,7 @@ namespace hpp { ...@@ -2452,7 +2450,7 @@ namespace hpp {
unsigned short cT3, unsigned short cT3,
unsigned short numOptimizations) throw (hpp::Error) unsigned short numOptimizations) throw (hpp::Error)
{ {
return rrt(&interpolation::effectorRRT, state1, state1+1, cT1, cT2, cT3, numOptimizations); return rrt(&interpolation::effectorRRT, state1, (unsigned short)(state1+1), cT1, cT2, cT3, numOptimizations);
} }
hpp::floatSeq* RbprmBuilder::effectorRRTFromPath(unsigned short s1, hpp::floatSeq* RbprmBuilder::effectorRRTFromPath(unsigned short s1,
...@@ -2638,7 +2636,7 @@ namespace hpp { ...@@ -2638,7 +2636,7 @@ namespace hpp {
} }
// convert pathIds to floatSeq : // convert pathIds to floatSeq :
hpp::floatSeq* dofArray = new hpp::floatSeq(); hpp::floatSeq* dofArray = new hpp::floatSeq();
dofArray->length(pathIds.size()); dofArray->length((_CORBA_ULong)pathIds.size());
for(std::size_t i=0; i< pathIds.size(); ++i) for(std::size_t i=0; i< pathIds.size(); ++i)
{ {
(*dofArray)[(_CORBA_ULong)i] = pathIds[i]; (*dofArray)[(_CORBA_ULong)i] = pathIds[i];
...@@ -2690,8 +2688,8 @@ namespace hpp { ...@@ -2690,8 +2688,8 @@ namespace hpp {
fcl::Vec3f comTarget; for(int i =0; i<3; ++i) comTarget[i] = config[i]; fcl::Vec3f comTarget; for(int i =0; i<3; ++i) comTarget[i] = config[i];
pinocchio::Configuration_t res = project_or_throw(fullBody(), lastStatesComputed_[state],comTarget); pinocchio::Configuration_t res = project_or_throw(fullBody(), lastStatesComputed_[state],comTarget);
hpp::floatSeq* dofArray = new hpp::floatSeq(); hpp::floatSeq* dofArray = new hpp::floatSeq();
dofArray->length(res.rows()); dofArray->length((_CORBA_ULong)res.rows());
for(std::size_t i=0; i< res.rows(); ++i) for(size_type i=0; i< res.rows(); ++i)
{ {
(*dofArray)[(_CORBA_ULong)i] = res[i]; (*dofArray)[(_CORBA_ULong)i] = res[i];
} }
...@@ -2741,8 +2739,8 @@ namespace hpp { ...@@ -2741,8 +2739,8 @@ namespace hpp {
} }
pinocchio::Configuration_t res = lastStatesComputed_[state].configuration_; pinocchio::Configuration_t res = lastStatesComputed_[state].configuration_;
hpp::floatSeq* dofArray = new hpp::floatSeq(); hpp::floatSeq* dofArray = new hpp::floatSeq();
dofArray->length(res.rows()); dofArray->length((_CORBA_ULong)res.rows());
for(std::size_t i=0; i< res.rows(); ++i) for(size_type i=0; i< res.rows(); ++i)
{ {
(*dofArray)[(_CORBA_ULong)i] = res[i]; (*dofArray)[(_CORBA_ULong)i] = res[i];
} }
...@@ -2903,7 +2901,7 @@ namespace hpp { ...@@ -2903,7 +2901,7 @@ namespace hpp {
{ {
try try
{ {
if(lastStatesComputed_.size () < s+1) if(lastStatesComputed_.size () < (std::size_t)(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));
} }
...@@ -2927,20 +2925,18 @@ namespace hpp { ...@@ -2927,20 +2925,18 @@ namespace hpp {
CORBA::Short RbprmBuilder::computeIntermediary(unsigned short stateFrom, unsigned short stateTo) throw (hpp::Error) CORBA::Short RbprmBuilder::computeIntermediary(unsigned short stateFrom, unsigned short stateTo) throw (hpp::Error)
try try
{ {
std::size_t s((std::size_t)stateFrom); if(lastStatesComputed_.size () < (std::size_t)(stateFrom+1) || lastStatesComputed_.size () < (std::size_t)(stateTo+1))
std::size_t s2((std::size_t)stateTo);
if(lastStatesComputed_.size () < s+1 || lastStatesComputed_.size () < s2+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(""+stateFrom));
} }
const State& state1 = lastStatesComputed_[s]; const State& state1 = lastStatesComputed_[stateFrom];
const State& state2 = lastStatesComputed_[s2]; const State& state2 = lastStatesComputed_[stateTo];
bool unused; bool unused;
short unsigned cId = s; short unsigned cId = stateFrom;
const State state = intermediary(state1, state2,cId,unused); const State state = intermediary(state1, state2,cId,unused);
lastStatesComputed_.push_back(state); lastStatesComputed_.push_back(state);
lastStatesComputedTime_.push_back(std::make_pair(-1., state)); lastStatesComputedTime_.push_back(std::make_pair(-1., state));
return lastStatesComputed_.size() -1; return (CORBA::Short)(lastStatesComputed_.size() -1);
} }
catch(std::runtime_error& e) catch(std::runtime_error& e)
{ {
...@@ -3159,7 +3155,7 @@ namespace hpp { ...@@ -3159,7 +3155,7 @@ namespace hpp {
hpp::floatSeq* dofArray = new hpp::floatSeq(); hpp::floatSeq* dofArray = new hpp::floatSeq();
dofArray->length(fullBody()->GetLimbs().size()); dofArray->length((_CORBA_ULong)fullBody()->GetLimbs().size());
size_t id = 0; size_t id = 0;
pinocchio::Configuration_t config = dofArrayToConfig (fullBody()->device_, configuration); pinocchio::Configuration_t config = dofArrayToConfig (fullBody()->device_, configuration);
for(T_Limb::const_iterator lit = fullBody()->GetLimbs().begin() ; lit != fullBody()->GetLimbs().end() ; ++lit){ for(T_Limb::const_iterator lit = fullBody()->GetLimbs().begin() ; lit != fullBody()->GetLimbs().end() ; ++lit){
...@@ -3217,7 +3213,7 @@ namespace hpp { ...@@ -3217,7 +3213,7 @@ namespace hpp {
rep.result_.nbContacts= rep.result_.contactNormals_.size(); rep.result_.nbContacts= rep.result_.contactNormals_.size();
lastStatesComputed_.push_back(rep.result_); lastStatesComputed_.push_back(rep.result_);
lastStatesComputedTime_.push_back(std::make_pair(-1., rep.result_)); lastStatesComputedTime_.push_back(std::make_pair(-1., rep.result_));
return lastStatesComputed_.size() -1; return (CORBA::Short)(lastStatesComputed_.size() -1);
} }
else else
return -1; return -1;
...@@ -3240,7 +3236,7 @@ namespace hpp { ...@@ -3240,7 +3236,7 @@ namespace hpp {
ns.RemoveContact(limb); ns.RemoveContact(limb);
lastStatesComputed_.push_back(ns); lastStatesComputed_.push_back(ns);
lastStatesComputedTime_.push_back(std::make_pair(-1., ns)); lastStatesComputedTime_.push_back(std::make_pair(-1., ns));
return lastStatesComputed_.size() -1; return (CORBA::Short)(lastStatesComputed_.size() -1);
} }
catch(std::runtime_error& e) catch(std::runtime_error& e)
{ {
...@@ -3261,6 +3257,7 @@ namespace hpp { ...@@ -3261,6 +3257,7 @@ namespace hpp {
watch.report_all_and_count(2,*fp); watch.report_all_and_count(2,*fp);
fout.close(); fout.close();
#else #else
(void)logFile; // used to silent unused variable warning
throw(std::runtime_error("PROFILE PREPOC variable undefined, cannot dump profile")); throw(std::runtime_error("PROFILE PREPOC variable undefined, cannot dump profile"));
#endif #endif
} }
...@@ -3407,12 +3404,12 @@ namespace hpp { ...@@ -3407,12 +3404,12 @@ namespace hpp {
res = reachability::isReachableDynamic(fullBody(),lastStatesComputed_[stateFrom],lastStatesComputed_[stateTo],false,std::vector<double>(),numPointPerPhase); res = reachability::isReachableDynamic(fullBody(),lastStatesComputed_[stateFrom],lastStatesComputed_[stateTo],false,std::vector<double>(),numPointPerPhase);
} }
if (res.success()){ if (res.success()){
std::vector<int> ids; std::vector<std::size_t> ids;
core::PathVectorPtr_t pathVector_full = core::PathVector::create(res.path_->outputSize(),res.path_->outputDerivativeSize()); core::PathVectorPtr_t pathVector_full = core::PathVector::create(res.path_->outputSize(),res.path_->outputDerivativeSize());
pathVector_full->appendPath(res.path_); pathVector_full->appendPath(res.path_);
ids.push_back(problemSolver()->addPath(pathVector_full)); ids.push_back(problemSolver()->addPath(pathVector_full));
if(addPathPerPhase){ if(addPathPerPhase){
for(size_t i = 0 ; i < res.timings_.size() ; ++i){ for(size_type i = 0 ; i < res.timings_.size() ; ++i){
core::PathVectorPtr_t pathVector = core::PathVector::create(res.path_->outputSize(),res.path_->outputDerivativeSize()); core::PathVectorPtr_t pathVector = core::PathVector::create(res.path_->outputSize(),res.path_->outputDerivativeSize());
pathVector->appendPath(res.pathPerPhases_[i]); pathVector->appendPath(res.pathPerPhases_[i]);
ids.push_back(problemSolver()->addPath(pathVector)); ids.push_back(problemSolver()->addPath(pathVector));
...@@ -3420,10 +3417,10 @@ namespace hpp { ...@@ -3420,10 +3417,10 @@ namespace hpp {
} }
// convert vector of int to floatSeq : // convert vector of int to floatSeq :
hpp::floatSeq* dofArray = new hpp::floatSeq(); hpp::floatSeq* dofArray = new hpp::floatSeq();
dofArray->length(ids.size()); dofArray->length((_CORBA_ULong)ids.size());
for(std::size_t i=0; i< ids.size(); ++i) for(std::size_t i=0; i< ids.size(); ++i)
{ {
(*dofArray)[(_CORBA_ULong)i] = ids[i]; (*dofArray)[(_CORBA_ULong)i] = (CORBA::Double)ids[i];
} }
return dofArray; return dofArray;
}else }else
......
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