Commit Graph

775 Commits

Author SHA1 Message Date
Erwin Coumans
2cab56d6ef prepare build system(s) for collisionFilterPlugin 2018-07-27 15:48:24 +02:00
erwincoumans
3d5c921495
Merge pull request #1782 from RanTig/userdata
Changes UserData to use global identifiers and makes linkIndex optional.
2018-07-09 11:36:51 +02:00
Erwin Coumans
f8cc33f3a3 Merge branch 'master' of https://github.com/erwincoumans/bullet3 2018-07-08 11:24:37 +02:00
Erwin Coumans
127b82ec1b expose texture unique id after loading URD file, so you can restore to the original texture after changing it to a custom texture. See also getTextureUid.py example. 2018-07-08 11:23:12 +02:00
Tigran Gasparian
9c7aa3a863 Changes UserData to use global identifiers and makes linkIndex optional.
This removes the need to specify the body id/link index when retrieving a user data entry.
Additionally, user data can now optionally be set to visual shapes as well.

The following public pybullet APIs have changed (backwards incompatible)
addUserData and getUserDataId
  Makes linkIndex parameter optional (default value is -1)
  Adds optional visualShapeIndex parameter (default value is -1)

getUserData and removeUserData
  Removes required parameters bodyUniqueId and linkIndex

getNumUserData
  Removes required bodyUniqueId parameter

getUserDataInfo
  Removes required linkIndex parameter
  Changes returned tuple from (userDataId, key) to (userDataId, key, bodyUniqueId, linkIndex, visualShapeIndex)
