File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,8 @@ namespace simple_mpc
185
185
186
186
void switchToStand ();
187
187
188
+ void switchToJump ();
189
+
188
190
// Footstep timings for each end effector
189
191
std::map<std::string, std::vector<int >> foot_takeoff_times_, foot_land_times_;
190
192
std::size_t one_horizon_iterator_;
Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ namespace simple_mpc
275
275
276
276
void MPC::recedeWithCycle ()
277
277
{
278
- if (now_ == MOTION)
278
+ if (now_ == MOTION or one_horizon_iterator_ > 0 )
279
279
{
280
280
ocp_handler_->getProblem ().replaceStageCircular (*one_horizon_[0 ]);
281
281
solver_->cycleProblem (ocp_handler_->getProblem (), one_horizon_data_[0 ]);
@@ -290,7 +290,9 @@ namespace simple_mpc
290
290
now_ = STANDING;
291
291
}
292
292
}
293
- if (now_ == WALKING or ocp_handler_->getContactSupport (ocp_handler_->getSize () - 1 ) < ee_names_.size ())
293
+ if (
294
+ now_ == WALKING
295
+ or (now_ == STANDING and ocp_handler_->getContactSupport (ocp_handler_->getSize () - 1 ) < ee_names_.size ()))
294
296
{
295
297
296
298
ocp_handler_->getProblem ().replaceStageCircular (*cycle_horizon_[0 ]);
@@ -462,4 +464,10 @@ namespace simple_mpc
462
464
velocity_base_.setZero ();
463
465
}
464
466
467
+ void MPC::switchToJump ()
468
+ {
469
+ now_ = MOTION;
470
+ velocity_base_.setZero ();
471
+ }
472
+
465
473
} // namespace simple_mpc
You can’t perform that action at this time.
0 commit comments