diff --git a/trajopt_optimizers/trajopt_sqp/include/trajopt_sqp/types.h b/trajopt_optimizers/trajopt_sqp/include/trajopt_sqp/types.h index 1ba279ac..24f2f108 100644 --- a/trajopt_optimizers/trajopt_sqp/include/trajopt_sqp/types.h +++ b/trajopt_optimizers/trajopt_sqp/include/trajopt_sqp/types.h @@ -55,7 +55,7 @@ struct SQPParameters /** @brief NLP converges if approx_merit_improves is smaller than this */ double min_approx_improve = 1e-4; /** @brief NLP converges if approx_merit_improve / best_exact_merit < min_approx_improve_frac */ - double min_approx_improve_frac = static_cast(-INFINITY); + double min_approx_improve_frac = std::numeric_limits::lowest(); /** @brief Max number of QP calls allowed */ int max_iterations = 50; @@ -73,7 +73,7 @@ struct SQPParameters /** @brief Constraints are scaled by this amount when inflated */ double merit_coeff_increase_ratio = 10; /** @brief Max time in seconds that the optimizer will run */ - double max_time = static_cast(INFINITY); + double max_time = std::numeric_limits::max(); /** @brief Initial coefficient that is used to scale the constraints. The total constaint cost is constaint_value * coeff * merit_coeff */ double initial_merit_error_coeff = 10; diff --git a/trajopt_sco/include/trajopt_sco/optimizers.hpp b/trajopt_sco/include/trajopt_sco/optimizers.hpp index d8f8ef63..c6e8473b 100644 --- a/trajopt_sco/include/trajopt_sco/optimizers.hpp +++ b/trajopt_sco/include/trajopt_sco/optimizers.hpp @@ -89,7 +89,7 @@ struct BasicTrustRegionSQPParameters /** @brief If model improves less than this, exit and report convergence */ double min_approx_improve = 1e-4; /** @brief If model improves less than this, exit and report convergence */ - double min_approx_improve_frac = static_cast(-INFINITY); + double min_approx_improve_frac = std::numeric_limits::lowest(); /** @brief The max number of iterations */ double max_iter = 50; /** @brief If improvement is less than improve_ratio_threshold, shrink trust region by this ratio */ @@ -105,7 +105,7 @@ struct BasicTrustRegionSQPParameters /** @brief Ratio that we increase coeff each time */ double merit_coeff_increase_ratio = 10; /** @brief Max time in seconds that the optimizer will run */ - double max_time = static_cast(INFINITY); + double max_time = std::numeric_limits::max(); /** @brief Initial coefficient that is used to scale the constraints. The total constaint cost is constaint_value * * coeff * merit_coeff */ double initial_merit_error_coeff = 10;