Skip to content

Commit cc34cfd

Browse files
committed
Add land_cstr boolean
1 parent 20e5fdd commit cc34cfd

File tree

13 files changed

+17
-4
lines changed

13 files changed

+17
-4
lines changed

bindings/expose-fulldynamics.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ namespace simple_mpc::python
3939
conf.torque_limits = bp::extract<bool>(settings["torque_limits"]);
4040
conf.kinematics_limits = bp::extract<bool>(settings["kinematics_limits"]);
4141
conf.force_cone = bp::extract<bool>(settings["force_cone"]);
42+
conf.land_cstr = bp::extract<bool>(settings["land_cstr"]);
4243

4344
return new FullDynamicsOCP(conf, model_handler);
4445
}
@@ -126,6 +127,7 @@ namespace simple_mpc::python
126127
settings["torque_limits"] = conf.torque_limits;
127128
settings["kinematics_limits"] = conf.kinematics_limits;
128129
settings["force_cone"] = conf.force_cone;
130+
settings["land_cstr"] = conf.land_cstr;
129131

130132
return settings;
131133
}

bindings/expose-kinodynamics.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace simple_mpc::python
2828

2929
conf.kinematics_limits = bp::extract<bool>(settings["kinematics_limits"]);
3030
conf.force_cone = bp::extract<bool>(settings["force_cone"]);
31+
conf.land_cstr = bp::extract<bool>(settings["land_cstr"]);
3132

3233
return new KinodynamicsOCP(conf, model_handler);
3334
}
@@ -51,6 +52,7 @@ namespace simple_mpc::python
5152
settings["Wfoot"] = conf.Wfoot;
5253
settings["kinematics_limits"] = conf.kinematics_limits;
5354
settings["force_cone"] = conf.force_cone;
55+
settings["land_cstr"] = conf.land_cstr;
5456

5557
return settings;
5658
}

examples/go2_fulldynamics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
torque_limits=True,
7575
kinematics_limits=True,
7676
force_cone=False,
77+
land_cstr=False
7778
)
7879
T = 50
7980

examples/go2_kinodynamics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
Wfoot=0.01,
7676
kinematics_limits=True,
7777
force_cone=False,
78+
land_cstr=False
7879
)
7980
T = 50
8081

examples/talos_fulldynamics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
torque_limits=True,
8282
kinematics_limits=True,
8383
force_cone=True,
84+
land_cstr=False
8485
)
8586

8687
T = 100

examples/talos_kinodynamics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
Wfoot=0.075,
9090
kinematics_limits=True,
9191
force_cone=False,
92+
land_cstr=False
9293
)
9394

9495
T = 100

include/simple-mpc/fulldynamics.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ namespace simple_mpc
4949
bool torque_limits;
5050
bool kinematics_limits;
5151
bool force_cone;
52+
bool land_cstr;
5253

5354
// Control limits
5455
Eigen::VectorXd umin;

include/simple-mpc/kinodynamics.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ namespace simple_mpc
4747
// Constraint
4848
bool kinematics_limits;
4949
bool force_cone;
50+
bool land_cstr;
5051
};
5152

5253
class KinodynamicsOCP : public OCPHandler

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<depend>boost</depend>
1515
<depend>pinocchio</depend>
1616
<depend>proxsuite-nlp</depend>
17+
<depend>proxsuite</depend>
1718
<depend>aligator</depend>
1819
<depend>std_msgs</depend>
1920

src/fulldynamics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ namespace simple_mpc
171171
stm.addConstraint(wrench_residual, NegativeOrthant());
172172
}
173173

174-
if (land_constraint.at(name))
174+
if (settings_.land_cstr and land_constraint.at(name))
175175
{
176176
FrameVelocityResidual velocity_residual = FrameVelocityResidual(
177177
space.ndx(), nu_, model_handler_.getModel(), Motion::Zero(), model_handler_.getFootId(name),
@@ -187,7 +187,7 @@ namespace simple_mpc
187187
space.ndx(), model_handler_.getModel(), actuation_matrix_, cms, prox_settings_, name, settings_.mu);
188188
stm.addConstraint(friction_residual, NegativeOrthant());
189189
}
190-
if (land_constraint.at(name))
190+
if (settings_.land_cstr and land_constraint.at(name))
191191
{
192192
std::vector<int> vel_id = {0, 1, 2};
193193
FrameVelocityResidual velocity_residual = FrameVelocityResidual(

0 commit comments

Comments
 (0)