Skip to content

Commit d933260

Browse files
author
earlaud
committed
Contact motion task can be set as equality from user
1 parent 1093b70 commit d933260

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

include/simple-mpc/inverse-dynamics.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ namespace simple_mpc
5353
DEFINE_FIELD(double, w_posture, -1.) // Disabled by default
5454
DEFINE_FIELD(double, w_contact_motion, -1.) // Disabled by default
5555
DEFINE_FIELD(double, w_contact_force, -1.) // Disabled by default
56+
57+
///< Are the contact motion = 0 handled as a hard contraint (true) or a cost (if false)
58+
DEFINE_FIELD(bool, contact_motion_equality, false)
5659
};
5760

5861
KinodynamicsID(const simple_mpc::RobotModelHandler & model_handler, double control_dt, const Settings settings);

src/inverse-dynamics.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ void KinodynamicsID::setTarget(
146146
{
147147
if (!active_tsid_contacts_[i])
148148
{
149-
formulation_.addRigidContact(*tsid_contacts[i], settings_.w_contact_force, settings_.w_contact_motion, 1);
149+
formulation_.addRigidContact(
150+
*tsid_contacts[i], settings_.w_contact_force, settings_.w_contact_motion,
151+
settings_.contact_motion_equality ? 0 : 1);
150152
}
151153
switch (model_handler_.getFootType(i))
152154
{

0 commit comments

Comments
 (0)