From d6a40bfe80bf77920a4a9c48054a368df598740b Mon Sep 17 00:00:00 2001 From: Stefano Date: Thu, 20 Jun 2024 19:36:29 +0200 Subject: [PATCH] Added saving to file of walking on stairs output --- .../main_walking_on_stairs.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/hippopt/turnkey_planners/humanoid_kinodynamic/main_walking_on_stairs.py b/src/hippopt/turnkey_planners/humanoid_kinodynamic/main_walking_on_stairs.py index bfeb4762..1b32c55a 100644 --- a/src/hippopt/turnkey_planners/humanoid_kinodynamic/main_walking_on_stairs.py +++ b/src/hippopt/turnkey_planners/humanoid_kinodynamic/main_walking_on_stairs.py @@ -1,6 +1,7 @@ import logging import casadi as cs +import hdf5storage import idyntree.bindings as idyntree import liecasadi import numpy as np @@ -584,6 +585,21 @@ def get_references( file_name_stem="humanoid_walking_step", ) + print("Saving data to humanoid_walking_step.mat") + + humanoid_walking_step = { + "output": output.to_dict(), + "guess": planner_guess.to_dict( + flatten=False, + output_conversion=hippopt.OptimizationObject.DMConversion, + ), + } + hdf5storage.savemat( + file_name="humanoid_walking_step.mat", + mdict=humanoid_walking_step, + truncate_existing=True, + ) + plotter_settings = hp_rp.FootContactStatePlotterSettings() plotter_settings.terrain = planner_settings.terrain left_foot_plotter = hp_rp.FootContactStatePlotter(plotter_settings)