DAIRLab / dairlib

MIT License
76 stars 27 forks source link

Seg Fault when exploring contact modes of the Planar Walker examples #213

Closed jdcaporale closed 3 years ago

jdcaporale commented 3 years ago

Trying to include a double stance mode in the planar walker for testing. We added a double stance mode to the sequence and we seg fault where we realize the sequence ( auto trajopt = Dircon<T>(sequence); <- line 109 in run_gait_dircon).

Below are the relevant changes we made that caused the seg fault.

  auto evaluators_both = multibody::KinematicEvaluatorSet<T>(plant);
  evaluators_both.add_evaluator(&left_foot_eval);
  evaluators_both.add_evaluator(&right_foot_eval);
  auto mode_double_support = DirconMode<T>(evaluators_both, num_knotpoints,
                                  min_T, max_T);
  mode_double_support.MakeConstraintRelative(0, 0);  // x-coordinate
  mode_double_support.MakeConstraintRelative(1, 0);  // x-coordinate
jdcaporale commented 3 years ago

We chatted with Will Yang about the issue and he suggested the following fix, but still wanted us to create an issue incase there was a better/different fix

change line 288 in dircon.cc toif (i_mode > 0 && is_impact) {

mposa commented 3 years ago

That seems like the right fix to me. Since it's so short, I'll just push it now. Thanks!