From 0e580c220de6bb4fe1e5c3df65bac3de1d87472c Mon Sep 17 00:00:00 2001 From: Fanny Risbourg <frisbourg@laas.fr> Date: Mon, 12 Sep 2022 13:28:38 +0200 Subject: [PATCH] working 1KHz --- config/walk_parameters.yaml | 4 +-- .../quadruped_reactive_walking/Controller.py | 30 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/config/walk_parameters.yaml b/config/walk_parameters.yaml index 5c86cf71..ca11e461 100644 --- a/config/walk_parameters.yaml +++ b/config/walk_parameters.yaml @@ -22,7 +22,7 @@ robot: # q_init: [0.0, 0.764, -1.407, 0.0, 0.76407, -1.4, 0.0, 0.76407, -1.407, 0.0, 0.764, -1.407] # h_com = 0.218 q_init: [0.0, 0.7, -1.4, 0.0, 0.7, -1.4, 0.0, -0.7, 1.4, 0.0, -0.7, 1.4] # Initial articular positions dt_wbc: 0.001 # Time step of the whole body control - dt_mpc: 0.01 # Time step of the model predictive control + dt_mpc: 0.001 # Time step of the model predictive control type_MPC: 3 # Which MPC solver you want to use: 0 for OSQP MPC, 1, 2, 3 for Crocoddyl MPCs save_guess: false # true to interpolate the impedance quantities between nodes of the MPC movement: "circle" # name of the movement to perform @@ -37,7 +37,7 @@ robot: # Parameters of Gait N_periods: 1 - gait: [5, 0, 0, 0, 0] # Initial gait matrix + gait: [50, 0, 0, 0, 0] # Initial gait matrix # Parameters of Joystick gp_alpha_vel: 0.003 # Coefficient of the low pass filter applied to gamepad velocity diff --git a/python/quadruped_reactive_walking/Controller.py b/python/quadruped_reactive_walking/Controller.py index 026b6cc6..eb8a0939 100644 --- a/python/quadruped_reactive_walking/Controller.py +++ b/python/quadruped_reactive_walking/Controller.py @@ -274,21 +274,21 @@ class Controller: self.result.FF = self.params.Kff_main * np.ones(12) self.result.tau_ff[3:6] = self.compute_torque(m)[:] - if self.params.interpolate_mpc: - if self.mpc_result.new_result: - if self.params.interpolation_type == 3: - self.interpolator.update(xs[0], xs[1], xs[2]) - # self.interpolator.plot(self.pd.mpc_wbc_ratio, self.pd.dt_wbc) - t = (self.k - self.k_solve + 1) * self.pd.dt_wbc - q, v = self.interpolator.interpolate(t) - else: - q, v = self.integrate_x(m) - - # self.result.q_des[3:6] = xs[1][:3] - # self.result.v_des[3:6] = xs[1][3:] - - self.result.q_des[3:6] = q - self.result.v_des[3:6] = v + # if self.params.interpolate_mpc: + # if self.mpc_result.new_result: + # if self.params.interpolation_type == 3: + # self.interpolator.update(xs[0], xs[1], xs[2]) + # # self.interpolator.plot(self.pd.mpc_wbc_ratio, self.pd.dt_wbc) + # t = (self.k - self.k_solve + 1) * self.pd.dt_wbc + # q, v = self.interpolator.interpolate(t) + # else: + # q, v = self.integrate_x(m) + + self.result.q_des[3:6] = xs[1][:3] + self.result.v_des[3:6] = xs[1][3:] + + # self.result.q_des[3:6] = q + # self.result.v_des[3:6] = v if self.axs is not None: [ -- GitLab