Skip to content

Commit 8611a62

Browse files
authored
Merge pull request #44 from Simple-Robotics/topic/solve_typos
Fix small typos
2 parents 3214932 + 521f4dc commit 8611a62

File tree

8 files changed

+13
-19
lines changed

8 files changed

+13
-19
lines changed

bindings/expose-mpc.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ namespace simple_mpc
2929
{
3030
MPCSettings conf;
3131

32-
conf.ddpIteration = bp::extract<int>(settings["ddpIteration"]);
33-
3432
conf.support_force = bp::extract<double>(settings["support_force"]);
3533

3634
conf.TOL = bp::extract<double>(settings["TOL"]);
@@ -50,7 +48,6 @@ namespace simple_mpc
5048
{
5149
MPCSettings & conf = self.settings_;
5250
bp::dict settings;
53-
settings["ddpIteration"] = conf.ddpIteration;
5451
settings["support_force"] = conf.support_force;
5552
settings["TOL"] = conf.TOL;
5653
settings["mu_init"] = conf.mu_init;

examples/go2_fulldynamics.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
T_ss = 30
8585
N_simu = int(0.01 / 0.001)
8686
mpc_conf = dict(
87-
ddpIteration=1,
8887
support_force=-model_handler.getMass() * gravity[2],
8988
TOL=1e-4,
9089
mu_init=1e-8,

examples/go2_kinodynamics.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
fref = np.zeros(force_size)
3232
fref[2] = -model_handler.getMass() / nk * gravity[2]
3333
u0 = np.concatenate((fref, fref, fref, fref, np.zeros(model_handler.getModel().nv - 6)))
34-
34+
dt = 0.01
3535

3636
w_basepos = [0, 0, 100, 10, 10, 0]
3737
w_legpos = [1, 1, 1]
@@ -60,7 +60,7 @@
6060
w_centder = np.diag(np.concatenate((w_centder_lin, w_centder_ang)))
6161

6262
problem_conf = dict(
63-
timestep=0.01,
63+
timestep=dt,
6464
w_x=w_x,
6565
w_u=w_u,
6666
w_cent=w_cent,
@@ -85,7 +85,6 @@
8585
T_ss = 30
8686

8787
mpc_conf = dict(
88-
ddpIteration=1,
8988
support_force=-model_handler.getMass() * gravity[2],
9089
TOL=1e-4,
9190
mu_init=1e-8,
@@ -94,7 +93,7 @@
9493
swing_apex=0.15,
9594
T_fly=T_ss,
9695
T_contact=T_ds,
97-
timestep=0.01,
96+
timestep=dt,
9897
)
9998

10099
mpc = MPC(mpc_conf, dynproblem)
@@ -149,7 +148,7 @@
149148
qp = IDSolver(id_conf, model_handler.getModel())
150149

151150
""" Interpolation """
152-
interpolator = Interpolator(nq + nv, nv, nu, nf, 0.01)
151+
interpolator = Interpolator(model_handler.getModel())
153152

154153
""" Initialize simulation"""
155154
device = BulletRobot(
@@ -252,7 +251,10 @@
252251

253252
for j in range(N_simu):
254253
# time.sleep(0.01)
255-
interpolator.interpolate(j / float(N_simu), xss, uss, ddqs, forces)
254+
delay = j / float(N_simu) * dt
255+
256+
acc_interp = interpolator.interpolateLinear(delay, dt, ddqs)
257+
force_interp = interpolator.interpolateLinear(delay, dt, forces)
256258

257259
q_meas, v_meas = device.measureState()
258260
x_measured = np.concatenate([q_meas, v_meas])
@@ -263,9 +265,9 @@
263265
mpc.getDataHandler().getData(),
264266
contact_states,
265267
x_measured[nq:],
266-
interpolator.a_interpolated,
268+
acc_interp,
267269
np.zeros(12),
268-
interpolator.forces_interpolated,
270+
force_interp,
269271
mpc.getDataHandler().getData().M,
270272
)
271273

examples/talos_centroidal.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
T_ss = 80
6565

6666
mpc_conf = dict(
67-
ddpIteration=1,
6867
support_force=-model_handler.getMass() * gravity[2],
6968
TOL=1e-4,
7069
mu_init=1e-8,

examples/talos_fulldynamics.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
T_ds = 20
9393
totalSteps = 1
9494
mpc_conf = dict(
95-
ddpIteration=1,
9695
support_force=-model_handler.getMass() * gravity[2],
9796
TOL=1e-4,
9897
mu_init=1e-8,

examples/talos_kinodynamics.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
T_ds = 20
101101
T_ss = 80
102102
mpc_conf = dict(
103-
ddpIteration=1,
104103
support_force=-model_handler.getMass() * gravity[2],
105104
TOL=1e-4,
106105
mu_init=1e-8,

include/simple-mpc/mpc.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ namespace simple_mpc
3737
double mu_init = 1e-8;
3838
std::size_t max_iters = 1;
3939
std::size_t num_threads = 2;
40-
int ddpIteration = 1;
4140

4241
// Timings
4342
int T_fly = 80;

tests/mpc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ BOOST_AUTO_TEST_CASE(mpc_fulldynamics)
2525
fdproblem.createProblem(model_handler.getReferenceState(), T, 6, -settings.gravity[2], true);
2626

2727
MPCSettings mpc_settings;
28-
mpc_settings.ddpIteration = 1;
28+
mpc_settings.max_iters = 1;
2929

3030
mpc_settings.support_force = -model_handler.getMass() * settings.gravity[2];
3131

@@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE(mpc_kinodynamics)
108108
kinoproblem.createProblem(model_handler.getReferenceState(), T, 6, -settings.gravity[2], true);
109109

110110
MPCSettings mpc_settings;
111-
mpc_settings.ddpIteration = 1;
111+
mpc_settings.max_iters = 1;
112112

113113
mpc_settings.support_force = support_force;
114114

@@ -186,7 +186,7 @@ BOOST_AUTO_TEST_CASE(mpc_centroidal)
186186
centproblem.createProblem(data_handler.getCentroidalState(), T, 6, -settings.gravity[2], false);
187187

188188
MPCSettings mpc_settings;
189-
mpc_settings.ddpIteration = 1;
189+
mpc_settings.max_iters = 1;
190190

191191
mpc_settings.support_force = support_force;
192192

0 commit comments

Comments
 (0)