Skip to content

Commit 1e7d294

Browse files
author
earlaud
committed
Use data handler to compute base pose
1 parent 6832a1b commit 1e7d294

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

include/simple-mpc/inverse-dynamics.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,22 +147,21 @@ namespace simple_mpc
147147
const std::vector<bool> & contact_state_target,
148148
const Eigen::VectorXd & f_target)
149149
{
150+
data_handler_.updateInternalData(q_target, v_target, false);
151+
150152
// Posture task
151153
samplePosture_.setValue(q_target.tail(robot_.nq_actuated()));
152154
samplePosture_.setDerivative(v_target.tail(robot_.na()));
153155
samplePosture_.setSecondDerivative(a_target.tail(robot_.na()));
154156
postureTask_->setReference(samplePosture_);
155157

156158
// Base task
157-
const pinocchio::SE3 base_pose(
158-
pinocchio::SE3::Quaternion(q_target[6], q_target[3], q_target[4], q_target[5]), q_target.head<3>());
159-
tsid::math::SE3ToVector(base_pose, sampleBase_.pos);
159+
tsid::math::SE3ToVector(data_handler_.getBaseFramePose(), sampleBase_.pos);
160160
sampleBase_.setDerivative(v_target.head<6>());
161161
sampleBase_.setSecondDerivative(a_target.head<6>());
162162
baseTask_->setReference(sampleBase_);
163163

164164
// Foot contacts
165-
data_handler_.updateInternalData(q_target, v_target, false);
166165
for (std::size_t i = 0; i < model_handler_.getFeetNames().size(); i++)
167166
{
168167
const std::string name = model_handler_.getFeetNames()[i];

0 commit comments

Comments
 (0)