From 63433bffbde59ee6d8c9490c09d3bb349e42e83f Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Sat, 30 Mar 2024 18:20:49 -0700 Subject: [PATCH] [integration] Remove integration component --- .clang-format | 2 - dart/CMakeLists.txt | 4 +- dart/dart.hpp | 1 - dart/integration/CMakeLists.txt | 20 ---- dart/integration/EulerIntegrator.cpp | 64 ----------- dart/integration/EulerIntegrator.hpp | 64 ----------- dart/integration/Integrator.cpp | 51 --------- dart/integration/Integrator.hpp | 104 ------------------ dart/integration/RK4Integrator.cpp | 104 ------------------ dart/integration/RK4Integrator.hpp | 68 ------------ .../SemiImplicitEulerIntegrator.cpp | 67 ----------- .../SemiImplicitEulerIntegrator.hpp | 64 ----------- dart/simulation/World.cpp | 1 - dart/simulation/World.hpp | 4 - scripts/code_check.sh | 59 +++++----- 15 files changed, 30 insertions(+), 647 deletions(-) delete mode 100644 dart/integration/CMakeLists.txt delete mode 100644 dart/integration/EulerIntegrator.cpp delete mode 100644 dart/integration/EulerIntegrator.hpp delete mode 100644 dart/integration/Integrator.cpp delete mode 100644 dart/integration/Integrator.hpp delete mode 100644 dart/integration/RK4Integrator.cpp delete mode 100644 dart/integration/RK4Integrator.hpp delete mode 100644 dart/integration/SemiImplicitEulerIntegrator.cpp delete mode 100644 dart/integration/SemiImplicitEulerIntegrator.hpp diff --git a/.clang-format b/.clang-format index 68766810a2d55..f45bffa03b9a3 100644 --- a/.clang-format +++ b/.clang-format @@ -78,8 +78,6 @@ IncludeCategories: Priority: 28 - Regex: '^$' Priority: 29 - - Regex: '^$' - Priority: 30 - Regex: '^$' Priority: 31 - Regex: '^$' diff --git a/dart/CMakeLists.txt b/dart/CMakeLists.txt index 3c547e94389f2..dcdc864c1e8ec 100644 --- a/dart/CMakeLists.txt +++ b/dart/CMakeLists.txt @@ -15,7 +15,6 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${DART_BINARY_DIR}/lib") #=============================================================================== # common # math -# integration # lcpsolver # optimizer # ipopt @@ -37,7 +36,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${DART_BINARY_DIR}/lib") #=============================================================================== # Targets - {dependency targets}, source directories, [external dependency libs] #=============================================================================== -# dart - common, math, integration, lcpsolver, optimizer, dynamics, collision, +# dart - common, math, lcpsolver, optimizer, dynamics, collision, # collision/dart, collision/fcl, constraint, simulation, [assimp, eigen3, # fcl, fmt] # dart-optimizer-ipopt - {dart}, optimizer/ipopt, [ipopt] @@ -74,7 +73,6 @@ endfunction(dart_add_core_sources) # Add subdirectories add_subdirectory(common) add_subdirectory(math) -add_subdirectory(integration) add_subdirectory(lcpsolver) add_subdirectory(optimizer) add_subdirectory(dynamics) diff --git a/dart/dart.hpp b/dart/dart.hpp index f58c6a502cda3..d4c81cde8b7ff 100644 --- a/dart/dart.hpp +++ b/dart/dart.hpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include diff --git a/dart/integration/CMakeLists.txt b/dart/integration/CMakeLists.txt deleted file mode 100644 index 5ddff7b3b0165..0000000000000 --- a/dart/integration/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# Search all header and source files -file(GLOB hdrs "*.hpp") -file(GLOB srcs "*.cpp") -dart_add_core_headers(${hdrs} ${detail_hdrs}) -dart_add_core_sources(${srcs} ${detail_srcs}) - -# Generate header for this namespace -dart_get_filename_components(header_names "integration headers" ${hdrs}) -dart_generate_include_header_file( - "${CMAKE_CURRENT_BINARY_DIR}/integration.hpp" - "dart/integration/" - ${header_names} -) - -# Install -install( - FILES ${hdrs} ${CMAKE_CURRENT_BINARY_DIR}/integration.hpp - DESTINATION include/dart/integration - COMPONENT headers -) diff --git a/dart/integration/EulerIntegrator.cpp b/dart/integration/EulerIntegrator.cpp deleted file mode 100644 index 1c492985816d3..0000000000000 --- a/dart/integration/EulerIntegrator.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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 following "BSD-style" License: - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "dart/integration/EulerIntegrator.hpp" - -namespace dart { -namespace integration { - -//============================================================================== -EulerIntegrator::EulerIntegrator() : Integrator() {} - -//============================================================================== -EulerIntegrator::~EulerIntegrator() {} - -//============================================================================== -void EulerIntegrator::integrate(IntegrableSystem* _system, double _dt) -{ - _system->integrateConfigs(_system->getGenVels(), _dt); - _system->integrateGenVels(_system->evalGenAccs(), _dt); -} - -//============================================================================== -void EulerIntegrator::integratePos(IntegrableSystem* _system, double _dt) -{ - _system->integrateConfigs(_system->getGenVels(), _dt); -} - -//============================================================================== -void EulerIntegrator::integrateVel(IntegrableSystem* _system, double _dt) -{ - _system->integrateGenVels(_system->evalGenAccs(), _dt); -} - -} // namespace integration -} // namespace dart diff --git a/dart/integration/EulerIntegrator.hpp b/dart/integration/EulerIntegrator.hpp deleted file mode 100644 index 688d950026a7b..0000000000000 --- a/dart/integration/EulerIntegrator.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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 following "BSD-style" License: - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef DART_INTEGRATION_EULERINTEGRATOR_HPP_ -#define DART_INTEGRATION_EULERINTEGRATOR_HPP_ - -#include - -namespace dart { -namespace integration { - -/// \brief class EulerIntegrator -class EulerIntegrator : public Integrator -{ -public: - /// \brief Constructor - EulerIntegrator(); - - /// \brief Destructor - virtual ~EulerIntegrator(); - - // Documentation inherited - void integrate(IntegrableSystem* _system, double _dt) override; - - // Documentation inherited - void integratePos(IntegrableSystem* _system, double _dt) override; - - // Documentation inherited - void integrateVel(IntegrableSystem* _system, double _dt) override; -}; - -} // namespace integration -} // namespace dart - -#endif // DART_INTEGRATION_EULERINTEGRATOR_HPP_ diff --git a/dart/integration/Integrator.cpp b/dart/integration/Integrator.cpp deleted file mode 100644 index 57f06bce0a256..0000000000000 --- a/dart/integration/Integrator.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 following "BSD-style" License: - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "dart/integration/Integrator.hpp" - -namespace dart { -namespace integration { - -//============================================================================== -IntegrableSystem::IntegrableSystem() {} - -//============================================================================== -IntegrableSystem::~IntegrableSystem() {} - -//============================================================================== -Integrator::Integrator() {} - -//============================================================================== -Integrator::~Integrator() {} - -} // namespace integration -} // namespace dart diff --git a/dart/integration/Integrator.hpp b/dart/integration/Integrator.hpp deleted file mode 100644 index 0312d6e757590..0000000000000 --- a/dart/integration/Integrator.hpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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 following "BSD-style" License: - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef DART_INTEGRATION_INTEGRATOR_HPP_ -#define DART_INTEGRATION_INTEGRATOR_HPP_ - -#include - -#include - -namespace dart { -namespace integration { - -/// \brief Any class that uses an integrator should implement this interface -class IntegrableSystem -{ -public: - /// \brief Constructor - IntegrableSystem(); - - /// \brief Destructor - virtual ~IntegrableSystem(); - -public: - /// \brief Set configurations - virtual void setConfigs(const Eigen::VectorXd& _configs) = 0; - - /// \brief Set generalized velocities - virtual void setGenVels(const Eigen::VectorXd& _genVels) = 0; - - /// \brief Get configurations - virtual Eigen::VectorXd getConfigs() const = 0; - - /// \brief Get generalized velocities - virtual Eigen::VectorXd getGenVels() const = 0; - - /// \brief Evaulate generalized accelerations - virtual Eigen::VectorXd evalGenAccs() = 0; - - /// \brief Integrate configruations and store them in the system - virtual void integrateConfigs(const Eigen::VectorXd& _genVels, double _dt) - = 0; - - /// \brief Integrate generalized velocities and store them in the system - virtual void integrateGenVels(const Eigen::VectorXd& _genVels, double _dt) - = 0; -}; - -// TODO(kasiu): Consider templating the class (which currently only works on -// arbitrarily-sized vectors of doubles) -/// \brief class Integrator -class Integrator -{ -public: - /// \brief Constructor - Integrator(); - - /// \brief Destructor - virtual ~Integrator(); - -public: - /// \brief Integrate the system with time step dt - virtual void integrate(IntegrableSystem* _system, double _dt) = 0; - - /// \brief Integrate velocity of the system with time step dt - virtual void integratePos(IntegrableSystem* _system, double _dt) = 0; - - /// \brief Integrate velocity of the system with time step dt - virtual void integrateVel(IntegrableSystem* _system, double _dt) = 0; -}; - -} // namespace integration -} // namespace dart - -#endif // DART_INTEGRATION_INTEGRATOR_HPP_ diff --git a/dart/integration/RK4Integrator.cpp b/dart/integration/RK4Integrator.cpp deleted file mode 100644 index 498d53221dac3..0000000000000 --- a/dart/integration/RK4Integrator.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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 following "BSD-style" License: - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "dart/integration/RK4Integrator.hpp" - -namespace dart { -namespace integration { - -//============================================================================== -RK4Integrator::RK4Integrator() {} - -//============================================================================== -RK4Integrator::~RK4Integrator() {} - -//============================================================================== -void RK4Integrator::integrate(IntegrableSystem* _system, double _dt) -{ - //---------------------------------------------------------------------------- - // compute ddq1 - q1 = _system->getConfigs(); - dq1 = _system->getGenVels(); - ddq1 = _system->evalGenAccs(); - - //---------------------------------------------------------------------------- - // q2 = q1 + dq1 * 0.5 * _dt - _system->integrateConfigs(dq1, 0.5 * _dt); - - // q2 = dq1 + ddq1 * 0.5 * _dt - _system->integrateGenVels(ddq1, 0.5 * _dt); - - // compute ddq2 - dq2 = _system->getGenVels(); - ddq2 = _system->evalGenAccs(); - - //---------------------------------------------------------------------------- - // q3 = q1 + dq2 * 0.5 * _dt - _system->setConfigs(q1); - _system->integrateConfigs(dq2, 0.5 * _dt); - - // dq3 = dq1 + ddq2 * 0.5 * _dt - _system->setGenVels(dq1); - _system->integrateGenVels(ddq2, 0.5 * _dt); - - // compute ddq3 - dq3 = _system->getGenVels(); - ddq3 = _system->evalGenAccs(); - - //---------------------------------------------------------------------------- - // q4 = q1 + dq3 * _dt - _system->integrateConfigs(dq3, _dt); - - // dq4 = dq1 + ddq3 * _dt - _system->setGenVels(dq1); - _system->integrateGenVels(ddq3, _dt); - - // compute ddq4 - dq4 = _system->getGenVels(); - ddq4 = _system->evalGenAccs(); - - //---------------------------------------------------------------------------- - // q = q1 + dq5 * _dt - // where dq5 = (1/6) * (dq1 + (2.0 * dq2) + (2.0 * dq3) + dq4) - _system->setConfigs(q1); - _system->integrateConfigs( - 1.0 / 6.0 * (dq1 + (2.0 * dq2) + (2.0 * dq3) + dq4), _dt); - - // dq = dq1 + ddq5 * _dt - // where dq5 = (1/6) * (ddq1 + (2.0 * ddq2) + (2.0 * ddq3) + ddq4) - _system->setGenVels(dq1); - _system->integrateGenVels( - 1.0 / 6.0 * (ddq1 + (2.0 * ddq2) + (2.0 * ddq3) + ddq4), _dt); -} - -} // namespace integration -} // namespace dart diff --git a/dart/integration/RK4Integrator.hpp b/dart/integration/RK4Integrator.hpp deleted file mode 100644 index 78df1ec9e05e7..0000000000000 --- a/dart/integration/RK4Integrator.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 following "BSD-style" License: - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef DART_INTEGRATION_RK4INTEGRATOR_HPP_ -#define DART_INTEGRATION_RK4INTEGRATOR_HPP_ - -#include - -namespace dart { -namespace integration { - -/// \brief class RK4Integrator -class RK4Integrator : public Integrator -{ -public: - /// \brief Constructor - RK4Integrator(); - - /// \brief Destructor - virtual ~RK4Integrator(); - - // Documentation inherited - void integrate(IntegrableSystem* _system, double _dt) override; - -private: - /// \brief Initial configurations - Eigen::VectorXd q1; - - /// \brief Chache data for generalized velocities - Eigen::VectorXd dq1, dq2, dq3, dq4; - - /// \brief Chache data for generalized accelerations - Eigen::VectorXd ddq1, ddq2, ddq3, ddq4; -}; - -} // namespace integration -} // namespace dart - -#endif // DART_INTEGRATION_RK4INTEGRATOR_HPP_ diff --git a/dart/integration/SemiImplicitEulerIntegrator.cpp b/dart/integration/SemiImplicitEulerIntegrator.cpp deleted file mode 100644 index cf0a40647f5cd..0000000000000 --- a/dart/integration/SemiImplicitEulerIntegrator.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 following "BSD-style" License: - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "dart/integration/SemiImplicitEulerIntegrator.hpp" - -namespace dart { -namespace integration { - -//============================================================================== -SemiImplicitEulerIntegrator::SemiImplicitEulerIntegrator() : Integrator() {} - -//============================================================================== -SemiImplicitEulerIntegrator::~SemiImplicitEulerIntegrator() {} - -//============================================================================== -void SemiImplicitEulerIntegrator::integrate( - IntegrableSystem* _system, double _dt) -{ - _system->integrateGenVels(_system->evalGenAccs(), _dt); - _system->integrateConfigs(_system->getGenVels(), _dt); -} - -//============================================================================== -void SemiImplicitEulerIntegrator::integratePos( - IntegrableSystem* _system, double _dt) -{ - _system->integrateConfigs(_system->getGenVels(), _dt); -} - -//============================================================================== -void SemiImplicitEulerIntegrator::integrateVel( - IntegrableSystem* _system, double _dt) -{ - _system->integrateGenVels(_system->evalGenAccs(), _dt); -} - -} // namespace integration -} // namespace dart diff --git a/dart/integration/SemiImplicitEulerIntegrator.hpp b/dart/integration/SemiImplicitEulerIntegrator.hpp deleted file mode 100644 index cf7b49d12fa7a..0000000000000 --- a/dart/integration/SemiImplicitEulerIntegrator.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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 following "BSD-style" License: - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef DART_INTEGRATION_SEMIIMPLICITEULERINTEGRATOR_HPP_ -#define DART_INTEGRATION_SEMIIMPLICITEULERINTEGRATOR_HPP_ - -#include - -namespace dart { -namespace integration { - -/// \brief class SemiImplicitEulerIntegrator -class SemiImplicitEulerIntegrator : public Integrator -{ -public: - /// \brief Constructor - SemiImplicitEulerIntegrator(); - - /// \brief Destructor - virtual ~SemiImplicitEulerIntegrator(); - - // Documentation inherited - void integrate(IntegrableSystem* _system, double _dt) override; - - // Documentation inherited - void integratePos(IntegrableSystem* _system, double _dt) override; - - // Documentation inherited - void integrateVel(IntegrableSystem* _system, double _dt) override; -}; - -} // namespace integration -} // namespace dart - -#endif // DART_INTEGRATION_SEMIIMPLICITEULERINTEGRATOR_HPP_ diff --git a/dart/simulation/World.cpp b/dart/simulation/World.cpp index 4a68d849eb73d..54d9d5a0d8ddb 100644 --- a/dart/simulation/World.cpp +++ b/dart/simulation/World.cpp @@ -44,7 +44,6 @@ #include "dart/constraint/BoxedLcpConstraintSolver.hpp" #include "dart/constraint/ConstrainedGroup.hpp" #include "dart/dynamics/Skeleton.hpp" -#include "dart/integration/SemiImplicitEulerIntegrator.hpp" #include #include diff --git a/dart/simulation/World.hpp b/dart/simulation/World.hpp index dc65bd0ca927b..a9784de16a9c1 100644 --- a/dart/simulation/World.hpp +++ b/dart/simulation/World.hpp @@ -61,10 +61,6 @@ namespace dart { -namespace integration { -class Integrator; -} // namespace integration - namespace dynamics { class Skeleton; } // namespace dynamics diff --git a/scripts/code_check.sh b/scripts/code_check.sh index a64013aa8be4a..7f9137032b103 100755 --- a/scripts/code_check.sh +++ b/scripts/code_check.sh @@ -8,7 +8,6 @@ CHECK_DIRS="#../dart/collision\ ../dart/constraint\ #../dart/dynamics\ #../dart/gui\ - #../dart/integration\ #../dart/lcpsolver\ #../dart/math\ #../dart/optimizer\ @@ -18,35 +17,35 @@ CHECK_DIRS="#../dart/collision\ #../apps/cubes\ #../apps/meshCollision" NOT_CHECK_DIRS="" -CHECK_FILES=`\ - find $CHECK_DIRS\ - -name "*.cpp"\ - -not -name "DARTCollide.cpp"\ - -not -name "BulletCollisionDetector.cpp"\ - -not -name "lodepng.cpp"\ - -not -name "error.cpp"\ - -not -name "fastdot.cpp"\ - -not -name "fastldlt.cpp"\ - -not -name "fastlsolve.cpp"\ - -not -name "fastltsolve.cpp"\ - -not -name "lcp.cpp"\ - -not -name "matrix.cpp"\ - -not -name "misc.cpp"\ - -or -name "*.hh"\ - -or -name "*.c"\ - -or -name "*.h"\ - -not -name "tri_tri_intersection_test.h"\ - -not -name "Jitter.h"\ - -not -name "lodepng.h"\ - -not -name "common.h"\ - -not -name "error.h"\ - -not -name "lcp.h"\ - -not -name "matrix.h"\ - -not -name "misc.h"\ - -not -name "odeconfig.h"\ - -not -name "btBulletCollisionCommon.h"\ - | grep -v "../dart/collision/bullet/LinearMath/"\ - | grep -v "../dart/collision/bullet/BulletCollision/"` +CHECK_FILES=$( + find $CHECK_DIRS -name "*.cpp" \ + -not -name "DARTCollide.cpp" \ + -not -name "BulletCollisionDetector.cpp" \ + -not -name "lodepng.cpp" \ + -not -name "error.cpp" \ + -not -name "fastdot.cpp" \ + -not -name "fastldlt.cpp" \ + -not -name "fastlsolve.cpp" \ + -not -name "fastltsolve.cpp" \ + -not -name "lcp.cpp" \ + -not -name "matrix.cpp" \ + -not -name "misc.cpp" \ + -or -name "*.hh" \ + -or -name "*.c" \ + -or -name "*.h" \ + -not -name "tri_tri_intersection_test.h" \ + -not -name "Jitter.h" \ + -not -name "lodepng.h" \ + -not -name "common.h" \ + -not -name "error.h" \ + -not -name "lcp.h" \ + -not -name "matrix.h" \ + -not -name "misc.h" \ + -not -name "odeconfig.h" \ + -not -name "btBulletCollisionCommon.h" | + grep -v "../dart/collision/bullet/LinearMath/" | + grep -v "../dart/collision/bullet/BulletCollision/" +) # cpplint echo $CHECK_FILES | xargs python cpplint.py 2>&1