Skip to content

Commit

Permalink
fix(autoware_qp_interface): incorrect parameter passing in delegating…
Browse files Browse the repository at this point in the history
… constructor (autowarefoundation#147)

Signed-off-by: NorahXiong <[email protected]>
Co-authored-by: Ryohsuke Mitsudome <[email protected]>
Co-authored-by: Yutaka Kondo <[email protected]>
  • Loading branch information
3 people authored Jan 24, 2025
1 parent f27c9fb commit 45ead1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@
namespace autoware::qp_interface
{
constexpr c_float OSQP_INF = 1e30;
constexpr int OSQP_MAX_ITERATION = 20000;

class OSQPInterface : public QPInterface
{
public:
/// \brief Constructor without problem formulation
OSQPInterface(
const bool enable_warm_start = false, const int max_iteration = 20000,
const bool enable_warm_start = false, const int max_iteration = OSQP_MAX_ITERATION,
const c_float eps_abs = std::numeric_limits<c_float>::epsilon(),
const c_float eps_rel = std::numeric_limits<c_float>::epsilon(), const bool polish = true,
const bool verbose = false);
Expand Down
4 changes: 2 additions & 2 deletions common/autoware_qp_interface/src/osqp_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ OSQPInterface::OSQPInterface(
const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector<double> & q,
const std::vector<double> & l, const std::vector<double> & u, const bool enable_warm_start,
const c_float eps_abs)
: OSQPInterface(enable_warm_start, eps_abs)
: OSQPInterface(enable_warm_start, OSQP_MAX_ITERATION, eps_abs)
{
initializeProblem(P, A, q, l, u);
}
Expand All @@ -61,7 +61,7 @@ OSQPInterface::OSQPInterface(
const CSC_Matrix & P, const CSC_Matrix & A, const std::vector<double> & q,
const std::vector<double> & l, const std::vector<double> & u, const bool enable_warm_start,
const c_float eps_abs)
: OSQPInterface(enable_warm_start, eps_abs)
: OSQPInterface(enable_warm_start, OSQP_MAX_ITERATION, eps_abs)
{
initializeCSCProblemImpl(P, A, q, l, u);
}
Expand Down

0 comments on commit 45ead1c

Please sign in to comment.