From a9600a8c91fb547efb39ec5c5c5c5d91ede390d8 Mon Sep 17 00:00:00 2001 From: Jie Date: Fri, 27 Oct 2017 14:56:45 -0700 Subject: [PATCH 1/4] adjust the minitaur_derpy urdf. Seperate the motor controller and the moving part of the motor. --- data/quadruped/minitaur_derpy.urdf | 230 ++++++++++++++++++++++------- 1 file changed, 177 insertions(+), 53 deletions(-) diff --git a/data/quadruped/minitaur_derpy.urdf b/data/quadruped/minitaur_derpy.urdf index 030a297cb..a5fbcf033 100644 --- a/data/quadruped/minitaur_derpy.urdf +++ b/data/quadruped/minitaur_derpy.urdf @@ -63,7 +63,7 @@ - + @@ -72,12 +72,49 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -88,18 +125,43 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -125,7 +187,7 @@ - + @@ -134,12 +196,49 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -150,18 +249,43 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -185,19 +309,19 @@ - + - - + + - + @@ -213,19 +337,19 @@ - + - - + + - + @@ -241,19 +365,19 @@ - + - - + + - + @@ -269,19 +393,19 @@ - + - - + + - + @@ -297,19 +421,19 @@ - + - - + + - + @@ -325,19 +449,19 @@ - + - - + + - + @@ -353,19 +477,19 @@ - + - - + + - + @@ -381,19 +505,19 @@ - + - - + + - + @@ -423,7 +547,7 @@ - + @@ -491,7 +615,7 @@ - + @@ -560,7 +684,7 @@ - + @@ -628,7 +752,7 @@ - + @@ -697,7 +821,7 @@ - + @@ -765,7 +889,7 @@ - + @@ -834,7 +958,7 @@ - + @@ -902,7 +1026,7 @@ - + @@ -946,4 +1070,4 @@ - \ No newline at end of file + From 1f564d5c575c62460c57f7900effccea1d031b3b Mon Sep 17 00:00:00 2001 From: Joey Liaw Date: Fri, 27 Oct 2017 16:32:35 -0700 Subject: [PATCH 2/4] only probe for python if PYBULLET explicitly specified --- CMakeLists.txt | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0e62d396..a8664ec33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,25 +301,26 @@ IF (APPLE) ENDIF() OPTION(BUILD_BULLET3 "Set when you want to build Bullet 3" ON) + # Optional Python configuration -# builds pybullet automatically if all the requirements are met -SET(PYTHON_VERSION_PYBULLET "" CACHE STRING "Python version pybullet will use.") -SET(Python_ADDITIONAL_VERSIONS 3 3.6 3.5 3.4 3.3 3.2 3.1 3.0 2.7 2.7.12 2.7.10 2.7.3 ) -SET_PROPERTY(CACHE PYTHON_VERSION_PYBULLET PROPERTY STRINGS ${Python_ADDITIONAL_VERSIONS}) -SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build3/cmake ${CMAKE_MODULE_PATH}) -OPTION(EXACT_PYTHON_VERSION "Require Python and match PYTHON_VERSION_PYBULLET exactly, e.g. 2.7.12" OFF) -IF(EXACT_PYTHON_VERSION) - set(EXACT_PYTHON_VERSION_FLAG EXACT REQUIRED) -ENDIF(EXACT_PYTHON_VERSION) -# first find the python interpreter -FIND_PACKAGE(PythonInterp ${PYTHON_VERSION_PYBULLET} ${EXACT_PYTHON_VERSION_FLAG}) -# python library should exactly match that of the interpreter -FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_STRING} EXACT) -SET(DEFAULT_BUILD_PYBULLET OFF) -IF(PYTHONLIBS_FOUND) - SET(DEFAULT_BUILD_PYBULLET ON) -ENDIF(PYTHONLIBS_FOUND) -OPTION(BUILD_PYBULLET "Set when you want to build pybullet (Python bindings for Bullet)" ${DEFAULT_BUILD_PYBULLET}) +# Will not probe environment for Python configuration (which can abort the +# build process) unless you explicitly turn on BUILD_PYBULLET. +OPTION(BUILD_PYBULLET "Set when you want to build pybullet (Python bindings for Bullet)" OFF) +IF(BUILD_PYBULLET) + SET(PYTHON_VERSION_PYBULLET "" CACHE STRING "Python version pybullet will use.") + SET(Python_ADDITIONAL_VERSIONS 3 3.6 3.5 3.4 3.3 3.2 3.1 3.0 2.7 2.7.12 2.7.10 2.7.3 ) + SET_PROPERTY(CACHE PYTHON_VERSION_PYBULLET PROPERTY STRINGS ${Python_ADDITIONAL_VERSIONS}) + SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build3/cmake ${CMAKE_MODULE_PATH}) + OPTION(EXACT_PYTHON_VERSION "Require Python and match PYTHON_VERSION_PYBULLET exactly, e.g. 2.7.12" OFF) + IF(EXACT_PYTHON_VERSION) + set(EXACT_PYTHON_VERSION_FLAG EXACT REQUIRED) + ENDIF(EXACT_PYTHON_VERSION) + # first find the python interpreter + FIND_PACKAGE(PythonInterp ${PYTHON_VERSION_PYBULLET} ${EXACT_PYTHON_VERSION_FLAG}) + # python library should exactly match that of the interpreter + # the following can result in fatal error if you don't have the right python configuration + FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_STRING} EXACT) +ENDIF(BUILD_PYBULLET) OPTION(BUILD_ENET "Set when you want to build apps with enet UDP networking support" ON) OPTION(BUILD_CLSOCKET "Set when you want to build apps with enet TCP networking support" ON) From 88b49947b5b4c130be63a2cd43008c307e4a59fa Mon Sep 17 00:00:00 2001 From: d3x0r Date: Sat, 28 Oct 2017 14:42:38 -0700 Subject: [PATCH 3/4] Composite of fixed code for mingw64(on windows) and general fixes for msvc. 1) (win32window) don't convert char to wide, use char direct to window. 2) (CMakeLists) Don't link one library as static CPPLIB and no others (mismatched allocations) 3) (macros) Fix Gwen macros for mingw64 on windows build. (changes are by compiler(msc_ver) not platform) 4) (FileUtils) sprintf_s reference by platform, not compiler (mingw64 support) 5) (b3OpenCLUtils) fix bad define name _MSVC_VER->_MSC_VER 6) (compoundCollision) remove unused variables, simplify operation. 7) (impulseconstraint) remove duplicated code block --- examples/OpenGLWindow/Win32Window.cpp | 10 +++------- examples/ThirdPartyLibs/Gwen/CMakeLists.txt | 2 +- examples/ThirdPartyLibs/Gwen/Macros.h | 12 +++++++++--- src/Bullet3Common/b3FileUtils.h | 2 +- src/Bullet3OpenCL/Initialize/b3OpenCLUtils.cpp | 2 +- .../btCompoundCompoundCollisionAlgorithm.cpp | 12 ++---------- .../btSequentialImpulseConstraintSolver.cpp | 3 --- 7 files changed, 17 insertions(+), 26 deletions(-) diff --git a/examples/OpenGLWindow/Win32Window.cpp b/examples/OpenGLWindow/Win32Window.cpp index 3b74808d4..bf647165a 100644 --- a/examples/OpenGLWindow/Win32Window.cpp +++ b/examples/OpenGLWindow/Win32Window.cpp @@ -439,15 +439,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) void Win32Window::setWindowTitle(const char* titleChar) { - wchar_t windowTitle[1024]; - swprintf(windowTitle, 1024, L"%hs", titleChar); - #ifdef _WIN64 - SetWindowTextW(m_data->m_hWnd, windowTitle); + SetWindowText(m_data->m_hWnd, titleChar); #else - DWORD dwResult; - SendMessageTimeoutW(m_data->m_hWnd, WM_SETTEXT, 0, - reinterpret_cast(windowTitle), + SendMessageTimeout(m_data->m_hWnd, WM_SETTEXT, 0, + reinterpret_cast(titleChar), SMTO_ABORTIFHUNG, 2000, &dwResult); #endif } diff --git a/examples/ThirdPartyLibs/Gwen/CMakeLists.txt b/examples/ThirdPartyLibs/Gwen/CMakeLists.txt index 82fa0ffba..0ebf59c4b 100644 --- a/examples/ThirdPartyLibs/Gwen/CMakeLists.txt +++ b/examples/ThirdPartyLibs/Gwen/CMakeLists.txt @@ -15,7 +15,7 @@ IF(NOT WIN32 AND NOT APPLE) ADD_DEFINITIONS("-DDYNAMIC_LOAD_X11_FUNCTIONS=1") ENDIF() -ADD_DEFINITIONS( -DGLEW_STATIC -DGWEN_COMPILE_STATIC -D_HAS_EXCEPTIONS=0 -D_STATIC_CPPLIB ) +ADD_DEFINITIONS( -DGLEW_STATIC -DGWEN_COMPILE_STATIC -D_HAS_EXCEPTIONS=0 ) FILE(GLOB gwen_SRCS "*.cpp" "Controls/*.cpp" "Controls/Dialog/*.cpp" "Controls/Dialogs/*.cpp" "Controls/Layout/*.cpp" "Controls/Property/*.cpp" "Input/*.cpp" "Platforms/*.cpp" "Renderers/*.cpp" "Skins/*.cpp") FILE(GLOB gwen_HDRS "*.h" "Controls/*.h" "Controls/Dialog/*.h" "Controls/Dialogs/*.h" "Controls/Layout/*.h" "Controls/Property/*.h" "Input/*.h" "Platforms/*.h" "Renderers/*.h" "Skins/*.h") diff --git a/examples/ThirdPartyLibs/Gwen/Macros.h b/examples/ThirdPartyLibs/Gwen/Macros.h index 71d878c12..27359152d 100644 --- a/examples/ThirdPartyLibs/Gwen/Macros.h +++ b/examples/ThirdPartyLibs/Gwen/Macros.h @@ -4,6 +4,7 @@ #define GWEN_MACROS_H #include #include +#include // vsnprintf #if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) #include #else @@ -17,7 +18,7 @@ #define GwenUtil_Max( a, b ) ( ( (a) > (b) ) ? (a) : (b) ) #define GwenUtil_VSWPrintFSafeSized( _DstBuf_ARRAY_, _Format, _ArgList ) GwenUtil_VSWPrintFSafe( _DstBuf_ARRAY_, sizeof( _DstBuf_ARRAY_ ) / sizeof( wchar_t ), _Format, _ArgList ) -#ifdef _WIN32 +#ifdef _MSC_VER #ifndef NOMINMAX #define NOMINMAX @@ -40,10 +41,15 @@ #define GwenUtil_OutputDebugWideString( lpOutputString ) //wprintf( lpOutputString ) #define GwenUtil_WideStringToFloat( _Str ) wcstof(_Str, NULL) -#elif defined(__linux__) || defined(__OpenBSD__) + +#elif defined(__linux__) || defined( __GNUC__ ) #define GwenUtil_VSNPrintFSafe( _DstBuf, _DstSize, _MaxCount, _Format, _ArgList ) vsnprintf( _DstBuf, _DstSize, _Format, _ArgList ) - #define GwenUtil_VSWPrintFSafe( _DstBuf, _SizeInWords, _Format, _ArgList ) vswprintf( _DstBuf, _SizeInWords, _Format, _ArgList ) + #ifdef _WIN32 + #define GwenUtil_VSWPrintFSafe( _DstBuf, _SizeInWords, _Format, _ArgList ) vsnwprintf( _DstBuf, _SizeInWords, _Format, _ArgList ) + #else + #define GwenUtil_VSWPrintFSafe( _DstBuf, _SizeInWords, _Format, _ArgList ) vswprintf( _DstBuf, _SizeInWords, _Format, _ArgList ) + #endif #define GwenUtil_OutputDebugCharString( lpOutputString ) //printf( lpOutputString ) #define GwenUtil_OutputDebugWideString( lpOutputString ) //wprintf( lpOutputString ) #define GwenUtil_WideStringToFloat( _Str ) wcstof(_Str, NULL) diff --git a/src/Bullet3Common/b3FileUtils.h b/src/Bullet3Common/b3FileUtils.h index 1a331029e..b5e8225cf 100644 --- a/src/Bullet3Common/b3FileUtils.h +++ b/src/Bullet3Common/b3FileUtils.h @@ -36,7 +36,7 @@ struct b3FileUtils for (int i=0;!f && igetChildShape(pairs[i].m_indexA); - orgTrans0 = col0ObjWrap->getWorldTransform(); - orgInterpolationTrans0 = col0ObjWrap->getWorldTransform(); const btTransform& childTrans0 = compoundShape0->getChildTransform(pairs[i].m_indexA); - newChildWorldTrans0 = orgTrans0*childTrans0 ; + newChildWorldTrans0 = col0ObjWrap->getWorldTransform()*childTrans0 ; childShape0->getAabb(newChildWorldTrans0,aabbMin0,aabbMax0); } btVector3 thresholdVec(resultOut->m_closestPointDistanceThreshold, resultOut->m_closestPointDistanceThreshold, resultOut->m_closestPointDistanceThreshold); aabbMin0 -= thresholdVec; aabbMax0 += thresholdVec; { - btTransform orgInterpolationTrans1; const btCollisionShape* childShape1 = 0; - btTransform orgTrans1; btTransform newChildWorldTrans1; childShape1 = compoundShape1->getChildShape(pairs[i].m_indexB); - orgTrans1 = col1ObjWrap->getWorldTransform(); - orgInterpolationTrans1 = col1ObjWrap->getWorldTransform(); const btTransform& childTrans1 = compoundShape1->getChildTransform(pairs[i].m_indexB); - newChildWorldTrans1 = orgTrans1*childTrans1 ; + newChildWorldTrans1 = col1ObjWrap->getWorldTransform()*childTrans1 ; childShape1->getAabb(newChildWorldTrans1,aabbMin1,aabbMax1); } diff --git a/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp b/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp index b0d57a3e8..1b2f211a1 100644 --- a/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp +++ b/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp @@ -1425,9 +1425,6 @@ btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup(btCol fb->m_appliedTorqueBodyB.setZero(); } - if (constraints[i]->isEnabled()) - { - } if (constraints[i]->isEnabled()) { constraints[i]->getInfo1(&info1); From 8e75d4375b505604497d5d52e2e59292a6e13cfd Mon Sep 17 00:00:00 2001 From: d3x0r Date: Sat, 28 Oct 2017 14:50:44 -0700 Subject: [PATCH 4/4] Fix missing DWORD variable (lost in merge port) --- examples/OpenGLWindow/Win32Window.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/OpenGLWindow/Win32Window.cpp b/examples/OpenGLWindow/Win32Window.cpp index bf647165a..78d590cc2 100644 --- a/examples/OpenGLWindow/Win32Window.cpp +++ b/examples/OpenGLWindow/Win32Window.cpp @@ -442,6 +442,7 @@ void Win32Window::setWindowTitle(const char* titleChar) #ifdef _WIN64 SetWindowText(m_data->m_hWnd, titleChar); #else + DWORD dwResult; SendMessageTimeout(m_data->m_hWnd, WM_SETTEXT, 0, reinterpret_cast(titleChar), SMTO_ABORTIFHUNG, 2000, &dwResult);