diff --git a/CMakeLists.txt b/CMakeLists.txt index 104a5e4ffaa0b..140feea0eda29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -327,6 +327,17 @@ if(HAVE_BULLET_COLLISION) link_directories("${BULLET_LIBRARY_DIRS}") endif() +#=============================================================================== +# Check for non-case-sensitive filesystems +#=============================================================================== +execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tools/case_sensitive_filesystem + RESULT_VARIABLE FILESYSTEM_CASE_SENSITIVE_RETURN) +if (${FILESYSTEM_CASE_SENSITIVE_RETURN} EQUAL 0) + set(FILESYSTEM_CASE_SENSITIVE TRUE) +else() + set(FILESYSTEM_CASE_SENSITIVE FALSE) +endif() + #=============================================================================== # Compiler flags #=============================================================================== diff --git a/cmake/DARTMacros.cmake b/cmake/DARTMacros.cmake index 2af44638fbf5b..f71e57c532904 100644 --- a/cmake/DARTMacros.cmake +++ b/cmake/DARTMacros.cmake @@ -55,3 +55,33 @@ macro(dart_add_library _name) VERSION "${DART_VERSION}" ) endmacro() + +#=============================================================================== +# Copied from https://bitbucket.org/osrf/gazebo/pull-request/638 and will be +# removed by DART 5.0 +#=============================================================================== +macro (dt_install_includes _subdir) + install(FILES ${ARGN} DESTINATION include/dart/${_subdir} COMPONENT headers) +endmacro() + +#=============================================================================== +# Deprecated header files +# Install until next gazebo version on case-sensitive filesystems +# Copied from https://bitbucket.org/osrf/gazebo/pull-request/638 and will be +# removed by DART 5.0 +#=============================================================================== +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 DART 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} ${_output_name} + OUTPUT_FILE ${generated_file} + ) + string(TOLOWER ${_name} nameLower) + dt_install_includes(${nameLower} ${generated_file}) + endif() +endmacro() + diff --git a/dart/constraint/CMakeLists.txt b/dart/constraint/CMakeLists.txt index 3f8e3ada0d7c3..d7dc9c35e1ece 100644 --- a/dart/constraint/CMakeLists.txt +++ b/dart/constraint/CMakeLists.txt @@ -36,3 +36,6 @@ install( #install(TARGETS dart_constraint EXPORT DARTCoreTargets DESTINATION lib) #install(TARGETS dart_constraint EXPORT DARTTargets DESTINATION lib) +# Deprecated Constraint.h +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/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" 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" 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..808dc1abe526b 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 LCPSolver; + } // namespace lcpsolver } // namespace dart -#endif // DART_LCPSOLVER_LCPSOLVER_H_ +#endif // DART_LCPSOLVER_ODELCPSOLVER_H_ diff --git a/tools/case_sensitive_filesystem b/tools/case_sensitive_filesystem new file mode 100755 index 0000000000000..e902862db0ce6 --- /dev/null +++ b/tools/case_sensitive_filesystem @@ -0,0 +1,12 @@ +#!/bin/sh + +# Create a temporary file +tmpFile=`mktemp /tmp/CaseSensitiveXXXXXXXX` +if [ -f `echo $tmpFile | tr '[A-Z]' '[a-z]'` ] +then + #echo Not Case Sensitive + rm $tmpFile + exit 1 +fi +#echo Case Sensitive +rm $tmpFile \ No newline at end of file diff --git a/tools/issue_303_generator.bash b/tools/issue_303_generator.bash new file mode 100755 index 0000000000000..b659657e2d7bb --- /dev/null +++ b/tools/issue_303_generator.bash @@ -0,0 +1,32 @@ +#!/bin/bash +lower=`echo $1 | tr '[:upper:]' '[:lower:]'` +guard=DART_`echo $1 | tr '[:lower:]' '[:upper:]'`_`echo $1 | tr '[:lower:]' '[:upper:]'`_H_ +cat <