Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit ecbb160

Browse files
committed
Merge branch 'devel' of github.com:stack-of-tasks/sot-dynamic-pinocchio into devel
2 parents 95c7a5a + b06763f commit ecbb160

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

src/angle-estimator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ compute_xff_dotSOUT( dynamicgraph::Vector& res,
340340
const dynamicgraph::Matrix & J = jacobianSIN( time );
341341
const dynamicgraph::Vector & dq = qdotSIN( time );
342342

343-
const int nr=J.rows(), nc=J.cols()-6;
343+
const Eigen::Index nr=J.rows(), nc=J.cols()-6;
344344
assert( nr==6 );
345345
dynamicgraph::Matrix Ja( nr,nc ); dynamicgraph::Vector dqa(nc);
346346
for( int j=0;j<nc;++j )
@@ -367,7 +367,7 @@ compute_qdotSOUT( dynamicgraph::Vector& res,
367367

368368
assert( dx.size()==6 );
369369

370-
const int nr=dq.size();
370+
const Eigen::Index nr=dq.size();
371371
res.resize( nr ); res=dq;
372372
for( int i=0;i<6;++i ) res(i)=dx(i);
373373

src/sot-dynamic-pinocchio.cpp

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include <pinocchio/algorithm/kinematics.hpp>
1818
#include <pinocchio/algorithm/center-of-mass.hpp>
19+
#include <pinocchio/algorithm/jacobian.hpp>
1920
#include <pinocchio/spatial/motion.hpp>
2021
#include <pinocchio/algorithm/crba.hpp>
2122
#include <pinocchio/algorithm/centroidal.hpp>
@@ -715,7 +716,7 @@ dg::Vector& DynamicPinocchio::computeZmp( dg::Vector& res,const int& time )
715716
int& DynamicPinocchio::computeJacobians(int& dummy, const int& time) {
716717
sotDEBUGIN(25);
717718
const Eigen::VectorXd& q = pinocchioPosSINTERN.access(time);
718-
pinocchio::computeJacobians(*m_model,*m_data, q);
719+
pinocchio::computeJointJacobians(*m_model,*m_data, q);
719720
sotDEBUG(25)<<"Jacobians updated"<<std::endl;
720721
sotDEBUGOUT(25);
721722
return dummy;
@@ -785,7 +786,10 @@ computeGenericEndeffJacobian(const bool isFrame, const bool isLocal, const int j
785786
//Computes Jacobian in end-eff coordinates.
786787
if(isFrame){
787788
pinocchio::framesForwardKinematics(*m_model,*m_data);
788-
pinocchio::getFrameJacobian(*m_model,*m_data,(pinocchio::Model::Index)jointId,tmp);
789+
pinocchio::getFrameJacobian(*m_model,*m_data,
790+
(pinocchio::Model::Index)jointId,
791+
pinocchio::LOCAL,
792+
tmp);
789793
sotDEBUG(25) << "EndEffJacobian for "
790794
<< m_model->frames.at((pinocchio::Model::Index)jointId).name
791795
<<" is "<<tmp<<std::endl;
@@ -795,7 +799,7 @@ computeGenericEndeffJacobian(const bool isFrame, const bool isLocal, const int j
795799
pinocchio::getJointJacobian(*m_model,*m_data,(pinocchio::Model::Index)jointId,
796800
pinocchio::LOCAL, tmp);
797801
sotDEBUG(25) << "EndEffJacobian for "
798-
<< m_model->getJointName((pinocchio::Model::Index)jointId)
802+
<< m_model->names[(pinocchio::Model::Index)jointId]
799803
<<" is "<<tmp<<std::endl;
800804
}
801805
res = tmp;
@@ -818,15 +822,17 @@ computeGenericPosition(const bool isFrame, const int jointId, MatrixHomogeneous&
818822
assert(m_data);
819823
std::string temp;
820824
forwardKinematicsSINTERN(time);
821-
if(isFrame){
822-
pinocchio::framesForwardKinematics(*m_model,*m_data);
823-
res.matrix()= m_data->oMf[jointId].toHomogeneousMatrix();
824-
temp = m_model->frames.at((pinocchio::Model::Index)jointId).name;
825-
}
826-
else{
827-
res.matrix()= m_data->oMi[jointId].toHomogeneousMatrix();
828-
temp = m_model->getJointName((pinocchio::Model::Index)jointId);
829-
}
825+
if(isFrame)
826+
{
827+
pinocchio::framesForwardKinematics(*m_model,*m_data);
828+
res.matrix()= m_data->oMf[jointId].toHomogeneousMatrix();
829+
temp = m_model->frames.at((pinocchio::Model::Index)jointId).name;
830+
}
831+
else
832+
{
833+
res.matrix()= m_data->oMi[jointId].toHomogeneousMatrix();
834+
temp = m_model->names[(pinocchio::Model::Index)jointId];
835+
}
830836
sotDEBUG(25)<<"For "<<temp<<" with id: "<<jointId<<" position is "<<res<<std::endl;
831837
sotDEBUGOUT(25);
832838
return res;

0 commit comments

Comments
 (0)