Merge pull request #2501 from erwincoumans/master
bump up pybullet version, fix old examples
This commit is contained in:
@@ -29,6 +29,7 @@ void SamplelsMemoryReleaseFunc(void* ptr);
|
|||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#include "b3PosixThreadSupport.h"
|
#include "b3PosixThreadSupport.h"
|
||||||
|
|
||||||
|
|
||||||
b3ThreadSupportInterface* createThreadSupport(int numThreads)
|
b3ThreadSupportInterface* createThreadSupport(int numThreads)
|
||||||
{
|
{
|
||||||
b3PosixThreadSupport::ThreadConstructionInfo constructionInfo("testThreads",
|
b3PosixThreadSupport::ThreadConstructionInfo constructionInfo("testThreads",
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
void SampleThreadFunc(void* userPtr, void* lsMemory);
|
void SampleThreadFunc(void* userPtr, void* lsMemory);
|
||||||
void* SamplelsMemoryFunc();
|
void* SamplelsMemoryFunc();
|
||||||
|
void SamplelsMemoryReleaseFunc(void* ptr);
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
//#include "BulletMultiThreaded/PlatformDefinitions.h"
|
//#include "BulletMultiThreaded/PlatformDefinitions.h"
|
||||||
|
|
||||||
@@ -34,6 +34,7 @@ b3ThreadSupportInterface* createThreadSupport(int numThreads)
|
|||||||
b3PosixThreadSupport::ThreadConstructionInfo constructionInfo("testThreads",
|
b3PosixThreadSupport::ThreadConstructionInfo constructionInfo("testThreads",
|
||||||
SampleThreadFunc,
|
SampleThreadFunc,
|
||||||
SamplelsMemoryFunc,
|
SamplelsMemoryFunc,
|
||||||
|
SamplelsMemoryReleaseFunc,
|
||||||
numThreads);
|
numThreads);
|
||||||
b3ThreadSupportInterface* threadSupport = new b3PosixThreadSupport(constructionInfo);
|
b3ThreadSupportInterface* threadSupport = new b3PosixThreadSupport(constructionInfo);
|
||||||
|
|
||||||
@@ -99,6 +100,13 @@ void* SamplelsMemoryFunc()
|
|||||||
return new SampleThreadLocalStorage;
|
return new SampleThreadLocalStorage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SamplelsMemoryReleaseFunc(void* ptr)
|
||||||
|
{
|
||||||
|
SampleThreadLocalStorage* p = (SampleThreadLocalStorage*)ptr;
|
||||||
|
delete p;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
int numThreads = 8;
|
int numThreads = 8;
|
||||||
|
|||||||
@@ -404,7 +404,7 @@ B3_SHARED_API int b3LoadSoftBodySetCollisionHardness(b3SharedMemoryCommandHandle
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
B3_SHARED_API int b3LoadSoftBodyUseSelfCollision(b3SharedMemoryCommandHandle commandHandle, int useSelfCollision)
|
B3_SHARED_API int b3LoadSoftBodySetSelfCollision(b3SharedMemoryCommandHandle commandHandle, int useSelfCollision)
|
||||||
{
|
{
|
||||||
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*)commandHandle;
|
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*)commandHandle;
|
||||||
b3Assert(command->m_type == CMD_LOAD_SOFT_BODY);
|
b3Assert(command->m_type == CMD_LOAD_SOFT_BODY);
|
||||||
|
|||||||
@@ -640,7 +640,7 @@ extern "C"
|
|||||||
B3_SHARED_API int b3LoadSoftBodyAddMassSpringForce(b3SharedMemoryCommandHandle commandHandle, double springElasticStiffness , double springDampingStiffness);
|
B3_SHARED_API int b3LoadSoftBodyAddMassSpringForce(b3SharedMemoryCommandHandle commandHandle, double springElasticStiffness , double springDampingStiffness);
|
||||||
B3_SHARED_API int b3LoadSoftBodyAddGravityForce(b3SharedMemoryCommandHandle commandHandle, double gravityX, double gravityY, double gravityZ);
|
B3_SHARED_API int b3LoadSoftBodyAddGravityForce(b3SharedMemoryCommandHandle commandHandle, double gravityX, double gravityY, double gravityZ);
|
||||||
B3_SHARED_API int b3LoadSoftBodySetCollisionHardness(b3SharedMemoryCommandHandle commandHandle, double collisionHardness);
|
B3_SHARED_API int b3LoadSoftBodySetCollisionHardness(b3SharedMemoryCommandHandle commandHandle, double collisionHardness);
|
||||||
B3_SHARED_API int b3LoadSoftBodyUseSelfCollision(b3SharedMemoryCommandHandle commandHandle, int useSelfCollision);
|
B3_SHARED_API int b3LoadSoftBodySetSelfCollision(b3SharedMemoryCommandHandle commandHandle, int useSelfCollision);
|
||||||
B3_SHARED_API int b3LoadSoftBodyUseFaceContact(b3SharedMemoryCommandHandle commandHandle, int useFaceContact);
|
B3_SHARED_API int b3LoadSoftBodyUseFaceContact(b3SharedMemoryCommandHandle commandHandle, int useFaceContact);
|
||||||
B3_SHARED_API int b3LoadSoftBodySetFrictionCoefficient(b3SharedMemoryCommandHandle commandHandle, double frictionCoefficient);
|
B3_SHARED_API int b3LoadSoftBodySetFrictionCoefficient(b3SharedMemoryCommandHandle commandHandle, double frictionCoefficient);
|
||||||
B3_SHARED_API int b3LoadSoftBodyUseBendingSprings(b3SharedMemoryCommandHandle commandHandle, int useBendingSprings);
|
B3_SHARED_API int b3LoadSoftBodyUseBendingSprings(b3SharedMemoryCommandHandle commandHandle, int useBendingSprings);
|
||||||
|
|||||||
@@ -807,7 +807,10 @@ class HumanoidStablePD(object):
|
|||||||
rootPosSim, rootOrnSim = self._pybullet_client.getBasePositionAndOrientation(self._sim_model)
|
rootPosSim, rootOrnSim = self._pybullet_client.getBasePositionAndOrientation(self._sim_model)
|
||||||
rootPosKin, rootOrnKin = self._pybullet_client.getBasePositionAndOrientation(self._kin_model)
|
rootPosKin, rootOrnKin = self._pybullet_client.getBasePositionAndOrientation(self._kin_model)
|
||||||
linVelSim, angVelSim = self._pybullet_client.getBaseVelocity(self._sim_model)
|
linVelSim, angVelSim = self._pybullet_client.getBaseVelocity(self._sim_model)
|
||||||
linVelKin, angVelKin = self._pybullet_client.getBaseVelocity(self._kin_model)
|
#don't read the velocities from the kinematic model (they are zero), use the pose interpolator velocity
|
||||||
|
#see also issue https://github.com/bulletphysics/bullet3/issues/2401
|
||||||
|
linVelKin = self._poseInterpolator._baseLinVel
|
||||||
|
angVelKin = self._poseInterpolator._baseAngVel
|
||||||
|
|
||||||
root_rot_err = self.calcRootRotDiff(rootOrnSim, rootOrnKin)
|
root_rot_err = self.calcRootRotDiff(rootOrnSim, rootOrnKin)
|
||||||
pose_err += root_rot_w * root_rot_err
|
pose_err += root_rot_w * root_rot_err
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -491,7 +491,7 @@ if 'BT_USE_EGL' in EGL_CXX_FLAGS:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='pybullet',
|
name='pybullet',
|
||||||
version='2.5.7',
|
version='2.5.8',
|
||||||
description=
|
description=
|
||||||
'Official Python Interface for the Bullet Physics SDK specialized for Robotics Simulation and Reinforcement Learning',
|
'Official Python Interface for the Bullet Physics SDK specialized for Robotics Simulation and Reinforcement Learning',
|
||||||
long_description=
|
long_description=
|
||||||
|
|||||||
Reference in New Issue
Block a user