Skip to content
Snippets Groups Projects
Commit 01cffa0c authored by Ale's avatar Ale
Browse files

fix results export issue

parent 70b2f836
No related branches found
No related tags found
1 merge request!32Draft: Reverse-merge casadi-walking into new WBC devel branch
...@@ -38,7 +38,7 @@ robot: ...@@ -38,7 +38,7 @@ robot:
# Parameters of Gait # Parameters of Gait
N_periods: 1 N_periods: 1
gait: [20, 1, 0, 0, 1, gait: [20, 1, 0, 0, 1,
20, 0, 1, 1, 0] # Initial gait matrix 20, 1, 1, 1, 1] # Initial gait matrix
# Parameters of Joystick # Parameters of Joystick
gp_alpha_vel: 0.003 # Coefficient of the low pass filter applied to gamepad velocity gp_alpha_vel: 0.003 # Coefficient of the low pass filter applied to gamepad velocity
......
...@@ -211,7 +211,7 @@ class OCP: ...@@ -211,7 +211,7 @@ class OCP:
self.results.a = acs_sol self.results.a = acs_sol
self.results.u = us_sol self.results.u = us_sol
self.results.fs = fsol_to_ws self.results.fs = fsol_to_ws
return self.results return self.results.x, self.results.a, self.results.u, self.results.fs, 0
def get_feet_position(self, xs_sol): def get_feet_position(self, xs_sol):
""" Get the feet positions computed durnig one ocp """ Get the feet positions computed durnig one ocp
......
...@@ -92,14 +92,14 @@ class ProblemData(problemDataAbstract): ...@@ -92,14 +92,14 @@ class ProblemData(problemDataAbstract):
# Cost function weights # Cost function weights
# Cost function weights # Cost function weights
self.mu = 0.7 self.mu = 0.7
self.base_velocity_tracking_w = 1e2 self.base_velocity_tracking_w = 1e2*0
self.ground_collision_w = 1e3 self.ground_collision_w = 1e3*0
self.friction_cone_w = 1e4 self.friction_cone_w = 1e4
self.impact_altitude_w= 1e3 self.impact_altitude_w= 1e3
self.impact_velocity_w = 1e3 self.impact_velocity_w = 1e3
self.control_bound_w = 1e3 * 0 self.control_bound_w = 1e3*0
self.control_reg_w = 1e0 self.control_reg_w = 1e0
self.state_reg_w = np.array([0] * 3 self.state_reg_w = np.array([0] * 3
+ [1e1] * 3 + [1e1] * 3
......
...@@ -16,7 +16,7 @@ class Result: ...@@ -16,7 +16,7 @@ class Result:
self.xs = list(np.zeros((pd.T + 1, pd.nx))) self.xs = list(np.zeros((pd.T + 1, pd.nx)))
self.us = list(np.zeros((pd.T, pd.nu))) self.us = list(np.zeros((pd.T, pd.nu)))
self.acs = list(np.zeros((pd.T, pd.nv))) self.acs = list(np.zeros((pd.T, pd.nv)))
self.fs = list(np.zeros((pd.T, pd.nu))) self.fs = list(np.zeros((pd.T, 12)))
self.K = list(np.zeros([pd.T, pd.nu, pd.ndx])) self.K = list(np.zeros([pd.T, pd.nu, pd.ndx]))
self.solving_duration = 0.0 self.solving_duration = 0.0
self.new_result = False self.new_result = False
...@@ -98,12 +98,11 @@ class MPC_Wrapper: ...@@ -98,12 +98,11 @@ class MPC_Wrapper:
Run the MPC (synchronous version) Run the MPC (synchronous version)
""" """
self.ocp.solve(x0, tasks, gait, guess) self.ocp.solve(x0, tasks, gait, guess)
( self.last_available_result.xs,\
self.last_available_result.xs, self.last_available_result.acs,\
self.last_available_result.us, self.last_available_result.us,\
self.last_available_result.K, self.last_available_result.fs,\
self.last_available_result.solving_duration, self.last_available_result.solving_duration = self.ocp.get_results()
) = self.ocp.get_results()
self.new_result.value = True self.new_result.value = True
def run_MPC_asynchronous(self, k, x0, tasks, gait, xs, us): def run_MPC_asynchronous(self, k, x0, tasks, gait, xs, us):
......
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