Skip to content

Commit be17de8

Browse files
committed
Sot: Use basis of null-space from Eigen::JacobiSVD
1 parent be6851c commit be17de8

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/sot/memory-task-sot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ initMemory( const Matrix::Index nJ,const Matrix::Index mJ,const Matrix::Index ff
6565
JK.resize( nJ,mJ );
6666
V.resize( mJ,mJ );
6767

68-
svd = SVD_t (nJ, mJ, Eigen::ComputeThinU | Eigen::ComputeThinV);
68+
svd = SVD_t (nJ, mJ, Eigen::ComputeThinU | Eigen::ComputeFullV);
6969

7070
JK.fill(0);
7171
if (atConstruction) {

src/sot/sot.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,12 @@ computeControlLaw( dynamicgraph::Vector& control,const int& iterTime )
615615
/***/sotCOUNTER(7,8); // QDOT
616616

617617
/* --- OPTIMAL FORM: To debug. --- */
618-
if( 0==iterTask )
619-
{ Proj.resize( mJ,mJ ); Proj.setIdentity(); }
618+
if( 0==iterTask ) {
619+
Proj.resize( mJ,mJ ); Proj.setIdentity();
620+
} else {
621+
// Proj.noalias() -= svd.matrixV().leftCols(rankJ) * svd.matrixV().leftCols(rankJ).adjoint();
622+
Proj = Proj * svd.matrixV().rightCols(svd.matrixV().cols()-rankJ);
623+
}
620624

621625
/* --- OLIVIER START --- */
622626
// Update by Joseph Mirabel to match Eigen API
@@ -629,8 +633,6 @@ computeControlLaw( dynamicgraph::Vector& control,const int& iterTime )
629633
sotDEBUG(2) << "JpxJt = " << Jp*Jt;
630634
sotDEBUG(25) << "Proj-Jp*Jt"<<iterTask<<" = "<< (Proj-Jp*Jt) <<endl;
631635

632-
Proj.noalias() -= svd.matrixV().leftCols(rankJ) * svd.matrixV().leftCols(rankJ).adjoint();
633-
634636
/* --- OLIVIER END --- */
635637

636638
sotDEBUG(15) << "q"<<iterTask<<" = "<<control<<std::endl;

0 commit comments

Comments
 (0)