diff --git a/src/Mathematics/FootConstraintsAsLinearSystemForVelRef.cpp b/src/Mathematics/FootConstraintsAsLinearSystemForVelRef.cpp index a36787132e230a1dfdf7f3dff9220267fa1ef80b..102f9ca6c02440dc7625e0f0af2cd4362e866cfe 100644 --- a/src/Mathematics/FootConstraintsAsLinearSystemForVelRef.cpp +++ b/src/Mathematics/FootConstraintsAsLinearSystemForVelRef.cpp @@ -163,7 +163,7 @@ FootConstraintsAsLinearSystemForVelRef::setVertices( convex_hull_t & ConvexHull, int constraints_type) { - edges_s * conv_hulls=0; + edges_s * conv_hulls; switch(constraints_type) { case ZMP_CONSTRAINTS: diff --git a/src/ZMPRefTrajectoryGeneration/generator-vel-ref.cpp b/src/ZMPRefTrajectoryGeneration/generator-vel-ref.cpp index 3107415768a942fa2544773ab1becac8647c9d1d..5e42bd9f887b505b20c7671e5ef1abf2bead1688 100644 --- a/src/ZMPRefTrajectoryGeneration/generator-vel-ref.cpp +++ b/src/ZMPRefTrajectoryGeneration/generator-vel-ref.cpp @@ -59,7 +59,15 @@ GeneratorVelRef::setPonderation( IntermedQPMat & Matrices, double weight, int ty IntermedQPMat::objective_variant_t & Objective = Matrices.Objective( type ); Objective.weight = weight; -} +} + + +void +GeneratorVelRef::setReference(std::istringstream &strm) +{ + //TODO: +} + void GeneratorVelRef::previewSupportStates(IntermedQPMat & Matrices, diff --git a/src/ZMPRefTrajectoryGeneration/generator-vel-ref.hh b/src/ZMPRefTrajectoryGeneration/generator-vel-ref.hh index 5249789b97021e3e604a28f2f9f4949cf7a8025d..94cda884c80452e79bea4c4035130ccdf348bc4f 100644 --- a/src/ZMPRefTrajectoryGeneration/generator-vel-ref.hh +++ b/src/ZMPRefTrajectoryGeneration/generator-vel-ref.hh @@ -57,6 +57,8 @@ namespace PatternGeneratorJRL ~GeneratorVelRef(); /// \} +// /// \brief Call method to handle the plugins (SimplePlugin interface). +// void CallMethod(std::string &Method, std::istringstream &strm); /// \brief Set the weights on the objective terms /// @@ -65,6 +67,10 @@ namespace PatternGeneratorJRL /// \param[in] objective void setPonderation( IntermedQPMat & Matrices, double weight, int objective ); + /// \brief Set the velocity reference from string + /// + /// \param[in] strm velocity reference string + void setReference(std::istringstream &strm); /// \brief Preview support state for the whole preview period /// diff --git a/src/ZMPRefTrajectoryGeneration/qp-problem.cpp b/src/ZMPRefTrajectoryGeneration/qp-problem.cpp index 0a3ccfea25dbf6c324cf706c416c21795a2ca684..84a04b155545c0f0ad88818acf7b3e54694149f8 100644 --- a/src/ZMPRefTrajectoryGeneration/qp-problem.cpp +++ b/src/ZMPRefTrajectoryGeneration/qp-problem.cpp @@ -90,6 +90,8 @@ void QPProblem_s::clear( int type ) { + double * array; + int array_size; switch(type) { case MATRIX_Q: @@ -186,13 +188,13 @@ QPProblem_s::addTerm( const MAL_MATRIX (&Mat, double), int type, { case MATRIX_Q: pArray_s = &Q_; - nbvariables_ = (col+Mat.size2()>(unsigned int)nbvariables_) ? col+Mat.size2() : nbvariables_; + nbvariables_ = (col+Mat.size2()>nbvariables_) ? col+Mat.size2() : nbvariables_; break; case MATRIX_DU: pArray_s = &DU_; - nbconstraints_ = (row+Mat.size1()>(unsigned int)nbconstraints_) ? row+Mat.size1() : nbconstraints_; - nbvariables_ = (col+Mat.size2()>(unsigned int)nbvariables_) ? col+Mat.size2() : nbvariables_; + nbconstraints_ = (row+Mat.size1()>nbconstraints_) ? row+Mat.size1() : nbconstraints_; + nbvariables_ = (col+Mat.size2()>nbvariables_) ? col+Mat.size2() : nbvariables_; break; } @@ -210,8 +212,8 @@ QPProblem_s::addTerm( const MAL_MATRIX (&Mat, double), int type, war_.resize(2*(3*nbvariables_*nbvariables_/2+10*nbvariables_+2*(nbconstraints_+1)+20000), 1,true); } - for( unsigned int i = 0;i < MAL_MATRIX_NB_ROWS(Mat); i++) - for( unsigned int j = 0;j < MAL_MATRIX_NB_COLS(Mat); j++) + for( int i = 0;i < MAL_MATRIX_NB_ROWS(Mat); i++) + for( int j = 0;j < MAL_MATRIX_NB_COLS(Mat); j++) { pArray_s->array_[row+i+(col+j)*pArray_s->nrows_] += Mat(i,j); } @@ -230,22 +232,22 @@ void QPProblem_s::addTerm( const MAL_VECTOR (&Vec, double), int type, { case VECTOR_D: pArray_s = &D_; - nbvariables_ = (row+Vec.size()>(unsigned int)nbvariables_) ? row+Vec.size() : nbvariables_; + nbvariables_ = (row+Vec.size()>nbvariables_) ? row+Vec.size() : nbvariables_; break; case VECTOR_XL: pArray_s = &XL_; - nbvariables_ = (row+Vec.size()>(unsigned int)nbvariables_) ? row+Vec.size() : nbvariables_; + nbvariables_ = (row+Vec.size()>nbvariables_) ? row+Vec.size() : nbvariables_; break; case VECTOR_XU: pArray_s = &XU_; - nbvariables_ = (row+Vec.size()>(unsigned int)nbvariables_) ? row+Vec.size() : nbvariables_; + nbvariables_ = (row+Vec.size()>nbvariables_) ? row+Vec.size() : nbvariables_; break; case VECTOR_DS: pArray_s = &DS_; - nbconstraints_ = (row+Vec.size()>(unsigned int)nbconstraints_) ? row+Vec.size() : nbconstraints_; + nbconstraints_ = (row+Vec.size()>nbconstraints_) ? row+Vec.size() : nbconstraints_; break; } @@ -255,7 +257,7 @@ void QPProblem_s::addTerm( const MAL_VECTOR (&Vec, double), int type, } boost_ublas::vector<double>::const_iterator VecIt = Vec.begin(); - for( unsigned int i = 0; i < Vec.size(); i++ ) + for( int i = 0; i < Vec.size(); i++ ) { pArray_s->array_[row+i] += *VecIt; VecIt++; diff --git a/src/privatepgtypes.cpp b/src/privatepgtypes.cpp index 46ced799ac3c189dea1880c1582d08e261008312..953779e11167b512dc131b488c5b3780885e49f0 100644 --- a/src/privatepgtypes.cpp +++ b/src/privatepgtypes.cpp @@ -135,7 +135,7 @@ namespace PatternGeneratorJRL double c_a = cos(angle); double s_a = sin(angle); - for( unsigned int j=0;j<X.size();j++ ) + for( int j=0;j<X.size();j++ ) { X[j] = ( X[j]*c_a - Y[j]*s_a ); Y[j] = ( X[j]*s_a + Y[j]*c_a ); @@ -171,7 +171,7 @@ namespace PatternGeneratorJRL void convex_hull_t::set(const double * arrayX, const double * arrayY) { - for(unsigned int i=0;i<X.size();i++) + for(int i=0;i<X.size();i++) { X[i] = arrayX[i]; Y[i] = arrayY[i];