Skip to content

Commit

Permalink
Added visualization of forces in flat ground planner
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Dafarra committed Nov 2, 2023
1 parent 456820f commit 0ccf11b
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions src/hippopt/turnkey_planners/humanoid_walking_flat_ground/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,21 +402,35 @@ def get_references(

plotter_settings = hp_rp.FootContactStatePlotterSettings()
plotter_settings.terrain = planner_settings.terrain
left_complementarity_plotter = hp_rp.FootContactStatePlotter(plotter_settings)
left_complementarity_plotter.plot_complementarity(
left_foot_plotter = hp_rp.FootContactStatePlotter(plotter_settings)
right_foot_plotter = hp_rp.FootContactStatePlotter(plotter_settings)

left_foot_plotter.plot_complementarity(
states=left_contact_points,
time_s=output.values.dt,
title="Left Foot Complementarity",
blocking=False,
)
right_complementarity_plotter = hp_rp.FootContactStatePlotter(plotter_settings)
right_complementarity_plotter.plot_complementarity(
right_foot_plotter.plot_complementarity(
states=right_contact_points,
time_s=output.values.dt,
title="Right Foot Complementarity",
blocking=False,
)

left_foot_plotter.plot_forces(
states=left_contact_points,
time_s=output.values.dt,
title="Left Foot Forces",
blocking=False,
)
right_foot_plotter.plot_forces(
states=right_contact_points,
time_s=output.values.dt,
title="Right Foot Forces",
blocking=False,
)

visualizer.visualize(
state=humanoid_states, timestep_s=output.values.dt, time_multiplier=2.0
)
Expand All @@ -431,5 +445,5 @@ def get_references(

print("Press [Enter] to exit.")
input()
left_complementarity_plotter.close()
right_complementarity_plotter.close()
left_foot_plotter.close()
right_foot_plotter.close()

0 comments on commit 0ccf11b

Please sign in to comment.