From f5682d4a81265607b444c3c5858256bd9d759ccf Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Fri, 21 Jun 2024 13:44:23 -0700 Subject: [PATCH] Upgrade Sleipnir to automatically call Update() in Value() (#195) --- CMakeLists.txt | 4 ++-- src/optimization/SwerveTrajoptUtil.hpp | 20 ++++++++------------ src/optimization/TrajoptUtil.hpp | 4 ++-- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c686948..15cf5ccd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,8 +103,8 @@ set(BUILD_EXAMPLES OFF) fetchcontent_declare( Sleipnir GIT_REPOSITORY https://github.com/SleipnirGroup/Sleipnir.git - # main on 2024-06-18 - GIT_TAG affeafcd797ad1312b18172dbaed0a69cca6546e + # main on 2024-06-20 + GIT_TAG b060d361b68d23a6499ebd9d08560c073dfac462 PATCH_COMMAND git apply ${CMAKE_CURRENT_SOURCE_DIR}/cmake/0001-Downgrade-to-C-20.patch UPDATE_DISCONNECTED 1 diff --git a/src/optimization/SwerveTrajoptUtil.hpp b/src/optimization/SwerveTrajoptUtil.hpp index 62a68997..2b24e17b 100644 --- a/src/optimization/SwerveTrajoptUtil.hpp +++ b/src/optimization/SwerveTrajoptUtil.hpp @@ -170,18 +170,14 @@ inline void ApplyPowerConstraints(sleipnir::OptimizationProblem& problem, inline SwerveSolution ConstructSwerveSolution( const sleipnir::OptimizationProblem& problem, - const std::vector& x, - const std::vector& y, - const std::vector& theta, - const std::vector& vx, - const std::vector& vy, - const std::vector& omega, - const std::vector& ax, - const std::vector& ay, - const std::vector& alpha, - const std::vector>& Fx, - const std::vector>& Fy, - const std::vector& dt, const std::vector& N) { + std::vector& x, std::vector& y, + std::vector& theta, std::vector& vx, + std::vector& vy, std::vector& omega, + std::vector& ax, std::vector& ay, + std::vector& alpha, + std::vector>& Fx, + std::vector>& Fy, + std::vector& dt, const std::vector& N) { std::vector dtPerSamp; for (size_t sgmtIdx = 0; sgmtIdx < N.size(); ++sgmtIdx) { size_t N_sgmt = N.at(sgmtIdx); diff --git a/src/optimization/TrajoptUtil.hpp b/src/optimization/TrajoptUtil.hpp index fd04ffe8..c784e4ce 100644 --- a/src/optimization/TrajoptUtil.hpp +++ b/src/optimization/TrajoptUtil.hpp @@ -141,7 +141,7 @@ inline void ApplySet2dConstraint(sleipnir::OptimizationProblem& problem, inline std::vector RowSolutionValue( const sleipnir::OptimizationProblem& problem, - const std::vector& rowVector) { + std::vector& rowVector) { std::vector valueRowVector; valueRowVector.reserve(rowVector.size()); for (auto& expression : rowVector) { @@ -152,7 +152,7 @@ inline std::vector RowSolutionValue( inline std::vector> MatrixSolutionValue( const sleipnir::OptimizationProblem& problem, - const std::vector>& matrix) { + std::vector>& matrix) { std::vector> valueMatrix; valueMatrix.reserve(matrix.size()); for (auto& row : matrix) {