Skip to content

Commit

Permalink
[GUI/Plan] Add button to dump plan as YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
arntanguy committed Mar 19, 2024
1 parent 4126d9c commit d51c094
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/FootstepPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,15 @@ void FootstepPlan::addGUIElements(mc_rtc::gui::StateBuilder & gui)
targetContactPolygonConf.width = 0.01;
targetContactPolygonConf.style = LineStyle::Solid;

gui.addElement({"Markers", "Footsteps", "Plan"}, mc_rtc::gui::Button("Print Plan (YAML)",
[this]
{
mc_rtc::Configuration conf;
this->save(conf);
mc_rtc::log::info("Plan:\n{}",
conf.dump(true, true));
}));

gui.addElement({"Markers", "Footsteps", "Plan"},
Polygon("TargetContact", targetContactPolygonConf,
[this, footStepPolygon]() { return footStepPolygon(targetContact()); }),
Expand All @@ -268,6 +277,7 @@ void FootstepPlan::addGUIElements(mc_rtc::gui::StateBuilder & gui)
void FootstepPlan::removeGUIElements(mc_rtc::gui::StateBuilder & gui)
{
gui.removeElement({"Walking"}, "Torso Pitch [deg]");
gui.removeElement({"Walking"}, "Print Plan");
gui.removeCategory({"Markers", "Footsteps", "Plan"});
}

Expand Down

0 comments on commit d51c094

Please sign in to comment.