Skip to content

Commit b96ddeb

Browse files
author
earlaud
committed
Contact now equality constraint and not cost
1 parent 8ab667a commit b96ddeb

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

include/simple-mpc/inverse-dynamics.hpp

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ namespace simple_mpc
147147
data_handler_.updateInternalData(q_target, v_target, false);
148148
for (std::size_t i = 0; i < model_handler_.getFeetNames().size(); i++)
149149
{
150-
std::string name = model_handler_.getFeetNames()[i];
150+
const std::string name = model_handler_.getFeetNames()[i];
151151
if (contact_state_target[i])
152152
{
153153
if (!active_tsid_contacts_[i])
154154
{
155-
formulation_.addRigidContact(tsid_contacts[i], settings_.w_contact_force, settings_.w_contact_motion, 1);
155+
formulation_.addRigidContact(tsid_contacts[i], settings_.w_contact_force, settings_.w_contact_motion, 0);
156156
}
157157
tsid_contacts[i].setForceReference(f_target.segment(i * 3, 3));
158158
tsid_contacts[i].setReference(data_handler_.getFootPose(i));
@@ -167,18 +167,7 @@ namespace simple_mpc
167167
}
168168
}
169169
}
170-
}
171-
172-
bool check_contact(std::string & name)
173-
{
174-
for (auto & it : formulation_.m_contacts)
175-
{
176-
if (it->contact.name() == name)
177-
{
178-
return true;
179-
}
180-
}
181-
return false;
170+
solver_->resize(formulation_.nVar(), formulation_.nEq(), formulation_.nIn());
182171
}
183172

184173
void

0 commit comments

Comments
 (0)