Skip to content

Commit

Permalink
Replace exception with assert (#432)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Mar 8, 2024
1 parent 0b26b8a commit ad72aae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion include/sleipnir/control/OCPSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#pragma once

#include <chrono>
#include <concepts>
#include <functional>

#include "sleipnir/autodiff/VariableMatrix.hpp"
Expand Down
6 changes: 3 additions & 3 deletions src/control/OCPSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include "sleipnir/control/OCPSolver.hpp"

#include "sleipnir/util/Assert.hpp"

namespace sleipnir {

OCPSolver::OCPSolver(int numStates, int numInputs,
Expand Down Expand Up @@ -56,9 +58,7 @@ OCPSolver::OCPSolver(int numStates, int numInputs,
}

void OCPSolver::ConstrainDirectCollocation() {
if (m_dynamicsType != DynamicsType::kExplicitODE) {
throw std::runtime_error("Direct Collocation requires an explicit ODE");
}
Assert(m_dynamicsType == DynamicsType::kExplicitODE);

Variable time = 0.0;

Expand Down

0 comments on commit ad72aae

Please sign in to comment.