Skip to content

Commit

Permalink
fix time at preJump node of initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
mayataka committed Dec 20, 2022
1 parent f4174ec commit c2ce839
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ocs2_ipm/src/IpmSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@ void IpmSolver::initializeSlackDualTrajectory(const std::vector<AnnotatedTime>&
std::tie(slackStateIneq[i], std::ignore) = ipm::fromMultiplierCollection(slackIneqTrajectory_.preJumps[cachedEventIndex]);
std::tie(dualStateIneq[i], std::ignore) = ipm::fromMultiplierCollection(dualIneqTrajectory_.preJumps[cachedEventIndex]);
} else {
slackStateIneq[i] = ipm::initializeEventSlackVariable(ocpDefinition, getIntervalStart(timeDiscretization[i]), x[i],
scalar_t time = timeDiscretization[i].time;
slackStateIneq[i] = ipm::initializeEventSlackVariable(ocpDefinition, timeDiscretization[i].time, x[i],
settings_.initialSlackLowerBound, settings_.initialSlackMarginRate);
dualStateIneq[i] =
ipm::initializeDualVariable(slackStateIneq[i], barrierParam, settings_.initialDualLowerBound, settings_.initialDualMarginRate);
Expand All @@ -434,7 +435,7 @@ void IpmSolver::initializeSlackDualTrajectory(const std::vector<AnnotatedTime>&
dualStateInputIneq[i].resize(0);
++eventIdx;
} else {
const auto time = getIntervalStart(timeDiscretization[i]);
const scalar_t time = getIntervalStart(timeDiscretization[i]);
if (interpolatableTimePeriod.first <= time && time <= interpolatableTimePeriod.second) {
std::tie(slackStateIneq[i], slackStateInputIneq[i]) =
ipm::fromMultiplierCollection(getIntermediateDualSolutionAtTime(slackIneqTrajectory_, time));
Expand Down

0 comments on commit c2ce839

Please sign in to comment.