Skip to content

Commit 57df367

Browse files
author
earlaud
committed
Adjust default ID tuning and adjust tests
1 parent 70c7633 commit 57df367

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

include/simple-mpc/inverse-dynamics.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ namespace simple_mpc
3838
0.01) // Min force for one foot contact (express as a multiple of the robot weight)
3939

4040
// Tasks gains
41-
DEFINE_FIELD(double, kp_base, 10.0)
42-
DEFINE_FIELD(double, kp_posture, 10.0)
43-
DEFINE_FIELD(double, kp_contact, 10.0)
41+
DEFINE_FIELD(double, kp_base, 10)
42+
DEFINE_FIELD(double, kp_posture, 10)
43+
DEFINE_FIELD(double, kp_contact, 10)
4444

4545
// Tasks weights
4646
DEFINE_FIELD(double, w_base, 10.)
4747
DEFINE_FIELD(double, w_posture, 1.0)
48+
DEFINE_FIELD(double, w_contact_motion, 1.0)
4849
DEFINE_FIELD(double, w_contact_force, 1.0)
49-
DEFINE_FIELD(double, w_contact_motion, 1e-1)
5050

5151
static Settings Default()
5252
{

tests/inverse_dynamics.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ BOOST_AUTO_TEST_CASE(KinodynamicsID_contact)
9696
Eigen::VectorXd tau = Eigen::VectorXd::Zero(model_handler.getModel().nv - 6);
9797

9898
// Let the robot stabilize
99-
const int N_STEP_ON_GROUND = 10000;
100-
const int N_STEP_FREE_FALL = 1000;
99+
const int N_STEP_ON_GROUND = 6000;
100+
const int N_STEP_FREE_FALL = 2000;
101101
for (int i = 0; i < N_STEP_ON_GROUND + N_STEP_FREE_FALL; i++)
102102
{
103103
// Solve and get solution
@@ -108,12 +108,11 @@ BOOST_AUTO_TEST_CASE(KinodynamicsID_contact)
108108
t += dt;
109109
q = pinocchio::integrate(model_handler.getModel(), q, (v + a / 2. * dt) * dt);
110110
v += a * dt;
111-
112111
if (i == N_STEP_ON_GROUND)
113112
{
114113
// Robot had time to reach permanent regime, is it stable on ground ?
115-
BOOST_CHECK_SMALL(a.head(3).norm(), 1e-8);
116-
BOOST_CHECK_SMALL(v.head(3).norm(), 1e-8);
114+
BOOST_CHECK_SMALL(a.head(3).norm(), 1e-4);
115+
BOOST_CHECK_SMALL(v.head(3).norm(), 1e-4);
117116

118117
// Remove contacts
119118
solver.setTarget(
@@ -123,7 +122,7 @@ BOOST_AUTO_TEST_CASE(KinodynamicsID_contact)
123122
if (i == N_STEP_ON_GROUND + N_STEP_FREE_FALL - 1)
124123
{
125124
// Robot had time to reach permanent regime, is it robot free falling ?
126-
BOOST_CHECK_SMALL((a.head(3) - model_handler.getModel().gravity.linear()).norm(), 0.1);
125+
BOOST_CHECK_SMALL(a.head(3).norm() - model_handler.getModel().gravity.linear().norm(), 0.01);
127126
}
128127
}
129128
}

0 commit comments

Comments
 (0)