Skip to content
Snippets Groups Projects
Commit 9e9b27c2 authored by Ale's avatar Ale
Browse files

1KHz mpc (reduced model)

Closed loop
EndEff tracking Circular motion cost
Impedance + Feedforward control
parent 367c07ca
No related branches found
No related tags found
No related merge requests found
...@@ -96,13 +96,13 @@ class Controller: ...@@ -96,13 +96,13 @@ class Controller:
self.point_target = self.target.evaluate_in_t(1)[self.pd.rfFootId] self.point_target = self.target.evaluate_in_t(1)[self.pd.rfFootId]
try: try:
#self.mpc.solve(self.k, m["x_m"], self.guess) # Closed loop mpc self.mpc.solve(self.k, m["x_m"], self.guess) # Closed loop mpc
## Trajectory tracking ## Trajectory tracking
if self.initialized: #if self.initialized:
self.mpc.solve(self.k, self.mpc_result.x[1], self.guess) # self.mpc.solve(self.k, self.mpc_result.x[1], self.guess)
else: #else:
self.mpc.solve(self.k, m["x_m"], self.guess) # self.mpc.solve(self.k, m["x_m"], self.guess)
### ONLY IF YOU WANT TO STORE THE FIRST SOLUTION TO WARMSTART THE INITIAL Problem ### ### ONLY IF YOU WANT TO STORE THE FIRST SOLUTION TO WARMSTART THE INITIAL Problem ###
#if not self.initialized: #if not self.initialized:
......
...@@ -30,7 +30,7 @@ class Target: ...@@ -30,7 +30,7 @@ class Target:
self.FR_foot0 = pd.rdata.oMf[pd.rfFootId].translation.copy() self.FR_foot0 = pd.rdata.oMf[pd.rfFootId].translation.copy()
self.A = np.array([0, 0.03, 0.03]) self.A = np.array([0, 0.03, 0.03])
self.offset = np.array([0.08, 0, 0.06]) self.offset = np.array([0.08, 0, 0.06])
self.freq = np.array([0, 2.5*0, 2.5*0]) self.freq = np.array([0, 2.5, 2.5])
self.phase = np.array([0, 0, np.pi / 2]) self.phase = np.array([0, 0, np.pi / 2])
def patternToId(self, gait): def patternToId(self, gait):
......
...@@ -112,7 +112,7 @@ def damp_control(device, nb_motors): ...@@ -112,7 +112,7 @@ def damp_control(device, nb_motors):
device.joints.set_velocity_gains(0.1 * np.ones(nb_motors)) device.joints.set_velocity_gains(0.1 * np.ones(nb_motors))
device.joints.set_desired_positions(np.zeros(nb_motors)) device.joints.set_desired_positions(np.zeros(nb_motors))
device.joints.set_desired_velocities(np.zeros(nb_motors)) device.joints.set_desired_velocities(np.zeros(nb_motors))
#device.joints.set_torques(np.zeros(nb_motors)) device.joints.set_torques(np.zeros(nb_motors))
# Send command to the robot # Send command to the robot
device.send_command_and_wait_end_of_cycle(params.dt_wbc) device.send_command_and_wait_end_of_cycle(params.dt_wbc)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment