From bbd6be3aef965ef44af0afa6d1d92e9e7e7f635b Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Thu, 11 Jan 2018 14:07:24 -0800 Subject: [PATCH 1/7] Fix various build issues with Visual Studio 2017 (15.5.3) --- .appveyor.yml | 81 +++++++++++++++++++++ CMakeLists.txt | 18 ++++- appveyor.yml | 63 ---------------- cmake/FindFCL.cmake | 2 +- dart/collision/CollisionDetector.cpp | 13 +++- dart/collision/CollisionDetector.hpp | 3 + dart/collision/fcl/FCLCollisionDetector.cpp | 2 +- dart/common/Resource.hpp | 1 + dart/common/SharedLibrary.cpp | 8 -- dart/common/SharedLibrary.hpp | 14 ++++ dart/dynamics/ArrowShape.cpp | 12 +-- dart/gui/CMakeLists.txt | 2 +- dart/gui/GLFuncs.cpp | 9 ++- dart/gui/Trackball.cpp | 5 +- dart/gui/Win3D.cpp | 5 +- dart/math/Geometry.cpp | 4 +- dart/math/Geometry.hpp | 5 +- dart/planning/Path.cpp | 4 +- 18 files changed, 157 insertions(+), 94 deletions(-) create mode 100644 .appveyor.yml delete mode 100644 appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000000000..20dced2370be1 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,81 @@ +# Specify version format +version: "{build}" + +image: Visual Studio 2017 + +platform: x64 + +# specify custom environment variables +environment: + MSVC_DEFAULT_OPTIONS: ON + CMAKE_TOOLCHAIN_FILE: -DCMAKE_TOOLCHAIN_FILE="C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake" + matrix: + - CMAKE_GENERATOR: -G"Visual Studio 15 2017 Win64" + CMAKE_TOOLCHAIN: -T"v141" + +# build configuration, i.e. Debug, Release, etc. +configuration: + - Debug + - Release + +# scripts that are called at very beginning, before repo cloning +init: + - cmd: cmake --version + - cmd: msbuild /version + +# clone directory +clone_folder: C:\projects\dart + +# branches to build +branches: + # whitelist + # only: + # - master + # blacklist + except: + - gh-pages + +# scripts that run after cloning repository +install: + - if "%platform%"=="Win32" set VCPKG_ARCH=x86-windows + - if "%platform%"=="x64" set VCPKG_ARCH=x64-windows + + # install pacakges + # ---- required dependencies: boost, eigen3, libccd, fcl, assimp + - vcpkg install boost:%VCPKG_ARCH% + - vcpkg install eigen3:%VCPKG_ARCH% + - vcpkg install ccd:%VCPKG_ARCH% + - vcpkg install fcl:%VCPKG_ARCH% + - vcpkg install assimp:%VCPKG_ARCH% + # ---- optional dependencies: nlopt, ipopt, bullet3, ode, flann, tinyxml2, urdfdom_headers, urdfdom, opengl, freeglut, osg + #- vcpkg install nlopt:%VCPKG_ARCH% + #- vcpkg install ipopt:%VCPKG_ARCH% + #- vcpkg install bullet3:%VCPKG_ARCH% + #- vcpkg install ode:%VCPKG_ARCH% + #- vcpkg install flann:%VCPKG_ARCH% + #- vcpkg install tinyxml2:%VCPKG_ARCH% + #- vcpkg install urdfdom_headers:%VCPKG_ARCH% + #- vcpkg install urdfdom:%VCPKG_ARCH% + #- vcpkg install opengl:%VCPKG_ARCH% + #- vcpkg install freeglut:%VCPKG_ARCH% + #- vcpkg install osg:%VCPKG_ARCH% + + - vcpkg integrate install + + - cmd: cd C:\projects\dart + - cmd: md build + - cmd: cd build + - cmd: cmake %CMAKE_GENERATOR% -DCMAKE_BUILD_TYPE=%configuration% -DDART_MSVC_DEFAULT_OPTIONS="%MSVC_DEFAULT_OPTIONS%" %CMAKE_TOOLCHAIN_FILE% %CMAKE_TOOLCHAIN% .. + +# preserve contents of selected directories and files across project builds +cache: + - C:\tools\vcpkg\installed -> .appveyor.yml + - C:\tools\vcpkg\packages -> .appveyor.yml + +build: + project: C:\projects\dart\build\dart.sln # path to Visual Studio solution or project + parallel: true # enable MSBuild parallel builds + verbosity: quiet # MSBuild verbosity level (quiet|minimal|normal|detailed) + +#test_script: + #- cmd: ctest --build-config %configuration% --parallel 4 --output-on-failure diff --git a/CMakeLists.txt b/CMakeLists.txt index d392e6b17fb5e..701094e484b71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ #=============================================================================== # CMake 2.8.12 or above is required for CMakeParseArguments. if(MSVC) - cmake_minimum_required(VERSION 3.1.3) + cmake_minimum_required(VERSION 3.8.0) else() cmake_minimum_required(VERSION 2.8.12) endif() @@ -159,17 +159,27 @@ if(MSVC) # Visual Studio enables c++11 support by default if(MSVC_VERSION VERSION_LESS 1900) - message(FATAL_ERROR "${PROJECT_NAME} requires VS 2015 or greater.") + message(FATAL_ERROR "${PROJECT_NAME} requires VS2017 or greater.") endif() if(DART_TREAT_WARNINGS_AS_ERRORS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP4") - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG /INCREMENTAL:NO") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /permissive-") + #set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG /INCREMENTAL:NO") if(NOT DART_MSVC_DEFAULT_OPTIONS) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DART_RUNTIME_LIBRARY}d /Zi /Gy /W1 /EHsc") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${DART_RUNTIME_LIBRARY} /Zi /GL /Gy /W1 /EHsc") endif(NOT DART_MSVC_DEFAULT_OPTIONS) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) + add_compile_options(/wd4334) + add_compile_options(/wd4267) + add_compile_options(/wd4244) + add_compile_options(/wd4250) + add_compile_options(/wd4996) + add_compile_options(/wd4099) + add_compile_options(/wd4305) + add_compile_options(/wd4838) + add_compile_options(/bigobj) elseif(CMAKE_COMPILER_IS_GNUCXX) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index df5f698c38fb3..0000000000000 --- a/appveyor.yml +++ /dev/null @@ -1,63 +0,0 @@ -# Specify version format -version: "{build}" - -# Operating system (build VM template) -os: Visual Studio 2015 - -# build platform, i.e. Win32 (instead of x86), x64, Any CPU. This setting is optional. -platform: - - Win32 - #- x64 Disable build for x64 machine until x64 version of dart-prerequisites is ready - -# specify custom environment variables -environment: - MSVC_DEFAULT_OPTIONS: ON - BOOST_ROOT: C:\Libraries\boost_1_59_0 - BOOST_LIBRARYDIR: C:\Libraries\boost_1_59_0\lib32-msvc-14.0 - -# build configuration, i.e. Debug, Release, etc. -configuration: - - Debug - - Release - -# scripts that are called at very beginning, before repo cloning -init: - - cmd: cmake --version - - cmd: msbuild /version - -# clone directory -clone_folder: C:\projects\dart - -# branches to build -branches: - # whitelist - # only: - # - master - # blacklist - except: - - gh-pages - -# scripts that run after cloning repository -install: - - ps: cd C:\projects\dart\ci - - ps: .\appveyor_install.ps1 - -# scripts to run before build -before_build: - - cmd: cd C:\projects\dart - - cmd: md build - - cmd: cd build - # We generate project files for Visual Studio 12 because the boost binaries installed on the test server are for Visual Studio 12. - - cmd: if "%platform%"=="Win32" set CMAKE_GENERATOR_NAME=Visual Studio 14 2015 - - cmd: if "%platform%"=="x64" set CMAKE_GENERATOR_NAME=Visual Studio 14 2015 Win64 - - cmd: cmake -G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=%configuration% -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" -DBoost_USE_STATIC_LIBS="ON" -Durdfdom_DIR="%urdfdom_DIR%" -Durdfdom_headers_DIR="%urdfdom_headers_DIR%" -DDART_MSVC_DEFAULT_OPTIONS="%MSVC_DEFAULT_OPTIONS%" .. - -build: off -#build: -# project: C:\projects\dart\build\dart.sln # path to Visual Studio solution or project -# parallel: true # enable MSBuild parallel builds -# verbosity: quiet # MSBuild verbosity level (quiet|minimal|normal|detailed) - -test: off -#test_script: -# - cmd: ctest --build-config %configuration% --parallel 4 --output-on-failure diff --git a/cmake/FindFCL.cmake b/cmake/FindFCL.cmake index 3fffc51e7c78d..22647f560fdce 100644 --- a/cmake/FindFCL.cmake +++ b/cmake/FindFCL.cmake @@ -20,7 +20,7 @@ find_package(PkgConfig QUIET) pkg_check_modules(PC_FCL fcl QUIET) # Include directories -if (${PC_FCL_VERSION} VERSION_LESS 0.6.0) +if(PC_FCL_VERSION VERSION_LESS 0.6.0) find_path(FCL_INCLUDE_DIRS NAMES fcl/collision.h HINTS ${PC_FCL_INCLUDEDIR} diff --git a/dart/collision/CollisionDetector.cpp b/dart/collision/CollisionDetector.cpp index 896734ed35a6d..0708900c1e7af 100644 --- a/dart/collision/CollisionDetector.cpp +++ b/dart/collision/CollisionDetector.cpp @@ -81,6 +81,13 @@ CollisionDetector::CollisionObjectManager::CollisionObjectManager( assert(cd); } +//============================================================================== +CollisionDetector* +CollisionDetector::CollisionObjectManager::getCollisionDetector() +{ + return mCollisionDetector; +} + //============================================================================== CollisionDetector:: ManagerForUnsharableCollisionObjects::ManagerForUnsharableCollisionObjects( @@ -117,7 +124,7 @@ void CollisionDetector::ManagerForUnsharableCollisionObjects ::CollisionObjectDeleter::operator()(CollisionObject* object) const { - mCollisionObjectManager->mCollisionDetector->notifyCollisionObjectDestroying( + mCollisionObjectManager->getCollisionDetector()->notifyCollisionObjectDestroying( object); delete object; @@ -180,8 +187,8 @@ void CollisionDetector::ManagerForSharableCollisionObjects ::CollisionObjectDeleter::operator()(CollisionObject* object) const { - mCollisionObjectManager->mCollisionDetector->notifyCollisionObjectDestroying( - object); + mCollisionObjectManager->getCollisionDetector() + ->notifyCollisionObjectDestroying(object); mCollisionObjectManager->mCollisionObjectMap.erase(object->getShapeFrame()); delete object; diff --git a/dart/collision/CollisionDetector.hpp b/dart/collision/CollisionDetector.hpp index 45056733d1340..e6e89b238cfee 100644 --- a/dart/collision/CollisionDetector.hpp +++ b/dart/collision/CollisionDetector.hpp @@ -196,6 +196,9 @@ class CollisionDetector::CollisionObjectManager virtual std::shared_ptr claimCollisionObject( const dynamics::ShapeFrame* shapeFrame) = 0; + /// Returns collision detector + CollisionDetector* getCollisionDetector(); + protected: CollisionDetector* mCollisionDetector; diff --git a/dart/collision/fcl/FCLCollisionDetector.cpp b/dart/collision/fcl/FCLCollisionDetector.cpp index f4a916ce91071..f08411bbdf6ca 100644 --- a/dart/collision/fcl/FCLCollisionDetector.cpp +++ b/dart/collision/fcl/FCLCollisionDetector.cpp @@ -514,7 +514,7 @@ ::fcl::BVHModel* createCylinder(double _baseRadius, double _topRadius, /* Cache is the vertex locations cache */ for (i = 0; i < _slices; i++) { - angle = 2 * M_PI * i / _slices; + angle = 2 * math::constantsd::pi() * i / _slices; sinCache[i] = sin(angle); cosCache[i] = cos(angle); } diff --git a/dart/common/Resource.hpp b/dart/common/Resource.hpp index 55eeeeb11c239..7ddb915324ee2 100644 --- a/dart/common/Resource.hpp +++ b/dart/common/Resource.hpp @@ -35,6 +35,7 @@ #include #include +#include namespace dart { namespace common { diff --git a/dart/common/SharedLibrary.cpp b/dart/common/SharedLibrary.cpp index a8518c041709c..6a966bf330026 100644 --- a/dart/common/SharedLibrary.cpp +++ b/dart/common/SharedLibrary.cpp @@ -38,7 +38,6 @@ #if DART_OS_LINUX || DART_OS_MACOS #include -#define DYNLIB_HANDLE void* #define DYNLIB_LOAD(a) dlopen(a, RTLD_LAZY | RTLD_GLOBAL) #define DYNLIB_GETSYM(a, b) dlsym(a, b) #define DYNLIB_UNLOAD(a) dlclose(a) @@ -46,17 +45,10 @@ #elif DART_OS_WINDOWS #define WIN32_LEAN_AND_MEAN -#if !defined(NOMINMAX) && defined(_MSC_VER) -#define NOMINMAX // required to stop windows.h messing up std::min -#endif -#include -#define DYNLIB_HANDLE hInstance // We can not use LOAD_WITH_ALTERED_SEARCH_PATH with relative paths #define DYNLIB_LOAD(a) LoadLibraryEx(a, nullptr, 0) #define DYNLIB_GETSYM(a, b) GetProcAddress(a, b) #define DYNLIB_UNLOAD(a) !FreeLibrary(a) -struct HINSTANCE__; -typedef struct HINSTANCE__* hInstance; #endif diff --git a/dart/common/SharedLibrary.hpp b/dart/common/SharedLibrary.hpp index ffcffee0c159f..a1a8739bc7bba 100644 --- a/dart/common/SharedLibrary.hpp +++ b/dart/common/SharedLibrary.hpp @@ -39,11 +39,25 @@ #include "dart/common/Platform.hpp" #if DART_OS_LINUX + #define DYNLIB_HANDLE void* + #elif DART_OS_MACOS + #define DYNLIB_HANDLE void* + #elif DART_OS_WINDOWS + +#ifdef NOMINMAX +#include +#else +#define NOMINMAX +#include +#undef NOMINMAX +#endif +using hInstance = HINSTANCE__*; #define DYNLIB_HANDLE hInstance + #endif namespace dart { diff --git a/dart/dynamics/ArrowShape.cpp b/dart/dynamics/ArrowShape.cpp index 913e114876bf3..c4ec838a0ff75 100644 --- a/dart/dynamics/ArrowShape.cpp +++ b/dart/dynamics/ArrowShape.cpp @@ -32,6 +32,8 @@ #include "dart/dynamics/ArrowShape.hpp" +#include "dart/math/Constants.hpp" + namespace dart { namespace dynamics { @@ -119,7 +121,7 @@ static void constructArrowTip(aiMesh* mesh, double base, double tip, std::size_t resolution = (mesh->mNumVertices-1)/2; for(std::size_t i=0; imNumVertices/2; for(std::size_t i=0; imNormals[2*i].Set(0.0f, 0.0f, 1.0f); - double theta = (double)(i)/(double)(resolution)*2*M_PI; + double theta = (double)(i)/(double)(resolution)*2*math::constantsd::pi(); mesh->mNormals[2*i+1].Set(cos(theta), sin(theta), 0.0f); } mesh->mNormals[mesh->mNumVertices-1].Set(0.0f, 0.0f, -1.0f); @@ -291,7 +293,7 @@ void ArrowShape::instantiate(std::size_t resolution) mesh = scene->mMeshes[1]; for(std::size_t i=0; imNormals[2*i].Set(cos(theta), sin(theta), 0.0f); mesh->mNormals[2*i+1].Set(cos(theta), sin(theta), 0.0f); } @@ -301,7 +303,7 @@ void ArrowShape::instantiate(std::size_t resolution) { mesh->mNormals[2*i].Set(0.0f, 0.0f, -1.0f); - double theta = (double)(i)/(double)(resolution)*2*M_PI; + double theta = (double)(i)/(double)(resolution)*2* math::constantsd::pi(); mesh->mNormals[2*i+1].Set(cos(theta), sin(theta), 0.0f); } mesh->mNormals[mesh->mNumVertices-1].Set(0.0f, 0.0f, 1.0f); diff --git a/dart/gui/CMakeLists.txt b/dart/gui/CMakeLists.txt index e96f840a350c6..5c922e7d9680e 100644 --- a/dart/gui/CMakeLists.txt +++ b/dart/gui/CMakeLists.txt @@ -7,7 +7,7 @@ find_package(OpenGL QUIET) dart_check_optional_package(OPENGL "dart-gui" "OpenGL") if(WIN32 AND NOT CYGWIN) - set(GLUT_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include") + set(GLUT_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include") set(GLUT_LIBRARIES glut32) set(HAVE_GLUT TRUE) else() diff --git a/dart/gui/GLFuncs.cpp b/dart/gui/GLFuncs.cpp index a54e2c1e3e516..9a0db4de04815 100644 --- a/dart/gui/GLFuncs.cpp +++ b/dart/gui/GLFuncs.cpp @@ -38,6 +38,7 @@ #include +#include "dart/math/Constants.hpp" #include "dart/gui/LoadOpengl.hpp" #include "dart/gui/LoadGlut.hpp" @@ -77,6 +78,8 @@ namespace gui { void drawArrow3D(const Eigen::Vector3d& _pt, const Eigen::Vector3d& _dir, const double _length, const double _thickness, const double _arrowThickness) { + const double pi = math::constantsd::pi(); + Eigen::Vector3d normDir = _dir; normDir.normalize(); @@ -94,7 +97,7 @@ void drawArrow3D(const Eigen::Vector3d& _pt, const Eigen::Vector3d& _dir, glPushMatrix(); glTranslatef(_pt[0], _pt[1], _pt[2]); - glRotated(acos(normDir[2])*180/M_PI, -normDir[1], normDir[0], 0); + glRotated(acos(normDir[2])*180/pi, -normDir[1], normDir[0], 0); gluCylinder(c, _thickness, _thickness, _length-arrowLength, 16, 16); // draw the arrowhed as a cone @@ -112,6 +115,8 @@ void drawArrow3D(const Eigen::Vector3d& _pt, const Eigen::Vector3d& _dir, // end void drawArrow2D(const Eigen::Vector2d& _pt, const Eigen::Vector2d& _vec, double _thickness) { + const double pi = math::constantsd::pi(); + // draw the arrow body as a thick line glLineWidth(_thickness); glBegin(GL_LINES); @@ -123,7 +128,7 @@ void drawArrow2D(const Eigen::Vector2d& _pt, const Eigen::Vector2d& _vec, double theta = atan2(_vec[1], _vec[0]); glPushMatrix(); glTranslatef(_pt[0]+_vec[0], _pt[1]+_vec[1], 0.0); - glRotatef(theta*180.0/M_PI, 0.0, 0.0, 1.0); + glRotatef(theta*180.0/pi, 0.0, 0.0, 1.0); glTranslatef(_thickness, 0.0, 0.0); glBegin(GL_TRIANGLES); glVertex2f(0.0, _thickness); diff --git a/dart/gui/Trackball.cpp b/dart/gui/Trackball.cpp index 7607e69591829..41b61eb72cb1a 100644 --- a/dart/gui/Trackball.cpp +++ b/dart/gui/Trackball.cpp @@ -32,6 +32,7 @@ #include "dart/gui/Trackball.hpp" +#include "dart/math/Constants.hpp" #include "dart/gui/LoadOpengl.hpp" namespace dart { @@ -68,6 +69,8 @@ void Trackball::applyGLRotation() { } void Trackball::draw(int _winWidth, int _winHeight) { + const double pi = math::constantsd::pi(); + glDisable(GL_LIGHTING); glDisable(GL_TEXTURE_2D); @@ -85,7 +88,7 @@ void Trackball::draw(int _winWidth, int _winHeight) { glColor3f(1.0f, 1.0f, 0.0f); glBegin(GL_LINE_LOOP); for (int i = 0; i < 360; i += 4) { - double theta = i / 180.0 * M_PI; + double theta = i / 180.0 * pi; double x = mRadius * cos(theta); double y = mRadius * sin(theta); glVertex2d(static_cast((_winWidth >> 1) + x), diff --git a/dart/gui/Win3D.cpp b/dart/gui/Win3D.cpp index 25d739211ab38..f11b8ef1ab669 100644 --- a/dart/gui/Win3D.cpp +++ b/dart/gui/Win3D.cpp @@ -34,6 +34,7 @@ #include +#include "dart/math/Constants.hpp" #include "dart/gui/LoadGlut.hpp" namespace dart { @@ -295,7 +296,9 @@ void accPerspective(GLdouble fovy, GLdouble aspect, GLdouble nearPlane, GLdouble farPlane, GLdouble pixdx, GLdouble pixdy, GLdouble eyedx, GLdouble eyedy, GLdouble focus) { - GLdouble fov2 = ((fovy*M_PI) / 180.0) / 2.0; + const double pi = math::constantsd::pi(); + + GLdouble fov2 = ((fovy*pi) / 180.0) / 2.0; GLdouble top = nearPlane / (cosf(fov2) / sinf(fov2)); GLdouble bottom = -top; GLdouble right = top * aspect; diff --git a/dart/math/Geometry.cpp b/dart/math/Geometry.cpp index c9659fccc20ee..c549190933453 100644 --- a/dart/math/Geometry.cpp +++ b/dart/math/Geometry.cpp @@ -1591,8 +1591,8 @@ Eigen::Vector2d computeCentroidOfHull(const SupportPolygon& _convexHull) if(BEYOND_ENDPOINTS == result) { - double a1 = atan2( (p1-p0)[1], (p1-p0)[0] )*180.0/M_PI; - double a2 = atan2( (p2-p0)[1], (p2-p0)[0] )*180.0/M_PI; + double a1 = atan2( (p1-p0)[1], (p1-p0)[0] )*180.0/constantsd::pi(); + double a2 = atan2( (p2-p0)[1], (p2-p0)[0] )*180.0/constantsd::pi(); double diff = a1-a2; dtwarn << "[computeCentroidOfHull] You have passed in a set of points " << "which is not a proper convex hull! The invalid segment " diff --git a/dart/math/Geometry.hpp b/dart/math/Geometry.hpp index 90ba02fa12958..1d351a4b4aaa4 100644 --- a/dart/math/Geometry.hpp +++ b/dart/math/Geometry.hpp @@ -36,6 +36,7 @@ #include #include "dart/common/Deprecated.hpp" +#include "dart/math/Constants.hpp" #include "dart/math/MathTypes.hpp" namespace dart { @@ -461,7 +462,9 @@ bool verifyTransform(const Eigen::Isometry3d& _T); /// rotations inline double wrapToPi(double angle) { - return std::fmod(angle+M_PI, 2*M_PI) - M_PI; + constexpr auto pi = constantsd::pi(); + + return std::fmod(angle+pi, 2*pi) - pi; } template diff --git a/dart/planning/Path.cpp b/dart/planning/Path.cpp index d35468297d224..0462f44373210 100644 --- a/dart/planning/Path.cpp +++ b/dart/planning/Path.cpp @@ -39,6 +39,7 @@ #include #include #include +#include "dart/math/Constants.hpp" using namespace std; using namespace Eigen; @@ -148,12 +149,13 @@ class CircularPathSegment : public PathSegment } list getSwitchingPoints() const { + const double pi = math::constantsd::pi(); list switchingPoints; const double dim = x.size(); for(unsigned int i = 0; i < dim; i++) { double switchingAngle = atan2(y[i], x[i]); if(switchingAngle < 0.0) { - switchingAngle += M_PI; + switchingAngle += pi; } const double switchingPoint = switchingAngle * radius; if(switchingPoint < length) { From dbec50c0e36ba3f1dd9e150e2d585db38792d398 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Thu, 11 Jan 2018 14:20:48 -0800 Subject: [PATCH 2/7] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cc9f1c27580b..196fca737454a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ * Misc * Suppressed warnings: [#937](https://github.com/dartsim/dart/pull/937) + * Fixed various build issues with Visual Studio: [#956](https://github.com/dartsim/dart/pull/956) ### [DART 6.3.0 (2017-10-04)](https://github.com/dartsim/dart/milestone/36?closed=1) From 714f097c8166b9f0792062f317d0b42b84961564 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Thu, 11 Jan 2018 14:25:42 -0800 Subject: [PATCH 3/7] Update .appveyor.yml --- .appveyor.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 20dced2370be1..5da704df538d2 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -48,16 +48,16 @@ install: - vcpkg install fcl:%VCPKG_ARCH% - vcpkg install assimp:%VCPKG_ARCH% # ---- optional dependencies: nlopt, ipopt, bullet3, ode, flann, tinyxml2, urdfdom_headers, urdfdom, opengl, freeglut, osg - #- vcpkg install nlopt:%VCPKG_ARCH% + - vcpkg install nlopt:%VCPKG_ARCH% #- vcpkg install ipopt:%VCPKG_ARCH% - #- vcpkg install bullet3:%VCPKG_ARCH% - #- vcpkg install ode:%VCPKG_ARCH% - #- vcpkg install flann:%VCPKG_ARCH% - #- vcpkg install tinyxml2:%VCPKG_ARCH% - #- vcpkg install urdfdom_headers:%VCPKG_ARCH% - #- vcpkg install urdfdom:%VCPKG_ARCH% - #- vcpkg install opengl:%VCPKG_ARCH% - #- vcpkg install freeglut:%VCPKG_ARCH% + - vcpkg install bullet3:%VCPKG_ARCH% + - vcpkg install ode:%VCPKG_ARCH% + - vcpkg install flann:%VCPKG_ARCH% + - vcpkg install tinyxml2:%VCPKG_ARCH% + - vcpkg install urdfdom_headers:%VCPKG_ARCH% + - vcpkg install urdfdom:%VCPKG_ARCH% + - vcpkg install opengl:%VCPKG_ARCH% + - vcpkg install freeglut:%VCPKG_ARCH% #- vcpkg install osg:%VCPKG_ARCH% - vcpkg integrate install From db6a2d83da0266862f5046e0cbbf35459b3303cf Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Thu, 11 Jan 2018 17:18:29 -0800 Subject: [PATCH 4/7] Fix package name: urdfdom_headers --> urdfdom-headers --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 5da704df538d2..e7de21f8354e8 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -54,7 +54,7 @@ install: - vcpkg install ode:%VCPKG_ARCH% - vcpkg install flann:%VCPKG_ARCH% - vcpkg install tinyxml2:%VCPKG_ARCH% - - vcpkg install urdfdom_headers:%VCPKG_ARCH% + - vcpkg install urdfdom-headers:%VCPKG_ARCH% - vcpkg install urdfdom:%VCPKG_ARCH% - vcpkg install opengl:%VCPKG_ARCH% - vcpkg install freeglut:%VCPKG_ARCH% From ee0ea1fb93d315d3c7fe9bae2a5a42e6966e5e8f Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Thu, 11 Jan 2018 20:54:34 -0800 Subject: [PATCH 5/7] Update .appveyor.yml --- .appveyor.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index e7de21f8354e8..d839788733545 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -28,9 +28,6 @@ clone_folder: C:\projects\dart # branches to build branches: - # whitelist - # only: - # - master # blacklist except: - gh-pages From 3f623d70b6f88cb96fb04c5b519c458cded555cb Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Thu, 11 Jan 2018 21:49:29 -0800 Subject: [PATCH 6/7] Update .appveyor.yml --- .appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index d839788733545..d770ecf5baa14 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -53,8 +53,8 @@ install: - vcpkg install tinyxml2:%VCPKG_ARCH% - vcpkg install urdfdom-headers:%VCPKG_ARCH% - vcpkg install urdfdom:%VCPKG_ARCH% - - vcpkg install opengl:%VCPKG_ARCH% - - vcpkg install freeglut:%VCPKG_ARCH% + #- vcpkg install opengl:%VCPKG_ARCH% + #- vcpkg install freeglut:%VCPKG_ARCH% #- vcpkg install osg:%VCPKG_ARCH% - vcpkg integrate install From a110a8717226233c603d189943b52d80fe460a03 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 12 Jan 2018 05:53:54 -0800 Subject: [PATCH 7/7] Install only required dependencies --- .appveyor.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index d770ecf5baa14..59f37f12ddf38 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -45,14 +45,14 @@ install: - vcpkg install fcl:%VCPKG_ARCH% - vcpkg install assimp:%VCPKG_ARCH% # ---- optional dependencies: nlopt, ipopt, bullet3, ode, flann, tinyxml2, urdfdom_headers, urdfdom, opengl, freeglut, osg - - vcpkg install nlopt:%VCPKG_ARCH% + #- vcpkg install nlopt:%VCPKG_ARCH% #- vcpkg install ipopt:%VCPKG_ARCH% - - vcpkg install bullet3:%VCPKG_ARCH% - - vcpkg install ode:%VCPKG_ARCH% - - vcpkg install flann:%VCPKG_ARCH% - - vcpkg install tinyxml2:%VCPKG_ARCH% - - vcpkg install urdfdom-headers:%VCPKG_ARCH% - - vcpkg install urdfdom:%VCPKG_ARCH% + #- vcpkg install bullet3:%VCPKG_ARCH% + #- vcpkg install ode:%VCPKG_ARCH% + #- vcpkg install flann:%VCPKG_ARCH% + #- vcpkg install tinyxml2:%VCPKG_ARCH% + #- vcpkg install urdfdom-headers:%VCPKG_ARCH% + #- vcpkg install urdfdom:%VCPKG_ARCH% #- vcpkg install opengl:%VCPKG_ARCH% #- vcpkg install freeglut:%VCPKG_ARCH% #- vcpkg install osg:%VCPKG_ARCH%