void PiMax::setSensorTeaching(const matrix::Matrix& teaching){ assert(teaching.getM() == number_sensors && teaching.getN() == 1); // calculate the a_teaching, // that belongs to the distal teaching value by the inverse model. a_teaching = (A.pseudoInverse() * (teaching-b)).mapP(0.95, clip); intern_isTeaching=true; }
void PiMax::setMotorTeaching(const matrix::Matrix& teaching){ assert(teaching.getM() == number_motors && teaching.getN() == 1); // Note: through the clipping the otherwise effectless // teaching with old motor value has now an effect, // namely to drive out of the saturation region. a_teaching= teaching.mapP(0.95,clip); intern_isTeaching=true; }
void SosAvgGrad::setC(const matrix::Matrix& _C){ assert(C.getM() == _C.getM() && C.getN() == _C.getN()); C=_C; }
void SosAvgGrad::setA(const matrix::Matrix& _A){ assert(A.getM() == _A.getM() && A.getN() == _A.getN()); A=_A; }
void SosAvgGrad::setS(const matrix::Matrix& _S){ assert(S.getM() == _S.getM() && S.getN() == _S.getN()); S=_S; }
void PiMax::setC(const matrix::Matrix& _C){ assert(C.getM() == _C.getM() && C.getN() == _C.getN()); C=_C; }
void PiMax::seth(const matrix::Matrix& _h){ assert(h.getM() == _h.getM() && h.getN() == _h.getN()); h=_h; }
void RandomDyn::seth(const matrix::Matrix& _h){ assert(h.getM() == _h.getM() && h.getN() == _h.getN()); h=_h; }
void PiMax::setA(const matrix::Matrix& _A){ assert(A.getM() == _A.getM() && A.getN() == _A.getN()); A=_A; }
void RandomDyn::setC(const matrix::Matrix& _C){ assert(C.getM() == _C.getM() && C.getN() == _C.getN()); C=_C; }
static void keepMatrixTraceUp(matrix::Matrix& m){ int l = std::min((short unsigned int)2,std::min(m.getM(), m.getN())); for(int i=0; i<l; i++){ if(m.val(i,i)<0.8) m.val(i,i)+=0.001; } }
virtual void seth(const matrix::Matrix& _h){ assert(h.getM() == _h.getM() && h.getN() == _h.getN()); h=_h; }
virtual void setC(const matrix::Matrix& _C){ assert(C.getM() == _C.getM() && C.getN() == _C.getN()); C=_C; }
void SeMoX::setSensorTeaching(const matrix::Matrix& teaching){ assert(teaching.getM() == number_sensors && teaching.getN() == 1); // calculate the y_teaching, that belongs to the distal teaching value by the inverse model. y_teaching = (A.pseudoInverse(0.001) * (teaching-B)).mapP(0.95, clip); intern_useTeaching=true; }