2018-07-03 17:45:19 +02:00
erwincoumans
23f235e449 PyBullet: add example to enable another physics engine backend (DART, MuJoCo) 2018-07-01 14:49:34 -07:00
erwincoumans
0d8564db22 PyBullet: added preliminary DART and MuJoCo backend files, MuJoCo can loadMJCF, stepSimulation and getBasePositionAndOrientation, DART is empty.
PyBullet: add 2d biped example.,
2018-07-01 14:42:32 -07:00
erwincoumans
49b0ec08e1 PyBullet: allow to replace existing debug lines in addUserDebugLine through the replaceItemUniqueId argument
See batchRayCast.py for example usage
2018-06-22 16:47:20 -07:00
Erwin Coumans
092e39a9e5 PyBullet urdfEditor example, use the pybullet_utils version (more up-to-date) 2018-06-22 09:18:55 -07:00
Erwin Coumans
fcde193d52 PyBullet.setPhysicsEngineParameter: only update solverResidualThreshold if valid values is given 2018-06-20 13:18:08 -07:00
erwincoumans
7924d51665 PyBullet: deal with backward compatibility of b3RaycastBatchAddRay:
use b3RaycastBatchAddRays API to enable MAX_RAY_INTERSECTION_BATCH_SIZE_STREAMING num rays.
Old API (b3RaycastBatchAddRay) sticks to 256 rays, MAX_RAY_INTERSECTION_BATCH_SIZE.
2018-06-16 12:28:21 -07:00
erwincoumans
cb1fce7899 revert exposing getSharedMemoryStreamBuffer / adding to command structure
use 16k rays by default
add uploadRaysToSharedMemory method
2018-06-16 08:14:00 -07:00
erwincoumans
23f9250e04 Merge remote-tracking branch 'bp/master' 2018-06-16 06:58:10 -07:00
erwincoumans
d660042d76
Merge pull request #1763 from YunfeiBai/master
Add the pdControlPlugin to the joint control C API, and add the PD co…
2018-06-16 06:57:50 -07:00
erwincoumans
75ec8f3fd9 PyBullet: add batchRayCast.py example 2018-06-16 06:20:15 -07:00
erwincoumans
f517b03534 Expose pushProfileTimer / pop ProfileTimer in PhysicsClient API to benchmark Python parts of PyBullet.
reduce 'm_cooldownTime' from 1000 microseconds to 100 microseconds (overhead in raycast is too large)
If needed, we can expose this cooldown time.
Replace malloc by btAlignedObjectArray (going through Bullet's memory allocator)
2018-06-16 06:19:49 -07:00
erwincoumans
bb8cbcdaae Merge remote-tracking branch 'bp/master' 2018-06-16 06:06:18 -07:00
erwincoumans
5b3e43d4d8
Merge pull request #1760 from RanTig/ParallelRaycasts
Adds multithreading support for batch ray casts.
2018-06-16 05:54:34 -07:00
Alexis David Jacq
6adea4964f
forgot one "isAlive" to change 2018-06-16 14:00:05 +02:00
Alexis David Jacq
50b5edd7b5
isDone instead of isAlive 2018-06-16 13:53:05 +02:00
Erwin Coumans
fbbd675ed6 expose PyBullet API to wakeup/put objects to sleep, enable/disable deactivation
fix wakeup -> reset deactivation clock
2018-06-15 21:26:26 -07:00
YunfeiBai
1c0de3c4cb Add the pdControlPlugin to the joint control C API, and add the PD control mode (also available in pybullet). Modify the pdControl pybullet example to use the PD control mode with setJointMotorControl API. 2018-06-15 17:59:26 -07:00
Alexis David Jacq
292a3f1cf6
methode isAlive
Method def isAlive(self), which defaults to return self._alive < 0, and each environment can override this method (Half Cheetah would implement return False)

(In response to bea468fb93)
2018-06-15 17:55:20 +02:00
Tigran Gasparian
54986593c5 . 2018-06-15 17:46:31 +02:00
Tigran Gasparian
0b1dca3d9c Updates the documentation for the pybullet function rayTestBatch to include the numThreads parameter. 2018-06-15 17:46:12 +02:00
Alexis David Jacq
a57c480f28
Update gym_locomotion_envs.py
As suggested in https://github.com/bulletphysics/bullet3/pull/1759. The default isDone lets done = alive<0, and a special case is made for halfcheetah, forcing done=False. 
I had to pass the 'alive' condition as an additive parameter of WalkerBaseBulletEnv.
2018-06-15 17:38:35 +02:00
Erwin Coumans
976fea4eca fix saveRestoreState.py example 2018-06-15 08:31:39 -07:00
Tigran Gasparian
08409cae9f Adds multithreading support for batch ray casts.
To enable the feature, enable the BULLET2_MULTITHREADING option.

Increases the number of rays that can go in a batch request by storing
them in the shared memory stream instead of the shared memory command.
Adds the API b3RaycastBatchSetNumThreads to specify the number of
threads to use for the raycast batch, also adds the argument numThreads
to the pybullet function rayTestBatch.
Rays are distributed among the threads in a greedy fashion there's a shared
queue of work, once a thread finishes its task, it picks the next
available ray from the task. This works better than pre-distributing the
rays among threads, since there's a large variance in computation time per ray.

Some controversial changes:
- Added a pointer to PhysicsClient to the SharedMemoryCommand struct, this
was necessary to keep the C-API the same for b3RaycastBatchAddRay, while
adding the ray to the shared memory stream instead of the command
struct. I think this may be useful to simplify other APIs as well, that
take both a client handle and a command handle.
- Moved #define SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE to
SharedMemoryPublic. This was necessary for the definition of
MAX_RAY_INTERSECTION_BATCH_SIZE.
2018-06-15 16:47:04 +02:00
erwincoumans
25c5e87dc2 PyBullet.loadURDF, expose flags=URDF_INITIALIZE_SAT_FEATURES 2018-06-13 15:35:56 -07:00
Erwin Coumans
e24da97140 revert GJK change yet again, some degenerate case / regression 2018-06-12 19:52:38 -07:00
erwincoumans
4d6741f5cd PyBullet: expose STATE_LOGGING_ALL_COMMANDS and STATE_REPLAY_ALL_COMMANDS
See examples/pybullet/examples/commandLogAndPlayback.py for an example.
2018-06-12 16:56:45 -07:00
erwincoumans
459d07a302 add example for enableSAT, using separating axis test (instead of GJK) for contact between polyhedral convex hull shapes (and convex hull vs triangle in a concave triangle mesh) 2018-06-12 16:10:49 -07:00
erwincoumans
97c6937388 Simplify GJK. Still needs double precision for large differences of feature scales.
Extract faces directly from btConvexHullComputer (in initializePolyhedralFeatures), instead of reconstructing them, thanks to Josh Klint in #1654
PyBullet: use initializePolyhedralFeatures for convex hulls and boxes (to allow SAT)
PyBullet: expose setPhysicsEngineParameter(enableSAT=0 or 1) to enable Separating Axis Test based collision detection for convex vs convex/box and convex versus concave triangles (in a triangle mesh).
2018-06-12 16:08:46 -07:00
Erwin Coumans
e74f86d148 remove ANYmal meshes 2018-06-11 07:44:05 -07:00
erwincoumans
0cec85626f enable more unit tests in PyBullet.
return Py_None if no user data found, to pass the test.
enable m_deterministicOverlappingPairs by default.
if m_deterministicOverlappingPairs, sort the collision pairs.
2018-06-09 12:19:29 -07:00
erwincoumans
72d3f45b05 use new API b3CreateInProcessPhysicsServerFromExistingExampleBrowserAndConnect3 (not 2) 2018-06-05 19:54:08 -07:00
erwincoumans
5ede227e94
Update robot_bases.py
remove print
2018-06-05 19:33:28 -07:00
erwincoumans
b6f5cb4c34 enable pdControlPlugin by default (requires pdControlPlugin.cpp and b3RobotSimulatorClientAPI_NoDirect.cpp)
add pdControl.py example, make pdControlPlugin functional
reduce memory usage
fix examples/pybullet/gym/pybullet_data/random_urdfs/948/948.urdf, fixes issue #1704
2018-06-05 15:59:01 -07:00
erwincoumans
fa648a028e fix a few problems introduced in #1730
https://github.com/bulletphysics/bullet3/pull/1730
2018-06-05 09:16:00 -07:00
erwincoumans
d7cbe8dd26 Merge remote-tracking branch 'bp/master' 2018-06-05 08:15:11 -07:00
Tigran Gasparian
aefd5a9d66 Uses SHARED_MEMORY_SERVER instead of GUI_SERVER when starting a bullet server in the unit test. 2018-06-05 09:28:38 +02:00
Erwin Coumans
7bd84740d7 PyBullet / BulletRobotics: prepare for pdControlPlugin and collisionFilterPlugin
Split examples/SharedMemory/b3RobotSimulatorClientAPI_NoGUI.* and move to examples/SharedMemory/b3RobotSimulatorClientAPI_NoGUI.cpp and examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.cpp
2018-06-05 11:41:41 +10:00
Erwin Coumans
e4cd88e24f PyBullet: allow to choose the shared memory key when starting SHARED_MEMORY_SERVER 2018-06-05 11:36:54 +10:00
Tigran Gasparian
c49e060e81 Starts bullet server when testsuite is ran, uses pybullet_utils to manage clients. 2018-06-04 19:40:16 +02:00
Tigran Gasparian
bb72a91080 Clears the user data cache when syncUserData is called.
Adds unit test for the UserData functons.
Changes the char pointer in btHashString to std::string. There were
problems where the object owning the string memory would deallocate the
string, making the btHashString object invalid.
2018-06-04 15:10:48 +02:00
erwincoumans
b6120e760a PyBullet.addUserData / getUserData / removeUserData / getUserDataId / getNumUserData / getUserDataInfo
See examples/pybullet/examples/userData.py how to use it. TODO: add to PyBullet Quickstart Guide.
Thanks to Tigran Gasparian for the contribution!
2018-06-02 13:40:08 -07:00
erwincoumans
cb6b7a7c38 PyBullet: expose flags to createMultiBody 2018-06-02 11:37:14 -07:00
Erwin Coumans
39c9ffa4c3 PyBullet IK: backward compatible changes related to joint damping 2018-06-01 23:25:47 -07:00
Erwin Coumans
e74cd05e37 add space 2018-05-31 21:21:50 -07:00
erwincoumans
4c75e022c8 Use dofCount and not numJoints in PyBullet.calculateInverseKinematics, fixes null space demo
See baxter_ik_demo at https://github.com/erwincoumans/pybullet_robots
2018-05-31 21:07:04 -07:00