From 7844e83cc0eac9508b711fd564383a915bbf8558 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 21 Jan 2015 17:41:00 -0500 Subject: [PATCH 1/8] Enables to specify new header name of the deprecated header --- cmake/DARTMacros.cmake | 4 ++-- dart/constraint/CMakeLists.txt | 2 +- dart/constraint/ConstraintBase.h | 5 +++++ tools/issue_303_generator.bash | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cmake/DARTMacros.cmake b/cmake/DARTMacros.cmake index 361d32b7cde2d..d5aaf5a4e6bee 100644 --- a/cmake/DARTMacros.cmake +++ b/cmake/DARTMacros.cmake @@ -70,14 +70,14 @@ endmacro() # Copied from https://bitbucket.org/osrf/gazebo/pull-request/638 and will be # removed by DART 5.0 #=============================================================================== -macro(dt_issue_303 _name) +macro(dt_issue_303 _name _output_name) if (FILESYSTEM_CASE_SENSITIVE) if (${DART_VERSION} VERSION_GREATER 4.3) message(WARNING "Installing deprecated ${_name}.hh. This should be removed after Gazebo 4.3") endif() set(generated_file "${CMAKE_CURRENT_BINARY_DIR}/${_name}.h") execute_process( - COMMAND bash ${PROJECT_SOURCE_DIR}/tools/issue_303_generator.bash ${_name} + COMMAND bash ${PROJECT_SOURCE_DIR}/tools/issue_303_generator.bash ${_name} ${_output_name} OUTPUT_FILE ${generated_file} ) string(TOLOWER ${_name} nameLower) diff --git a/dart/constraint/CMakeLists.txt b/dart/constraint/CMakeLists.txt index 092126f1ef508..d7dc9c35e1ece 100644 --- a/dart/constraint/CMakeLists.txt +++ b/dart/constraint/CMakeLists.txt @@ -37,5 +37,5 @@ install( #install(TARGETS dart_constraint EXPORT DARTTargets DESTINATION lib) # Deprecated Constraint.h -dt_issue_303("Constraint") +dt_issue_303("Constraint" "ConstraintBase") diff --git a/dart/constraint/ConstraintBase.h b/dart/constraint/ConstraintBase.h index 313d883eae977..0e68607e30338 100644 --- a/dart/constraint/ConstraintBase.h +++ b/dart/constraint/ConstraintBase.h @@ -39,6 +39,8 @@ #include +#include "dart/common/Deprecated.h" + namespace dart { namespace dynamics { @@ -134,6 +136,9 @@ class ConstraintBase size_t mDim; }; +DEPRECATED(4.3) +typedef ConstraintBase Constraint; + } // namespace constraint } // namespace dart diff --git a/tools/issue_303_generator.bash b/tools/issue_303_generator.bash index d151b4bfbdd77..ef0cea737dd06 100755 --- a/tools/issue_303_generator.bash +++ b/tools/issue_303_generator.bash @@ -24,7 +24,7 @@ cat < Date: Wed, 21 Jan 2015 17:42:14 -0500 Subject: [PATCH 2/8] Deprecate LCPSolver replaced by ODELCPSolver --- dart/lcpsolver/CMakeLists.txt | 3 +++ .../{LCPSolver.cpp => ODELCPSolver.cpp} | 14 +++++++------- dart/lcpsolver/{LCPSolver.h => ODELCPSolver.h} | 16 ++++++++++------ 3 files changed, 20 insertions(+), 13 deletions(-) rename dart/lcpsolver/{LCPSolver.cpp => ODELCPSolver.cpp} (95%) rename dart/lcpsolver/{LCPSolver.h => ODELCPSolver.h} (91%) diff --git a/dart/lcpsolver/CMakeLists.txt b/dart/lcpsolver/CMakeLists.txt index f9422270af334..366ec304e5bfe 100644 --- a/dart/lcpsolver/CMakeLists.txt +++ b/dart/lcpsolver/CMakeLists.txt @@ -31,3 +31,6 @@ install( #install(TARGETS dart_lcpsolver EXPORT DARTCoreTargets DESTINATION lib) #install(TARGETS dart_lcpsolver EXPORT DARTTargets DESTINATION lib) +# Deprecated LCPSolver.h +dt_issue_303("LCPSolver" "ODELCPSolver") + diff --git a/dart/lcpsolver/LCPSolver.cpp b/dart/lcpsolver/ODELCPSolver.cpp similarity index 95% rename from dart/lcpsolver/LCPSolver.cpp rename to dart/lcpsolver/ODELCPSolver.cpp index fc4e6dfecbaf6..224c496d3628d 100644 --- a/dart/lcpsolver/LCPSolver.cpp +++ b/dart/lcpsolver/ODELCPSolver.cpp @@ -34,7 +34,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "dart/lcpsolver/LCPSolver.h" +#include "dart/lcpsolver/ODELCPSolver.h" #include @@ -45,13 +45,13 @@ namespace dart { namespace lcpsolver { -LCPSolver::LCPSolver() { +ODELCPSolver::ODELCPSolver() { } -LCPSolver::~LCPSolver() { +ODELCPSolver::~ODELCPSolver() { } -bool LCPSolver::Solve(const Eigen::MatrixXd& _A, +bool ODELCPSolver::Solve(const Eigen::MatrixXd& _A, const Eigen::VectorXd& _b, Eigen::VectorXd* _x, int _numContacts, @@ -129,7 +129,7 @@ bool LCPSolver::Solve(const Eigen::MatrixXd& _A, } } -void LCPSolver::transferToODEFormulation(const Eigen::MatrixXd& _A, +void ODELCPSolver::transferToODEFormulation(const Eigen::MatrixXd& _A, const Eigen::VectorXd& _b, Eigen::MatrixXd* _AOut, Eigen::VectorXd* _bOut, @@ -170,7 +170,7 @@ void LCPSolver::transferToODEFormulation(const Eigen::MatrixXd& _A, AIntermediate.col(_numContacts * (_numDir + 2) + i); } -void LCPSolver::transferSolFromODEFormulation(const Eigen::VectorXd& _x, +void ODELCPSolver::transferSolFromODEFormulation(const Eigen::VectorXd& _x, Eigen::VectorXd* _xOut, int _numDir, int _numContacts) { @@ -190,7 +190,7 @@ void LCPSolver::transferSolFromODEFormulation(const Eigen::VectorXd& _x, (*_xOut)[_numContacts * (2 + _numDir) + i] = _x[_numContacts * 3 + i]; } -bool LCPSolver::checkIfSolution(const Eigen::MatrixXd& _A, +bool ODELCPSolver::checkIfSolution(const Eigen::MatrixXd& _A, const Eigen::VectorXd& _b, const Eigen::VectorXd& _x) { const double threshold = 1e-4; diff --git a/dart/lcpsolver/LCPSolver.h b/dart/lcpsolver/ODELCPSolver.h similarity index 91% rename from dart/lcpsolver/LCPSolver.h rename to dart/lcpsolver/ODELCPSolver.h index 82c33c9693d32..644fee3eb7af1 100644 --- a/dart/lcpsolver/LCPSolver.h +++ b/dart/lcpsolver/ODELCPSolver.h @@ -34,22 +34,23 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef DART_LCPSOLVER_LCPSOLVER_H_ -#define DART_LCPSOLVER_LCPSOLVER_H_ +#ifndef DART_LCPSOLVER_ODELCPSOLVER_H_ +#define DART_LCPSOLVER_ODELCPSOLVER_H_ #include +#include "dart/common/Deprecated.h" namespace dart { namespace lcpsolver { /// \brief -class LCPSolver { +class ODELCPSolver { public: /// \brief - LCPSolver(); + ODELCPSolver(); /// \brief - virtual ~LCPSolver(); + virtual ~ODELCPSolver(); /// \brief bool Solve(const Eigen::MatrixXd& _A, @@ -81,7 +82,10 @@ class LCPSolver { const Eigen::VectorXd& _x); }; +DEPRECATED(4.3) +typedef ODELCPSolver ODELCPSolver; + } // namespace lcpsolver } // namespace dart -#endif // DART_LCPSOLVER_LCPSOLVER_H_ +#endif // DART_LCPSOLVER_ODELCPSOLVER_H_ From fdca9e894cea3cbc791cb81a785b4094a332fc6f Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 21 Jan 2015 17:54:16 -0500 Subject: [PATCH 3/8] Fix typo: Gazebo -> DART --- cmake/DARTMacros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/DARTMacros.cmake b/cmake/DARTMacros.cmake index 1645b5c765054..f71e57c532904 100644 --- a/cmake/DARTMacros.cmake +++ b/cmake/DARTMacros.cmake @@ -73,7 +73,7 @@ endmacro() macro(dt_issue_303 _name _output_name) if (FILESYSTEM_CASE_SENSITIVE) if (${DART_VERSION} VERSION_GREATER 4.3) - message(WARNING "Installing deprecated ${_name}.hh. This should be removed after Gazebo 4.3") + message(WARNING "Installing deprecated ${_name}.hh. This should be removed after DART 4.3") endif() set(generated_file "${CMAKE_CURRENT_BINARY_DIR}/${_name}.h") execute_process( From c025e3f0318c20cd63f36e8a282d9dcc9d81d4e2 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 21 Jan 2015 17:58:04 -0500 Subject: [PATCH 4/8] Fix typo: ODELCPSolver -> LCPSolver --- dart/lcpsolver/ODELCPSolver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dart/lcpsolver/ODELCPSolver.h b/dart/lcpsolver/ODELCPSolver.h index 644fee3eb7af1..808dc1abe526b 100644 --- a/dart/lcpsolver/ODELCPSolver.h +++ b/dart/lcpsolver/ODELCPSolver.h @@ -83,7 +83,7 @@ class ODELCPSolver { }; DEPRECATED(4.3) -typedef ODELCPSolver ODELCPSolver; +typedef ODELCPSolver LCPSolver; } // namespace lcpsolver } // namespace dart From 89534ce88b6687cada99147cee04d2aff5e4ca50 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 21 Jan 2015 17:59:56 -0500 Subject: [PATCH 5/8] Fix typo: gazebo -> dart --- tools/issue_303_generator.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/issue_303_generator.bash b/tools/issue_303_generator.bash index ef0cea737dd06..b8580cbf28e44 100755 --- a/tools/issue_303_generator.bash +++ b/tools/issue_303_generator.bash @@ -23,7 +23,7 @@ cat < Date: Wed, 21 Jan 2015 19:27:16 -0500 Subject: [PATCH 6/8] Remove unused header inclusion --- dart/constraint/DantzigLCPSolver.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/dart/constraint/DantzigLCPSolver.cpp b/dart/constraint/DantzigLCPSolver.cpp index 821a11da9f94e..d70a42aab7924 100644 --- a/dart/constraint/DantzigLCPSolver.cpp +++ b/dart/constraint/DantzigLCPSolver.cpp @@ -44,7 +44,6 @@ #include "dart/common/Console.h" #include "dart/constraint/ConstraintBase.h" #include "dart/constraint/ConstrainedGroup.h" -#include "dart/lcpsolver/LCPSolver.h" #include "dart/lcpsolver/Lemke.h" #include "dart/lcpsolver/lcp.h" From 5d23b6eab0680dcebe5c76dce41f0b796f798106 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 21 Jan 2015 19:27:56 -0500 Subject: [PATCH 7/8] Add more comment on warning message --- tools/issue_303_generator.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/issue_303_generator.bash b/tools/issue_303_generator.bash index b8580cbf28e44..b659657e2d7bb 100755 --- a/tools/issue_303_generator.bash +++ b/tools/issue_303_generator.bash @@ -23,7 +23,8 @@ cat < Date: Wed, 21 Jan 2015 19:29:42 -0500 Subject: [PATCH 8/8] Remove unused header inclusion --- dart/constraint/PGSLCPSolver.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/dart/constraint/PGSLCPSolver.cpp b/dart/constraint/PGSLCPSolver.cpp index 9d6ebfdda54fd..60a91a0e09fed 100644 --- a/dart/constraint/PGSLCPSolver.cpp +++ b/dart/constraint/PGSLCPSolver.cpp @@ -44,7 +44,6 @@ #include "dart/common/Console.h" #include "dart/constraint/ConstraintBase.h" #include "dart/constraint/ConstrainedGroup.h" -#include "dart/lcpsolver/LCPSolver.h" #include "dart/lcpsolver/Lemke.h" #include "dart/lcpsolver/lcp.h"