diff --git a/cmake/DARTFindDependencies.cmake b/cmake/DARTFindDependencies.cmake index 9e631d3a35aa2..1c05ff10f427a 100644 --- a/cmake/DARTFindDependencies.cmake +++ b/cmake/DARTFindDependencies.cmake @@ -106,6 +106,9 @@ else() ) endif() +# Taskflow +dart_find_package(Taskflow) + #======================= # Optional dependencies #======================= diff --git a/cmake/DARTFindTaskflow.cmake b/cmake/DARTFindTaskflow.cmake new file mode 100644 index 0000000000000..ddc3eeda29e70 --- /dev/null +++ b/cmake/DARTFindTaskflow.cmake @@ -0,0 +1,9 @@ +# Copyright (c) 2011-2024, The DART development contributors +# All rights reserved. +# +# The list of contributors can be found at: +# https://github.com/dartsim/dart/blob/main/LICENSE +# +# This file is provided under the "BSD-style" License + +find_package(Taskflow) diff --git a/dart/CMakeLists.txt b/dart/CMakeLists.txt index 6a0a14bf3484a..e067ec79fe25b 100644 --- a/dart/CMakeLists.txt +++ b/dart/CMakeLists.txt @@ -222,6 +222,20 @@ if(spdlog_FOUND) add_component_dependency_packages(${PROJECT_NAME} dart spdlog) endif() +# Taskflow settings +if(Taskflow_FOUND) + if(TARGET spdlog::spdlog_header_only) + add_component_dependency_packages(${PROJECT_NAME} dart Taskflow) + target_link_libraries(dart PUBLIC Taskflow::Taskflow) + target_compile_definitions(dart PUBLIC -DDART_HAVE_Taskflow=1) + else() + message(WARNING "Taskflow found, but no target is found. Expected Taskflow::Taskflow") + target_compile_definitions(dart PUBLIC -DDART_HAVE_Taskflow=0) + endif() +else() + target_compile_definitions(dart PUBLIC -DDART_HAVE_Taskflow=0) +endif() + if(MSVC) set_target_properties( dart PROPERTIES diff --git a/dart/constraint/BoxedLcpConstraintSolver.cpp b/dart/constraint/BoxedLcpConstraintSolver.cpp index c455b3416af62..f23fb47984141 100644 --- a/dart/constraint/BoxedLcpConstraintSolver.cpp +++ b/dart/constraint/BoxedLcpConstraintSolver.cpp @@ -32,13 +32,7 @@ #include "dart/constraint/BoxedLcpConstraintSolver.hpp" -#include -#if DART_BUILD_MODE_DEBUG - #include - #include -#endif - -#include "dart/common/Console.hpp" +#include "dart/common/Logging.hpp" #include "dart/common/Profile.hpp" #include "dart/constraint/ConstraintBase.hpp" #include "dart/constraint/DantzigBoxedLcpSolver.hpp" @@ -46,66 +40,285 @@ #include "dart/external/odelcpsolver/lcp.h" #include "dart/lcpsolver/Lemke.hpp" +#if DART_HAVE_Taskflow + #include +#endif + +#if DART_BUILD_MODE_DEBUG + #include + #include +#endif +#include +#include +#include + +#include + namespace dart { namespace constraint { +namespace { + +[[nodiscard]] BoxedLcpSolverPtr createBoxedLcpSolver( + const BoxedLcpSolverType type) +{ + switch (type) { + case BoxedLcpSolverType::Dantzig: { + return std::make_shared(); + } + case BoxedLcpSolverType::Pgs: { + return std::make_shared(); + } + default: { + DART_WARN("Unknown BoxedLcpSolverType. Using Dantzig solver instead."); + return std::make_shared(); + } + } +} + +#if DART_BUILD_MODE_DEBUG +bool isSymmetric(std::size_t n, double* A) +{ + std::size_t nSkip = dPAD(n); + for (std::size_t i = 0; i < n; ++i) { + for (std::size_t j = 0; j < n; ++j) { + if (std::abs(A[nSkip * i + j] - A[nSkip * j + i]) > 1e-6) { + std::cout << "A: " << std::endl; + for (std::size_t k = 0; k < n; ++k) { + for (std::size_t l = 0; l < nSkip; ++l) { + std::cout << std::setprecision(4) << A[k * nSkip + l] << " "; + } + std::cout << std::endl; + } + + std::cout << "A(" << i << ", " << j << "): " << A[nSkip * i + j] + << std::endl; + std::cout << "A(" << j << ", " << i << "): " << A[nSkip * j + i] + << std::endl; + return false; + } + } + } + + return true; +} + +//============================================================================== +bool isSymmetric(std::size_t n, double* A, std::size_t begin, std::size_t end) +{ + std::size_t nSkip = dPAD(n); + for (std::size_t i = begin; i <= end; ++i) { + for (std::size_t j = begin; j <= end; ++j) { + if (std::abs(A[nSkip * i + j] - A[nSkip * j + i]) > 1e-6) { + std::cout << "A: " << std::endl; + for (std::size_t k = 0; k < n; ++k) { + for (std::size_t l = 0; l < nSkip; ++l) { + std::cout << std::setprecision(4) << A[k * nSkip + l] << " "; + } + std::cout << std::endl; + } + + std::cout << "A(" << i << ", " << j << "): " << A[nSkip * i + j] + << std::endl; + std::cout << "A(" << j << ", " << i << "): " << A[nSkip * j + i] + << std::endl; + return false; + } + } + } + + return true; +} + +//============================================================================== +void print( + std::size_t n, + double* A, + double* x, + double* /*lo*/, + double* /*hi*/, + double* b, + double* w, + int* findex) +{ + std::size_t nSkip = dPAD(n); + std::cout << "A: " << std::endl; + for (std::size_t i = 0; i < n; ++i) { + for (std::size_t j = 0; j < nSkip; ++j) { + std::cout << std::setprecision(4) << A[i * nSkip + j] << " "; + } + std::cout << std::endl; + } + + std::cout << "b: "; + for (std::size_t i = 0; i < n; ++i) { + std::cout << std::setprecision(4) << b[i] << " "; + } + std::cout << std::endl; + + std::cout << "w: "; + for (std::size_t i = 0; i < n; ++i) { + std::cout << w[i] << " "; + } + std::cout << std::endl; + + std::cout << "x: "; + for (std::size_t i = 0; i < n; ++i) { + std::cout << x[i] << " "; + } + std::cout << std::endl; + + // std::cout << "lb: "; + // for (int i = 0; i < dim; ++i) + // { + // std::cout << lb[i] << " "; + // } + // std::cout << std::endl; + + // std::cout << "ub: "; + // for (int i = 0; i < dim; ++i) + // { + // std::cout << ub[i] << " "; + // } + // std::cout << std::endl; + + std::cout << "frictionIndex: "; + for (std::size_t i = 0; i < n; ++i) { + std::cout << findex[i] << " "; + } + std::cout << std::endl; + + double* Ax = new double[n]; + + for (std::size_t i = 0; i < n; ++i) { + Ax[i] = 0.0; + } + + for (std::size_t i = 0; i < n; ++i) { + for (std::size_t j = 0; j < n; ++j) { + Ax[i] += A[i * nSkip + j] * x[j]; + } + } + + std::cout << "Ax : "; + for (std::size_t i = 0; i < n; ++i) { + std::cout << Ax[i] << " "; + } + std::cout << std::endl; + + std::cout << "b + w: "; + for (std::size_t i = 0; i < n; ++i) { + std::cout << b[i] + w[i] << " "; + } + std::cout << std::endl; + + delete[] Ax; +} +#endif + +} // namespace + //============================================================================== +DART_SUPPRESS_DEPRECATED_BEGIN BoxedLcpConstraintSolver::BoxedLcpConstraintSolver( double timeStep, BoxedLcpSolverPtr boxedLcpSolver, BoxedLcpSolverPtr secondaryBoxedLcpSolver) : BoxedLcpConstraintSolver( - std::move(boxedLcpSolver), std::move(secondaryBoxedLcpSolver)) + std::move(boxedLcpSolver), std::move(secondaryBoxedLcpSolver)) { setTimeStep(timeStep); } +DART_SUPPRESS_DEPRECATED_END //============================================================================== -BoxedLcpConstraintSolver::BoxedLcpConstraintSolver() - : BoxedLcpConstraintSolver(std::make_shared()) +BoxedLcpConstraintSolver::BoxedLcpConstraintSolver(const Config& config) +#if DART_HAVE_Taskflow + : ConstraintSolver(), mConfig(config), mExecutor(4) +#else + : ConstraintSolver(), mConfig(config) +#endif { - // Do nothing + // Empty } //============================================================================== +DART_SUPPRESS_DEPRECATED_BEGIN BoxedLcpConstraintSolver::BoxedLcpConstraintSolver( BoxedLcpSolverPtr boxedLcpSolver) : BoxedLcpConstraintSolver( - std::move(boxedLcpSolver), std::make_shared()) + std::move(boxedLcpSolver), std::make_shared()) { // Do nothing } +DART_SUPPRESS_DEPRECATED_END //============================================================================== +DART_SUPPRESS_DEPRECATED_BEGIN BoxedLcpConstraintSolver::BoxedLcpConstraintSolver( BoxedLcpSolverPtr boxedLcpSolver, BoxedLcpSolverPtr secondaryBoxedLcpSolver) +#if DART_HAVE_Taskflow + : ConstraintSolver(), mExecutor(4) +#else : ConstraintSolver() +#endif { if (boxedLcpSolver) { setBoxedLcpSolver(std::move(boxedLcpSolver)); } else { - dtwarn << "[BoxedLcpConstraintSolver] Attempting to construct with nullptr " - << "LCP solver, which is not allowed. Using Dantzig solver " - << "instead.\n"; + DART_WARN( + "[BoxedLcpConstraintSolver] Attempting to construct with nullptr LCP " + "solver, which is not allowed. Using Dantzig solver instead."); setBoxedLcpSolver(std::make_shared()); } setSecondaryBoxedLcpSolver(std::move(secondaryBoxedLcpSolver)); } +DART_SUPPRESS_DEPRECATED_END + +//============================================================================== +void BoxedLcpConstraintSolver::setPrimaryBoxedLcpSolverType( + BoxedLcpSolverType type) +{ + mConfig.primaryBoxedLcpSolver = type; +} + +//============================================================================== +BoxedLcpSolverType BoxedLcpConstraintSolver::getPrimaryBoxedLcpSolverType() + const +{ + return mConfig.primaryBoxedLcpSolver; +} + +//============================================================================== +void BoxedLcpConstraintSolver::setSecondaryBoxedLcpSolverType( + BoxedLcpSolverType type) +{ + mConfig.secondaryBoxedLcpSolver = type; +} + +//============================================================================== +BoxedLcpSolverType BoxedLcpConstraintSolver::getSecondaryBoxedLcpSolverType() + const +{ + return mConfig.secondaryBoxedLcpSolver; +} //============================================================================== void BoxedLcpConstraintSolver::setBoxedLcpSolver(BoxedLcpSolverPtr lcpSolver) { if (!lcpSolver) { - dtwarn << "[BoxedLcpConstraintSolver::setBoxedLcpSolver] " - << "nullptr for boxed LCP solver is not allowed.\n"; + DART_WARN( + "[BoxedLcpConstraintSolver::setBoxedLcpSolver] nullptr for boxed LCP " + "solver is not allowed."); return; } if (lcpSolver == mSecondaryBoxedLcpSolver) { - dtwarn << "[BoxedLcpConstraintSolver::setBoxedLcpSolver] Attempting to set " - << "a primary LCP solver that is the same with the secondary LCP " - << "solver, which is discouraged. Ignoring this request.\n"; + DART_WARN( + "[BoxedLcpConstraintSolver::setBoxedLcpSolver] Attempting to set a " + "primary LCP solver that is the same with the secondary LCP solver, " + "which is discouraged. Ignoring this request."); } mBoxedLcpSolver = std::move(lcpSolver); @@ -122,10 +335,11 @@ void BoxedLcpConstraintSolver::setSecondaryBoxedLcpSolver( BoxedLcpSolverPtr lcpSolver) { if (lcpSolver == mBoxedLcpSolver) { - dtwarn << "[BoxedLcpConstraintSolver::setBoxedLcpSolver] Attempting to set " - << "the secondary LCP solver that is identical to the primary LCP " - << "solver, which is redundant. Please use different solvers or set " - << "the secondary LCP solver to nullptr.\n"; + DART_WARN( + "[BoxedLcpConstraintSolver::setSecondaryBoxedLcpSolver] Attempting " + "to set the secondary LCP solver that is identical to the primary " + "LCP solver, which is redundant. Please use different solvers or " + "set the secondary LCP solver to nullptr."); } mSecondaryBoxedLcpSolver = std::move(lcpSolver); @@ -139,54 +353,70 @@ ConstBoxedLcpSolverPtr BoxedLcpConstraintSolver::getSecondaryBoxedLcpSolver() } //============================================================================== -void BoxedLcpConstraintSolver::solveConstrainedGroup(ConstrainedGroup& group) +void solveBoxedLcp(BoxedLcp& lcp, ConstrainedGroup& group) { DART_PROFILE_SCOPED; + (void)lcp; + (void)group; // Build LCP terms by aggregating them from constraints const std::size_t numConstraints = group.getNumConstraints(); const std::size_t n = group.getTotalDimension(); // If there is no constraint, then just return. - if (0u == n) + if (0u == n) { return; + } + + auto& mA = lcp.A; + auto& mABackup = lcp.ABackup; + auto& mX = lcp.x; + auto& mXBackup = lcp.xBackup; + auto& mB = lcp.b; + auto& mBBackup = lcp.bBackup; + // auto& mW = lcp.w; + auto& mLo = lcp.lo; + auto& mLoBackup = lcp.loBackup; + auto& mHi = lcp.hi; + auto& mHiBackup = lcp.hiBackup; + auto& mFIndex = lcp.fIndex; + auto& mFIndexBackup = lcp.fIndexBackup; + auto& mOffset = lcp.offset; + auto& mBoxedLcpSolver = lcp.boxedLcpSolver; + auto& mSecondaryBoxedLcpSolver = lcp.secondaryBoxedLcpSolver; const int nSkip = dPAD(n); -#if DART_BUILD_MODE_RELEASE - mA.resize(n, nSkip); -#else // debug - mA.setZero(n, nSkip); -#endif - mX.resize(n); - mB.resize(n); - mW.setZero(n); // set w to 0 - mLo.resize(n); - mHi.resize(n); - mFIndex.setConstant(n, -1); // set findex to -1 + lcp.A.resize(n, nSkip); + lcp.x.resize(n); + lcp.b.resize(n); + lcp.w.setZero(n); + lcp.lo.resize(n); + lcp.hi.resize(n); + lcp.fIndex.setConstant(n, -1); // Compute offset indices - mOffset.resize(numConstraints); - mOffset[0] = 0; + lcp.offset.resize(numConstraints); + lcp.offset[0] = 0; for (std::size_t i = 1; i < numConstraints; ++i) { - const ConstraintBasePtr& constraint = group.getConstraint(i - 1); + const auto constraint = group.getConstraint(i - 1); assert(constraint->getDimension() > 0); - mOffset[i] = mOffset[i - 1] + constraint->getDimension(); + lcp.offset[i] = lcp.offset[i - 1] + constraint->getDimension(); } // For each constraint { DART_PROFILE_SCOPED_N("Construct LCP"); ConstraintInfo constInfo; - constInfo.invTimeStep = 1.0 / mTimeStep; + constInfo.invTimeStep = 1.0 / lcp.timeStep; for (std::size_t i = 0; i < numConstraints; ++i) { - const ConstraintBasePtr& constraint = group.getConstraint(i); + const auto constraint = group.getConstraint(i); - constInfo.x = mX.data() + mOffset[i]; - constInfo.lo = mLo.data() + mOffset[i]; - constInfo.hi = mHi.data() + mOffset[i]; - constInfo.b = mB.data() + mOffset[i]; - constInfo.findex = mFIndex.data() + mOffset[i]; - constInfo.w = mW.data() + mOffset[i]; + constInfo.x = lcp.x.data() + lcp.offset[i]; + constInfo.lo = lcp.lo.data() + lcp.offset[i]; + constInfo.hi = lcp.hi.data() + lcp.offset[i]; + constInfo.b = lcp.b.data() + lcp.offset[i]; + constInfo.findex = lcp.fIndex.data() + lcp.offset[i]; + constInfo.w = lcp.w.data() + lcp.offset[i]; // Fill vectors: lo, hi, b, w { @@ -200,8 +430,9 @@ void BoxedLcpConstraintSolver::solveConstrainedGroup(ConstrainedGroup& group) constraint->excite(); for (std::size_t j = 0; j < constraint->getDimension(); ++j) { // Adjust findex for global index - if (mFIndex[mOffset[i] + j] >= 0) - mFIndex[mOffset[i] + j] += mOffset[i]; + if (lcp.fIndex[lcp.offset[i] + j] >= 0) { + lcp.fIndex[lcp.offset[i] + j] += lcp.offset[i]; + } // Apply impulse for impulse test { @@ -212,10 +443,10 @@ void BoxedLcpConstraintSolver::solveConstrainedGroup(ConstrainedGroup& group) // Fill upper triangle blocks of A matrix { DART_PROFILE_SCOPED_N("Fill upper triangle of A"); - int index = nSkip * (mOffset[i] + j) + mOffset[i]; + int index = nSkip * (lcp.offset[i] + j) + lcp.offset[i]; constraint->getVelocityChange(mA.data() + index, true); for (std::size_t k = i + 1; k < numConstraints; ++k) { - index = nSkip * (mOffset[i] + j) + mOffset[k]; + index = nSkip * (lcp.offset[i] + j) + lcp.offset[k]; group.getConstraint(k)->getVelocityChange( mA.data() + index, false); } @@ -271,8 +502,9 @@ void BoxedLcpConstraintSolver::solveConstrainedGroup(ConstrainedGroup& group) // Sanity check. LCP solvers should not report success with nan values, but // it could happen. So we set the success to false for nan values. - if (success && mX.hasNaN()) + if (success && mX.hasNaN()) { success = false; + } if (!success && mSecondaryBoxedLcpSolver) { DART_PROFILE_SCOPED_N("Secondary LCP"); @@ -315,146 +547,47 @@ void BoxedLcpConstraintSolver::solveConstrainedGroup(ConstrainedGroup& group) } //============================================================================== -#if DART_BUILD_MODE_DEBUG -bool BoxedLcpConstraintSolver::isSymmetric(std::size_t n, double* A) +void BoxedLcpConstraintSolver::solveConstrainedGroups() { - std::size_t nSkip = dPAD(n); - for (std::size_t i = 0; i < n; ++i) { - for (std::size_t j = 0; j < n; ++j) { - if (std::abs(A[nSkip * i + j] - A[nSkip * j + i]) > 1e-6) { - std::cout << "A: " << std::endl; - for (std::size_t k = 0; k < n; ++k) { - for (std::size_t l = 0; l < nSkip; ++l) { - std::cout << std::setprecision(4) << A[k * nSkip + l] << " "; - } - std::cout << std::endl; - } - - std::cout << "A(" << i << ", " << j << "): " << A[nSkip * i + j] - << std::endl; - std::cout << "A(" << j << ", " << i << "): " << A[nSkip * j + i] - << std::endl; - return false; - } - } - } - - return true; -} + DART_PROFILE_SCOPED; -//============================================================================== -bool BoxedLcpConstraintSolver::isSymmetric( - std::size_t n, double* A, std::size_t begin, std::size_t end) -{ - std::size_t nSkip = dPAD(n); - for (std::size_t i = begin; i <= end; ++i) { - for (std::size_t j = begin; j <= end; ++j) { - if (std::abs(A[nSkip * i + j] - A[nSkip * j + i]) > 1e-6) { - std::cout << "A: " << std::endl; - for (std::size_t k = 0; k < n; ++k) { - for (std::size_t l = 0; l < nSkip; ++l) { - std::cout << std::setprecision(4) << A[k * nSkip + l] << " "; - } - std::cout << std::endl; - } + const int numGroups = mConstrainedGroups.size(); - std::cout << "A(" << i << ", " << j << "): " << A[nSkip * i + j] - << std::endl; - std::cout << "A(" << j << ", " << i << "): " << A[nSkip * j + i] - << std::endl; - return false; + // Prepare problems + { + DART_PROFILE_SCOPED_N("Prepare problems"); + mProblems.resize(numGroups); + for (auto& prob : mProblems) { + if (!prob.boxedLcpSolver) { + prob.boxedLcpSolver + = createBoxedLcpSolver(mConfig.primaryBoxedLcpSolver); } - } - } - return true; -} - -//============================================================================== -void BoxedLcpConstraintSolver::print( - std::size_t n, - double* A, - double* x, - double* /*lo*/, - double* /*hi*/, - double* b, - double* w, - int* findex) -{ - std::size_t nSkip = dPAD(n); - std::cout << "A: " << std::endl; - for (std::size_t i = 0; i < n; ++i) { - for (std::size_t j = 0; j < nSkip; ++j) { - std::cout << std::setprecision(4) << A[i * nSkip + j] << " "; - } - std::cout << std::endl; - } - - std::cout << "b: "; - for (std::size_t i = 0; i < n; ++i) { - std::cout << std::setprecision(4) << b[i] << " "; - } - std::cout << std::endl; - - std::cout << "w: "; - for (std::size_t i = 0; i < n; ++i) { - std::cout << w[i] << " "; - } - std::cout << std::endl; - - std::cout << "x: "; - for (std::size_t i = 0; i < n; ++i) { - std::cout << x[i] << " "; - } - std::cout << std::endl; - - // std::cout << "lb: "; - // for (int i = 0; i < dim; ++i) - // { - // std::cout << lb[i] << " "; - // } - // std::cout << std::endl; - - // std::cout << "ub: "; - // for (int i = 0; i < dim; ++i) - // { - // std::cout << ub[i] << " "; - // } - // std::cout << std::endl; - - std::cout << "frictionIndex: "; - for (std::size_t i = 0; i < n; ++i) { - std::cout << findex[i] << " "; - } - std::cout << std::endl; - - double* Ax = new double[n]; - - for (std::size_t i = 0; i < n; ++i) { - Ax[i] = 0.0; - } + if (!prob.secondaryBoxedLcpSolver) { + prob.secondaryBoxedLcpSolver + = createBoxedLcpSolver(mConfig.secondaryBoxedLcpSolver); + } - for (std::size_t i = 0; i < n; ++i) { - for (std::size_t j = 0; j < n; ++j) { - Ax[i] += A[i * nSkip + j] * x[j]; + prob.timeStep = mTimeStep; } } - std::cout << "Ax : "; - for (std::size_t i = 0; i < n; ++i) { - std::cout << Ax[i] << " "; - } - std::cout << std::endl; - - std::cout << "b + w: "; - for (std::size_t i = 0; i < n; ++i) { - std::cout << b[i] + w[i] << " "; + // Solve problems + { + DART_PROFILE_SCOPED_N("Solve problems"); +#if DART_HAVE_Taskflow + tf::Taskflow mTaskflow; + mTaskflow.for_each_index(0, numGroups, 1, [&](int i) { + solveBoxedLcp(mProblems[i], mConstrainedGroups[i]); + }); + mExecutor.run(mTaskflow).wait(); +#else + for (auto i = 0u; i < mProblems.size(); ++i) { + solveBoxedLcp(mProblems[i], mConstrainedGroups[i]); + }; +#endif } - std::cout << std::endl; - - delete[] Ax; } -#endif } // namespace constraint } // namespace dart diff --git a/dart/constraint/BoxedLcpConstraintSolver.hpp b/dart/constraint/BoxedLcpConstraintSolver.hpp index 7d9ff613c9134..65929da9672fa 100644 --- a/dart/constraint/BoxedLcpConstraintSolver.hpp +++ b/dart/constraint/BoxedLcpConstraintSolver.hpp @@ -36,12 +36,86 @@ #include #include +#if DART_HAVE_Taskflow + #include +#endif + namespace dart { namespace constraint { +struct BoxedLcp +{ + using RowMajorMatrixXd + = Eigen::Matrix; + + /// Cache data for boxed LCP formulation + RowMajorMatrixXd A; + + /// Cache data for boxed LCP formulation + RowMajorMatrixXd ABackup; + + /// Cache data for boxed LCP formulation + Eigen::VectorXd x; + + /// Cache data for boxed LCP formulation + Eigen::VectorXd xBackup; + + /// Cache data for boxed LCP formulation + Eigen::VectorXd b; + + /// Cache data for boxed LCP formulation + Eigen::VectorXd bBackup; + + /// Cache data for boxed LCP formulation + Eigen::VectorXd w; + + /// Cache data for boxed LCP formulation + Eigen::VectorXd lo; + + /// Cache data for boxed LCP formulation + Eigen::VectorXd loBackup; + + /// Cache data for boxed LCP formulation + Eigen::VectorXd hi; + + /// Cache data for boxed LCP formulation + Eigen::VectorXd hiBackup; + + /// Cache data for boxed LCP formulation + Eigen::VectorXi fIndex; + + /// Cache data for boxed LCP formulation + Eigen::VectorXi fIndexBackup; + + /// Cache data for boxed LCP formulation + Eigen::VectorXi offset; + + /// Boxed LCP solver + BoxedLcpSolverPtr boxedLcpSolver; + + /// Boxed LCP solver to be used when the primary solver failed + BoxedLcpSolverPtr secondaryBoxedLcpSolver; + + double timeStep{-1}; +}; + +enum class BoxedLcpSolverType +{ + Dantzig, ///< The Dantzig solver + Pgs, ///< The projected Gauss-Seidel solver +}; + +struct BoxedLcpConstraintSolverConfig +{ + BoxedLcpSolverType primaryBoxedLcpSolver = BoxedLcpSolverType::Dantzig; + BoxedLcpSolverType secondaryBoxedLcpSolver = BoxedLcpSolverType::Pgs; +}; + class BoxedLcpConstraintSolver : public ConstraintSolver { public: + using Config = BoxedLcpConstraintSolverConfig; + /// Constructor /// /// \param[in] timeStep Simulation time step @@ -51,25 +125,22 @@ class BoxedLcpConstraintSolver : public ConstraintSolver /// nullptr is passed, PGS solver will be used. This is to make the default /// solver setting to be Dantzig + PGS. In order to disable use of secondary /// solver, call setSecondaryBoxedLcpSolver(nullptr) explicitly. - /// - /// \deprecated Deprecated in DART 6.8. Please use other constructors that - /// doesn't take timespte. Timestep should be set by the owner of this solver - /// such as dart::simulation::World when the solver added. - DART_DEPRECATED(6.8) - BoxedLcpConstraintSolver( - double timeStep, - BoxedLcpSolverPtr boxedLcpSolver = nullptr, - BoxedLcpSolverPtr secondaryBoxedLcpSolver = nullptr); - - /// Constructs with default primary and secondary LCP solvers, which are - /// Dantzig and PGS, respectively. - BoxedLcpConstraintSolver(); + [[deprecated( + "Since DART 6.14. Please use other constructor that takes config " + "struct instead.")]] BoxedLcpConstraintSolver(double timeStep, BoxedLcpSolverPtr boxedLcpSolver = nullptr, BoxedLcpSolverPtr secondaryBoxedLcpSolver = nullptr); + + /// Constructs with specific primary and secondary LCP solvers, which are + /// specified by the config struct. + explicit BoxedLcpConstraintSolver(const Config& config = Config()); /// Constructors with specific primary LCP solver. /// /// \param[in] boxedLcpSolver The primary boxed LCP solver. When nullptr is /// passed, which is discouraged, Dantzig solver will be used. - BoxedLcpConstraintSolver(BoxedLcpSolverPtr boxedLcpSolver); + [[deprecated( + "Since DART 6.14. Please use other constructor that takes config " + "struct instead.")]] BoxedLcpConstraintSolver(BoxedLcpSolverPtr + boxedLcpSolver); /// Constructs with specific primary and secondary LCP solvers. /// @@ -77,29 +148,54 @@ class BoxedLcpConstraintSolver : public ConstraintSolver /// passed, which is discouraged, Dantzig solver will be used. /// \param[in] secondaryBoxedLcpSolver The secondary boxed-LCP solver. Pass /// nullptr to disable using secondary LCP solver. - BoxedLcpConstraintSolver( - BoxedLcpSolverPtr boxedLcpSolver, - BoxedLcpSolverPtr secondaryBoxedLcpSolver); + [[deprecated( + "Since DART 6.14. Please use other constructor that takes config " + "struct instead.")]] BoxedLcpConstraintSolver(BoxedLcpSolverPtr boxedLcpSolver, BoxedLcpSolverPtr secondaryBoxedLcpSolver); + + /// Sets the primary boxed LCP solver type + void setPrimaryBoxedLcpSolverType(BoxedLcpSolverType type); + + /// Returns the primary boxed LCP solver type + [[nodiscard]] BoxedLcpSolverType getPrimaryBoxedLcpSolverType() const; + + /// Sets the secondary boxed LCP solver type + void setSecondaryBoxedLcpSolverType(BoxedLcpSolverType type); + + /// Returns the secondary boxed LCP solver type + [[nodiscard]] BoxedLcpSolverType getSecondaryBoxedLcpSolverType() const; /// Sets boxed LCP (BLCP) solver /// /// \param[in] lcpSolver The primary boxed LCP solver. When nullptr is /// passed, Dantzig solver will be used. - void setBoxedLcpSolver(BoxedLcpSolverPtr lcpSolver); + [[deprecated( + "Since DART 6.14. Please use setPrimaryBoxedLcpSolverType() " + "instead.")]] void + setBoxedLcpSolver(BoxedLcpSolverPtr lcpSolver); /// Returns boxed LCP (BLCP) solver - ConstBoxedLcpSolverPtr getBoxedLcpSolver() const; + [[deprecated( + "Since DART 6.14. Please use getPrimaryBoxedLcpSolverType() " + "instead.")]] ConstBoxedLcpSolverPtr + getBoxedLcpSolver() const; /// Sets boxed LCP (BLCP) solver that is used when the primary solver failed - void setSecondaryBoxedLcpSolver(BoxedLcpSolverPtr lcpSolver); + [[deprecated( + "Since DART 6.14. Please use setSecondaryBoxedLcpSolverType() " + "instead.")]] void + setSecondaryBoxedLcpSolver(BoxedLcpSolverPtr lcpSolver); /// Returns boxed LCP (BLCP) solver that is used when the primary solver /// failed - ConstBoxedLcpSolverPtr getSecondaryBoxedLcpSolver() const; + [[deprecated( + "Since DART 6.14. Please use getSecondaryBoxedLcpSolverType() " + "instead.")]] ConstBoxedLcpSolverPtr + getSecondaryBoxedLcpSolver() const; protected: - // Documentation inherited. - void solveConstrainedGroup(ConstrainedGroup& group) override; + void solveConstrainedGroups() override; + + Config mConfig; /// Boxed LCP solver BoxedLcpSolverPtr mBoxedLcpSolver; @@ -154,25 +250,10 @@ class BoxedLcpConstraintSolver : public ConstraintSolver /// Cache data for boxed LCP formulation Eigen::VectorXi mOffset; -#if DART_BUILD_MODE_DEBUG -private: - /// Return true if the matrix is symmetric - bool isSymmetric(std::size_t n, double* A); - - /// Return true if the diagonal block of matrix is symmetric - bool isSymmetric( - std::size_t n, double* A, std::size_t begin, std::size_t end); - - /// Print debug information - void print( - std::size_t n, - double* A, - double* x, - double* lo, - double* hi, - double* b, - double* w, - int* findex); + std::vector mProblems; + +#if DART_HAVE_Taskflow + tf::Executor mExecutor; #endif }; diff --git a/dart/constraint/ConstraintSolver.cpp b/dart/constraint/ConstraintSolver.cpp index 7f3331c535412..c36c6b123d134 100644 --- a/dart/constraint/ConstraintSolver.cpp +++ b/dart/constraint/ConstraintSolver.cpp @@ -697,7 +697,9 @@ void ConstraintSolver::solveConstrainedGroups() DART_PROFILE_SCOPED; for (auto& constraintGroup : mConstrainedGroups) { + DART_SUPPRESS_DEPRECATED_BEGIN solveConstrainedGroup(constraintGroup); + DART_SUPPRESS_DEPRECATED_END } } diff --git a/dart/constraint/ConstraintSolver.hpp b/dart/constraint/ConstraintSolver.hpp index 4935eb5ffda98..d11ab755af6fc 100644 --- a/dart/constraint/ConstraintSolver.hpp +++ b/dart/constraint/ConstraintSolver.hpp @@ -235,8 +235,12 @@ class ConstraintSolver bool removeContactSurfaceHandler(const ContactSurfaceHandlerPtr& handler); protected: - // TODO(JS): Docstring - virtual void solveConstrainedGroup(ConstrainedGroup& group) = 0; + [[deprecated( + "Since DART 6.14. Use solveConstrainedGroups() instead.")]] virtual void + solveConstrainedGroup(ConstrainedGroup& group) + { + (void)group; + } /// Checks if the skeleton is contained in this solver /// @@ -263,7 +267,7 @@ class ConstraintSolver void buildConstrainedGroups(); /// Solve constrained groups - void solveConstrainedGroups(); + virtual void solveConstrainedGroups(); /// Return true if at least one of colliding body is soft body bool isSoftContact(const collision::Contact& contact) const; diff --git a/docker/dev/v6.14/Dockerfile.ubuntu.noble b/docker/dev/v6.14/Dockerfile.ubuntu.noble index 8882bfd8b3886..16b836134a958 100644 --- a/docker/dev/v6.14/Dockerfile.ubuntu.noble +++ b/docker/dev/v6.14/Dockerfile.ubuntu.noble @@ -33,7 +33,8 @@ RUN apt-get install -y --no-install-recommends \ libassimp-dev \ libeigen3-dev \ libfcl-dev \ - libfmt-dev + libfmt-dev \ + libtaskflow-cpp-dev # ============================================================================== # DART optional dependencies diff --git a/docker/dev/v6.14/Dockerfile.ubuntu.oracular b/docker/dev/v6.14/Dockerfile.ubuntu.oracular index 4c47e6eabe778..a4fa6ba0cfd36 100644 --- a/docker/dev/v6.14/Dockerfile.ubuntu.oracular +++ b/docker/dev/v6.14/Dockerfile.ubuntu.oracular @@ -33,7 +33,8 @@ RUN apt-get install -y --no-install-recommends \ libassimp-dev \ libeigen3-dev \ libfcl-dev \ - libfmt-dev + libfmt-dev \ + libtaskflow-cpp-dev # ============================================================================== # DART optional dependencies diff --git a/pixi.lock b/pixi.lock index 07e158cdf1010..b6c4d935970a5 100644 --- a/pixi.lock +++ b/pixi.lock @@ -71,22 +71,22 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.9.0-22_linux64_openblas.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libccd-double-2.1-h59595ed_3.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libclang-cpp14-14.0.6-default_h7634d5b_1.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.8.0-hca28451_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.8.0-hca28451_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.20-hd590300_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/libdrm-2.4.121-h4ab18f5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libdrm-2.4.122-h4ab18f5_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20191231-he28a2e2_2.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.6.2-h59595ed_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.4.2-h7f98852_5.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/libflac-1.4.3-h59595ed_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-13.2.0-h77fa898_13.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-14.1.0-h77fa898_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcrypt-1.11.0-h4ab18f5_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libgettextpo-0.22.5-h59595ed_2.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libgettextpo-devel-0.22.5-h59595ed_2.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-13.2.0-h69a702a_13.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-13.2.0-h3d2ce59_13.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-14.1.0-h69a702a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-14.1.0-hc5f4f2c_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libglib-2.80.2-hf974151_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-13.2.0-h77fa898_13.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-14.1.0-h77fa898_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libgpg-error-1.50-h4f305b6_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libhwloc-2.10.0-default_h5622ce7_1001.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libiconv-1.17-hd590300_2.conda @@ -107,7 +107,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/libspral-2024.05.08-h1b93dcb_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.46.0-hde9e2c9_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libssh2-1.11.0-h0841786_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-13.2.0-hc0a3c3a_13.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-14.1.0-hc0a3c3a_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libsystemd0-255-h3516f8a_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libtasn1-4.19.0-h166bdaf_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/linux-64/libtiff-4.6.0-h1dd3fc0_3.conda @@ -161,6 +161,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-69.1.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/spdlog-1.12.0-hd2e6256_2.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/svt-av1-1.4.1-hcb278e6_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/taskflow-3.7.0-h297d8ca_3.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/tbb-2021.12.0-h297d8ca_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/tbb-devel-2021.12.0-h7c56ddd_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/tinyxml2-10.0.0-h59595ed_0.conda @@ -259,7 +260,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-64/libcblas-3.9.0-22_osx64_openblas.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/libccd-double-2.1-he965462_3.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/libclang-cpp14-14.0.6-default_hdb78580_1.conda - - conda: https://conda.anaconda.org/conda-forge/osx-64/libcurl-8.8.0-hf9fcc65_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-64/libcurl-8.8.0-hf9fcc65_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/libcxx-17.0.6-h88467a6_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/libdeflate-1.20-h49d49c5_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/libedit-3.1.20191231-h0678c8f_2.tar.bz2 @@ -330,6 +331,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-69.1.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/spdlog-1.12.0-h8dd852c_2.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/svt-av1-1.4.1-hf0c8a7f_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-64/taskflow-3.7.0-h3c5361c_3.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/tbb-2021.12.0-h3c5361c_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/tbb-devel-2021.12.0-h7393e1e_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/tinyxml2-10.0.0-h73e2aa4_0.conda @@ -412,7 +414,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libcblas-3.9.0-22_osxarm64_openblas.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libccd-double-2.1-h9a09cb3_2.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libclang-cpp14-14.0.6-default_h5dc8d65_1.conda - - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libcurl-8.8.0-h7b6f9a7_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libcurl-8.8.0-h7b6f9a7_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libcxx-17.0.6-h5f092b4_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libdeflate-1.20-h93a5062_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libedit-3.1.20191231-hc8eb9b7_2.tar.bz2 @@ -485,6 +487,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-69.1.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/spdlog-1.12.0-he64bfa9_2.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/svt-av1-1.4.1-h7ea286d_0.conda + - conda: https://conda.anaconda.org/conda-forge/osx-arm64/taskflow-3.7.0-h420ef59_3.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tbb-2021.12.0-h420ef59_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tbb-devel-2021.12.0-h94f16c5_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tinyxml2-10.0.0-hebf3989_0.conda @@ -539,7 +542,9 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/fonts-conda-forge-1-0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/win-64/freeglut-3.2.2-he0c23c2_3.conda - conda: https://conda.anaconda.org/conda-forge/win-64/freetype-2.12.1-hdaf720e_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/glfw-3.4-hcfcfb64_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/hdf5-1.14.3-nompi_h2b43c12_105.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/imgui-1.90.8-hecf2515_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/iniconfig-2.0.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/intel-openmp-2024.1.0-h57928b3_966.conda - conda: https://conda.anaconda.org/conda-forge/win-64/ipopt-3.14.16-ha3daec3_4.conda @@ -555,7 +560,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/win-64/libboost-python-devel-1.84.0-py312h7e22eef_3.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libcblas-3.9.0-22_win64_mkl.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libccd-double-2.1-h63175ca_3.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/libcurl-8.8.0-hd5e4a3a_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libcurl-8.8.0-hd5e4a3a_1.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libdeflate-1.20-hcfcfb64_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libexpat-2.6.2-h63175ca_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libffi-3.4.2-h8ffe710_5.tar.bz2 @@ -602,9 +607,11 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-8.1.2-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/python-3.12.4-h889d299_0_cpython.conda - conda: https://conda.anaconda.org/conda-forge/win-64/python_abi-3.12-4_cp312.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/sdl2-2.30.2-h63175ca_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-69.1.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/spdlog-1.12.0-h64d2f7d_2.conda - conda: https://conda.anaconda.org/conda-forge/win-64/svt-av1-1.4.1-h63175ca_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/taskflow-3.7.0-h7f575de_3.conda - conda: https://conda.anaconda.org/conda-forge/win-64/tbb-2021.12.0-hc790b64_1.conda - conda: https://conda.anaconda.org/conda-forge/win-64/tbb-devel-2021.12.0-hb551fcf_1.conda - conda: https://conda.anaconda.org/conda-forge/win-64/tinyxml2-10.0.0-h63175ca_0.conda @@ -2501,6 +2508,21 @@ packages: license: Zlib size: 113768 timestamp: 1708789054033 +- kind: conda + name: glfw + version: '3.4' + build: hcfcfb64_0 + subdir: win-64 + url: https://conda.anaconda.org/conda-forge/win-64/glfw-3.4-hcfcfb64_0.conda + sha256: f7759a2d1e473d36b39a65096c1b0660fe3574b7aa8fa330ef13626926292d13 + md5: 5d41478e933d70273686b267827d2ae6 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: Zlib + size: 118348 + timestamp: 1708789270458 - kind: conda name: glfw version: '3.4' @@ -2801,6 +2823,24 @@ packages: license_family: MIT size: 626709 timestamp: 1717724405363 +- kind: conda + name: imgui + version: 1.90.8 + build: hecf2515_0 + subdir: win-64 + url: https://conda.anaconda.org/conda-forge/win-64/imgui-1.90.8-hecf2515_0.conda + sha256: b1f6b1886a966f02e456b14d949d118738509ba343c31a5f6d1f1addf963738b + md5: 3cfddbbb10ae792a183e73699b03cddc + depends: + - glfw >=3.4,<4.0a0 + - sdl2 >=2.30.2,<3.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: MIT + license_family: MIT + size: 657726 + timestamp: 1717724662603 - kind: conda name: iniconfig version: 2.0.0 @@ -2963,6 +3003,7 @@ packages: - libedit >=3.1.20191231,<4.0a0 - openssl >=3.3.1,<4.0a0 license: MIT + license_family: MIT size: 1155530 timestamp: 1719463474401 - kind: conda @@ -2980,6 +3021,7 @@ packages: - libedit >=3.1.20191231,<4.0a0 - openssl >=3.3.1,<4.0a0 license: MIT + license_family: MIT size: 1185323 timestamp: 1719463492984 - kind: conda @@ -2998,6 +3040,7 @@ packages: - libstdcxx-ng >=12 - openssl >=3.3.1,<4.0a0 license: MIT + license_family: MIT size: 1370023 timestamp: 1719463201255 - kind: conda @@ -3014,6 +3057,7 @@ packages: - vc >=14.2,<15 - vc14_runtime >=14.29.30139 license: MIT + license_family: MIT size: 712034 timestamp: 1719463874284 - kind: conda @@ -3952,80 +3996,84 @@ packages: - kind: conda name: libcurl version: 8.8.0 - build: h7b6f9a7_0 + build: h7b6f9a7_1 + build_number: 1 subdir: osx-arm64 - url: https://conda.anaconda.org/conda-forge/osx-arm64/libcurl-8.8.0-h7b6f9a7_0.conda - sha256: b83aa249e7c8abc1aa56593ad50d1b4c0a52f5f3d5fd7c489c2ccfc3a548f391 - md5: 245b30f99dc5379ebe1c78899be8d3f5 + url: https://conda.anaconda.org/conda-forge/osx-arm64/libcurl-8.8.0-h7b6f9a7_1.conda + sha256: 9da82a9bd72e9872941da32be54543076c92dbeb2aba688a1c24adbc1c699e64 + md5: e9580b0bb247a2ccf937b16161478f19 depends: - - krb5 >=1.21.2,<1.22.0a0 + - krb5 >=1.21.3,<1.22.0a0 - libnghttp2 >=1.58.0,<2.0a0 - libssh2 >=1.11.0,<2.0a0 - - libzlib >=1.2.13,<2.0.0a0 - - openssl >=3.3.0,<4.0a0 + - libzlib >=1.2.13,<2.0a0 + - openssl >=3.3.1,<4.0a0 - zstd >=1.5.6,<1.6.0a0 license: curl license_family: MIT - size: 364890 - timestamp: 1716378993833 + size: 370070 + timestamp: 1719603062088 - kind: conda name: libcurl version: 8.8.0 - build: hca28451_0 + build: hca28451_1 + build_number: 1 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.8.0-hca28451_0.conda - sha256: 45aec0ffc6fe3fd4c0083b815aa102b8103380acc2b6714fb272d921acc68ab2 - md5: f21c27f076a07907e70c49bb57bd0f20 + url: https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.8.0-hca28451_1.conda + sha256: 6b5b64cdcdb643368ebe236de07eedee99b025bb95129bbe317c46e5bdc693f3 + md5: b8afb3e3cb3423cc445cf611ab95fdb0 depends: - - krb5 >=1.21.2,<1.22.0a0 + - krb5 >=1.21.3,<1.22.0a0 - libgcc-ng >=12 - libnghttp2 >=1.58.0,<2.0a0 - libssh2 >=1.11.0,<2.0a0 - - libzlib >=1.2.13,<2.0.0a0 - - openssl >=3.3.0,<4.0a0 + - libzlib >=1.2.13,<2.0a0 + - openssl >=3.3.1,<4.0a0 - zstd >=1.5.6,<1.6.0a0 license: curl license_family: MIT - size: 405535 - timestamp: 1716378550673 + size: 410158 + timestamp: 1719602718702 - kind: conda name: libcurl version: 8.8.0 - build: hd5e4a3a_0 + build: hd5e4a3a_1 + build_number: 1 subdir: win-64 - url: https://conda.anaconda.org/conda-forge/win-64/libcurl-8.8.0-hd5e4a3a_0.conda - sha256: 169fb0a11dd3a1f0adbb93b275f9752aa24b64e73d0c8e220aa10213c6ee74ff - md5: 4f86149dc6228f1e5617faa2cce90f94 + url: https://conda.anaconda.org/conda-forge/win-64/libcurl-8.8.0-hd5e4a3a_1.conda + sha256: ebe665ec226672e7e6e37f2b1fe554db83f9fea5267cbc5a849ab34d8546b2c3 + md5: 88fbd2ea44690c6dfad8737659936461 depends: - - krb5 >=1.21.2,<1.22.0a0 + - krb5 >=1.21.3,<1.22.0a0 - libssh2 >=1.11.0,<2.0a0 - - libzlib >=1.2.13,<2.0.0a0 + - libzlib >=1.2.13,<2.0a0 - ucrt >=10.0.20348.0 - vc >=14.2,<15 - vc14_runtime >=14.29.30139 license: curl license_family: MIT - size: 334903 - timestamp: 1716379079949 + size: 334189 + timestamp: 1719603160758 - kind: conda name: libcurl version: 8.8.0 - build: hf9fcc65_0 + build: hf9fcc65_1 + build_number: 1 subdir: osx-64 - url: https://conda.anaconda.org/conda-forge/osx-64/libcurl-8.8.0-hf9fcc65_0.conda - sha256: 1eb3e00586ddbf662877e62d1108bd2ff539fbeee34c52edf1d6c5fa3c9f4435 - md5: 276894efcbca23aa674e280e90bc5673 + url: https://conda.anaconda.org/conda-forge/osx-64/libcurl-8.8.0-hf9fcc65_1.conda + sha256: 25e2b044e6978f1714a4b2844f34a45fc8a0c60185db8d332906989d70b65927 + md5: 11711bab5306a6534797a68b3c4c2bed depends: - - krb5 >=1.21.2,<1.22.0a0 + - krb5 >=1.21.3,<1.22.0a0 - libnghttp2 >=1.58.0,<2.0a0 - libssh2 >=1.11.0,<2.0a0 - - libzlib >=1.2.13,<2.0.0a0 - - openssl >=3.3.0,<4.0a0 + - libzlib >=1.2.13,<2.0a0 + - openssl >=3.3.1,<4.0a0 - zstd >=1.5.6,<1.6.0a0 license: curl license_family: MIT - size: 385778 - timestamp: 1716378974624 + size: 390707 + timestamp: 1719602983754 - kind: conda name: libcxx version: 17.0.6 @@ -4110,19 +4158,19 @@ packages: timestamp: 1711196523408 - kind: conda name: libdrm - version: 2.4.121 + version: 2.4.122 build: h4ab18f5_0 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libdrm-2.4.121-h4ab18f5_0.conda - sha256: ad6b2b83f53b1ff524e5cd9617674658d97bdfdf1c9a118c011dfaf1d6ac039b - md5: 3bcee3436b1effa9a3caee2b74175c08 + url: https://conda.anaconda.org/conda-forge/linux-64/libdrm-2.4.122-h4ab18f5_0.conda + sha256: 74c59a29b76bafbb022389c7cfa9b33b8becd7879b2c6b25a1a99735bf4e9c81 + md5: bbfc4dbe5e97b385ef088f354d65e563 depends: - libgcc-ng >=12 - libpciaccess >=0.18,<0.19.0a0 license: MIT license_family: MIT - size: 306112 - timestamp: 1718878251176 + size: 305483 + timestamp: 1719531428392 - kind: conda name: libedit version: 3.1.20191231 @@ -4364,22 +4412,21 @@ packages: timestamp: 1527899216421 - kind: conda name: libgcc-ng - version: 13.2.0 - build: h77fa898_13 - build_number: 13 + version: 14.1.0 + build: h77fa898_0 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-13.2.0-h77fa898_13.conda - sha256: ffa0f472c8b37f864de855af2d3c057f1813162319f10ebd97332d73fc27ba60 - md5: 9358cdd61ef0d600d2a0dde2d53b006c + url: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-14.1.0-h77fa898_0.conda + sha256: b8e869ac96591cda2704bf7e77a301025e405227791a0bddf14a3dac65125538 + md5: ca0fad6a41ddaef54a153b78eccb5037 depends: - _libgcc_mutex 0.1 conda_forge - _openmp_mutex >=4.5 constrains: - - libgomp 13.2.0 h77fa898_13 + - libgomp 14.1.0 h77fa898_0 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL - size: 792721 - timestamp: 1719179941452 + size: 842109 + timestamp: 1719538896937 - kind: conda name: libgcrypt version: 1.11.0 @@ -4524,19 +4571,18 @@ packages: timestamp: 1707330749033 - kind: conda name: libgfortran-ng - version: 13.2.0 - build: h69a702a_13 - build_number: 13 + version: 14.1.0 + build: h69a702a_0 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-13.2.0-h69a702a_13.conda - sha256: 3ef5d92510e9cdd70ec2a9f1f83b8c1d327ff0f9bfc17831a8f8f06f10c2085c - md5: 516e66b26eea14e7e322fe99e88e0f02 + url: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-14.1.0-h69a702a_0.conda + sha256: ef624dacacf97b2b0af39110b36e2fd3e39e358a1a6b7b21b85c9ac22d8ffed9 + md5: f4ca84fbd6d06b0a052fb2d5b96dde41 depends: - - libgfortran5 13.2.0 h3d2ce59_13 + - libgfortran5 14.1.0 hc5f4f2c_0 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL - size: 48419 - timestamp: 1719179972468 + size: 49893 + timestamp: 1719538933879 - kind: conda name: libgfortran5 version: 13.2.0 @@ -4554,23 +4600,6 @@ packages: license_family: GPL size: 1571379 timestamp: 1707328880361 -- kind: conda - name: libgfortran5 - version: 13.2.0 - build: h3d2ce59_13 - build_number: 13 - subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-13.2.0-h3d2ce59_13.conda - sha256: 19cffb68b19ff5f426d1cb3db670dccb73c09f54b8d3f8e304665e2cee68f14f - md5: 1e380198685bc1e993bbbc4b579f5916 - depends: - - libgcc-ng >=13.2.0 - constrains: - - libgfortran-ng 13.2.0 - license: GPL-3.0-only WITH GCC-exception-3.1 - license_family: GPL - size: 1459384 - timestamp: 1719179951703 - kind: conda name: libgfortran5 version: 13.2.0 @@ -4588,6 +4617,22 @@ packages: license_family: GPL size: 997381 timestamp: 1707330687590 +- kind: conda + name: libgfortran5 + version: 14.1.0 + build: hc5f4f2c_0 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-14.1.0-hc5f4f2c_0.conda + sha256: a67d66b1e60a8a9a9e4440cee627c959acb4810cb182e089a4b0729bfdfbdf90 + md5: 6456c2620c990cd8dde2428a27ba0bc5 + depends: + - libgcc-ng >=14.1.0 + constrains: + - libgfortran-ng 14.1.0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 1457561 + timestamp: 1719538909168 - kind: conda name: libglib version: 2.80.2 @@ -4652,19 +4697,18 @@ packages: timestamp: 1715252654366 - kind: conda name: libgomp - version: 13.2.0 - build: h77fa898_13 - build_number: 13 + version: 14.1.0 + build: h77fa898_0 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libgomp-13.2.0-h77fa898_13.conda - sha256: c5949bec7eee93cdd5c367e6e5c5e92ee1c5139a827567af23853dd52721d8ed - md5: d370d1855cca14dff6a819c90c77497c + url: https://conda.anaconda.org/conda-forge/linux-64/libgomp-14.1.0-h77fa898_0.conda + sha256: 7699df61a1f6c644b3576a40f54791561f2845983120477a16116b951c9cdb05 + md5: ae061a5ed5f05818acdf9adab72c146d depends: - _libgcc_mutex 0.1 conda_forge license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL - size: 444091 - timestamp: 1719179831697 + size: 456925 + timestamp: 1719538796073 - kind: conda name: libgpg-error version: '1.50' @@ -5643,19 +5687,18 @@ packages: timestamp: 1685837820566 - kind: conda name: libstdcxx-ng - version: 13.2.0 - build: hc0a3c3a_13 - build_number: 13 + version: 14.1.0 + build: hc0a3c3a_0 subdir: linux-64 - url: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-13.2.0-hc0a3c3a_13.conda - sha256: 143171c6084e526122cc2976fbbfadf7b9f50e5d13036adf20feb7ed9d036dd2 - md5: 1053882642ed5bbc799e1e866ff86826 + url: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-14.1.0-hc0a3c3a_0.conda + sha256: 88c42b388202ffe16adaa337e36cf5022c63cf09b0405cf06fc6aeacccbe6146 + md5: 1cb187a157136398ddbaae90713e2498 depends: - - libgcc-ng 13.2.0 h77fa898_13 + - libgcc-ng 14.1.0 h77fa898_0 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL - size: 3836375 - timestamp: 1719179964037 + size: 3881307 + timestamp: 1719538923443 - kind: conda name: libsystemd0 version: '255' @@ -8014,6 +8057,21 @@ packages: license_family: MIT size: 184509 timestamp: 1693427593121 +- kind: conda + name: sdl2 + version: 2.30.2 + build: h63175ca_0 + subdir: win-64 + url: https://conda.anaconda.org/conda-forge/win-64/sdl2-2.30.2-h63175ca_0.conda + sha256: 2f8020bffb8fcaca01638c44fb845f223140baf04f8766ecca2eb8bc2f7443f0 + md5: 18017f8551ce74d2281f5684f16eb71f + depends: + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: Zlib + size: 2155390 + timestamp: 1712091452523 - kind: conda name: sdl2 version: 2.30.2 @@ -8200,6 +8258,71 @@ packages: license_family: BSD size: 2413709 timestamp: 1670989070228 +- kind: conda + name: taskflow + version: 3.7.0 + build: h297d8ca_3 + build_number: 3 + subdir: linux-64 + url: https://conda.anaconda.org/conda-forge/linux-64/taskflow-3.7.0-h297d8ca_3.conda + sha256: 3185d5c6e814fbe31b976c6ddd887216d45def525a736a3e7363a867dd949de1 + md5: f29aa7c0a6fecf29d6007fb95e9cfb73 + depends: + - libgcc-ng >=12 + - libstdcxx-ng >=12 + license: MIT + license_family: MIT + size: 143507 + timestamp: 1719423892822 +- kind: conda + name: taskflow + version: 3.7.0 + build: h3c5361c_3 + build_number: 3 + subdir: osx-64 + url: https://conda.anaconda.org/conda-forge/osx-64/taskflow-3.7.0-h3c5361c_3.conda + sha256: 14964f84850bd322e26d012668d927b177152f55c8415efe8b37cf84b00bf86a + md5: 06260a4932a1e97e0b778970710a171f + depends: + - __osx >=10.13 + - libcxx >=16 + license: MIT + license_family: MIT + size: 143941 + timestamp: 1719424380833 +- kind: conda + name: taskflow + version: 3.7.0 + build: h420ef59_3 + build_number: 3 + subdir: osx-arm64 + url: https://conda.anaconda.org/conda-forge/osx-arm64/taskflow-3.7.0-h420ef59_3.conda + sha256: f1dbebcdce270f97d265e4d2121fa29f700c140f13a81561e96ac01cd123bc2a + md5: 52eee22e88bb01bff9d37e7216d1830a + depends: + - __osx >=11.0 + - libcxx >=16 + license: MIT + license_family: MIT + size: 143705 + timestamp: 1719423441508 +- kind: conda + name: taskflow + version: 3.7.0 + build: h7f575de_3 + build_number: 3 + subdir: win-64 + url: https://conda.anaconda.org/conda-forge/win-64/taskflow-3.7.0-h7f575de_3.conda + sha256: 1ba003d66890313847be9e84a1feddfa49afc6c15d37eceabd502e36c5b91e95 + md5: f7372cdceb105f3fce9722486a50dd9c + depends: + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: MIT + license_family: MIT + size: 143934 + timestamp: 1719424168708 - kind: conda name: tbb version: 2021.12.0 diff --git a/pixi.toml b/pixi.toml index 5d4e2d43c5f39..4c60399dc3f17 100644 --- a/pixi.toml +++ b/pixi.toml @@ -26,6 +26,7 @@ console_bridge = ">=1.0.2,<1.1" eigen = ">=3.4.0,<3.5" fcl = ">=0.7.0,<0.8" fmt = ">=10.2.1,<10.3" +imgui = ">=1.90.8,<1.91" ipopt = ">=3.14.14,<3.15" libode = ">=0.16.2,<0.17" nlopt = ">=2.7.1,<2.8" @@ -35,6 +36,7 @@ openscenegraph = ">=3.6.5,<3.7" pagmo = ">=2.19.0,<2.20" pagmo-devel = ">=2.19.0,<2.20" spdlog = ">=1.12.0,<1.13" +taskflow = ">=3.7.0,<3.8" tinyxml2 = ">=10.0.0,<10.1" urdfdom = ">=4.0.0,<4.1" @@ -84,13 +86,16 @@ test-all = { cmd = "cmake --build build -j --target ALL", depends_on = [ "configure", ] } -example-hello-world = { cmd = "cmake --build build --target hello_world --parallel && ./build/bin/hello_world", depends_on = [ +ex-hello-world = { cmd = "cmake --build build --target hello_world --parallel && ./build/bin/hello_world", depends_on = [ "configure", ] } -example-atlas-puppet = { cmd = "cmake --build build --target atlas_puppet --parallel && ./build/bin/atlas_puppet", depends_on = [ +ex-atlas-puppet = { cmd = "cmake --build build --target atlas_puppet --parallel && ./build/bin/atlas_puppet", depends_on = [ "configure", ] } -example-atlas-simbicon = { cmd = "cmake --build build --target atlas_simbicon --parallel && ./build/bin/atlas_simbicon", depends_on = [ +ex-atlas-simbicon = { cmd = "cmake --build build --target atlas_simbicon --parallel && ./build/bin/atlas_simbicon", depends_on = [ + "configure", +] } +ex-boxes = { cmd = "cmake --build build --target boxes --parallel && ./build/bin/boxes", depends_on = [ "configure", ] } @@ -116,7 +121,6 @@ clang-format-14 = ">=14.0.6,<14.1" [target.linux-64.dependencies] freeglut = ">=3.2.2,<3.3" -imgui = ">=1.90.4,<1.91" [target.linux-64.tasks] tracy = { cmd = "docker run --rm -d -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw --net=host tracy-profiler" } @@ -129,7 +133,6 @@ tracy = { cmd = "docker run --rm -d -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/. clang-format-14 = ">=14.0.6,<14.1" [target.osx-64.dependencies] -imgui = ">=1.90.4,<1.91" [target.osx-64.tasks] @@ -141,7 +144,6 @@ imgui = ">=1.90.4,<1.91" clang-format-14 = ">=14.0.6,<14.1" [target.osx-arm64.dependencies] -imgui = ">=1.90.4,<1.91" [target.osx-arm64.tasks] @@ -153,7 +155,7 @@ imgui = ">=1.90.4,<1.91" freeglut = ">=3.2.2,<3.3" [target.win-64.tasks] -configure = { cmd = "cmake -S . -B build -G 'Visual Studio 17 2022' -DDART_VERBOSE=ON -DDART_MSVC_DEFAULT_OPTIONS=ON -DBUILD_SHARED_LIBS=OFF -DDART_USE_SYSTEM_IMGUI=OFF" } +configure = { cmd = "cmake -S . -B build -G 'Visual Studio 17 2022' -DDART_VERBOSE=ON -DDART_MSVC_DEFAULT_OPTIONS=ON -DBUILD_SHARED_LIBS=OFF -DDART_USE_SYSTEM_IMGUI=ON" } lint-py = { cmd = "black . --exclude '\\..*' && isort . --skip-glob '.*'", depends_on = [ "configure", ] } diff --git a/tests/benchmark/integration/bm_boxes.cpp b/tests/benchmark/integration/bm_boxes.cpp index ca61f00147636..17cfde427add0 100644 --- a/tests/benchmark/integration/bm_boxes.cpp +++ b/tests/benchmark/integration/bm_boxes.cpp @@ -135,4 +135,4 @@ static void BM_RunBoxes(benchmark::State& state) } } -BENCHMARK(BM_RunBoxes)->Arg(2)->Arg(5)->Unit(benchmark::kMillisecond); +BENCHMARK(BM_RunBoxes)->Arg(2)->Arg(4)->Arg(8)->Unit(benchmark::kMillisecond);