Skip to content

Commit

Permalink
[algo/kinematics] Access directly variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Megane Millan committed Jan 16, 2025
1 parent 103499a commit e117132
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/pinocchio/algorithm/crba.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace pinocchio
const JointIndex i = model.supports[primary_id].at(k);
jmodel.jointVelCols(data.M)
.middleRows(model.joints[i].idx_v(), model.joints[i].nv())
.noalias() -= model.joints.at(i).jointJacCols(data.J).transpose()
.noalias() -= model.joints[i].jointJacCols(data.J).transpose()
* data.Ag.middleCols(jmodel.idx_v(), jmodel.derived().jmodel().nv());
}
}
Expand Down Expand Up @@ -245,9 +245,9 @@ namespace pinocchio
// Traverse the tree backward from parent of mimicking (secondary) joint to common ancestor
for (size_t k = model.supports[secondary_id].size() - 2; k >= ancestor_sec; k--)
{
const JointIndex i = model.supports[secondary_id].at(k);
const JointIndex i = model.supports[secondary_id][k];
const JointIndex ui =
model.supports[secondary_id].at(k + 1); // Child link to compute placement
model.supports[secondary_id][k + 1]; // Child link to compute placement
iMj = data.liMi[ui].act(iMj);

// Skip the common ancestor if it's not the primary id
Expand All @@ -264,7 +264,7 @@ namespace pinocchio
// Traverse the kinematic tree forward from common ancestor to mimicked (primary) joint
for (size_t k = ancestor_prim + 1; k < model.supports[primary_id].size(); k++)
{
const JointIndex i = model.supports[primary_id].at(k);
const JointIndex i = model.supports[primary_id][k];
iMj = data.liMi[i].actInv(iMj);

forceSet::se3Action(iMj, jmodel.jointVelCols(data.Fcrb[secondary_id]), iF);
Expand Down

0 comments on commit e117132

Please sign in to comment.