Commit Graph

177 Commits

Author SHA1 Message Date
erwincoumans
2e13531493 Merge pull request #1061 from erwincoumans/master
Implement rayTestBatch. At the moment, it is still testing individual…
2017-04-06 04:56:49 +00:00
Erwin Coumans
6cbb00fd6b Implement rayTestBatch. At the moment, it is still testing individual rays on the physics server. We can enable multi-threaded version later. At least the python + shared-memory IPC overhead will be much lower. 2017-04-05 15:21:26 -07:00
erwincoumans
ac91896025 Merge pull request #1054 from erwincoumans/master
pybullet setup.py / pip support for Windows, Linux and Mac! just run 'pip install pybullet' and wait until all compiled (like numpy, it is mainly source, except for a few wheels Mac 2.7 and Win32 3.5). Expose URDF_USE_SELF_COLLISION flag.
2017-04-04 23:36:32 +00:00
Erwin Coumans
b095e1d917 expose pybullet.URDF_USE_SELF_COLLISION flag, experimental (likely doesn't work well for many URDF files) 2017-04-04 12:47:34 -07:00
yunfeibai
7c7d831767 Add contact point logger. 2017-04-02 15:09:40 -07:00
yunfeibai
f062847038 Replace spaces with tabs. 2017-03-29 15:37:33 -07:00
yunfeibai
66a8685816 Merge remote-tracking branch 'upstream/master' 2017-03-29 15:06:15 -07:00
yunfeibai
64573c38e4 Remove getBodyName API. 2017-03-29 15:03:29 -07:00
Erwin Coumans
fd2c0f58bc Merge branch 'master' of https://github.com/erwincoumans/bullet3 2017-03-27 17:25:40 -07:00
Erwin Coumans
38ad1bfb89 revert to m_jointFriction (from m_jointFriction1) 2017-03-27 10:16:55 -07:00
Erwin Coumans
4911916937 Expose 'flags' option for loadURDF, to allow customization of the URDF loading process while maintaining backward compatibility.
For example: URDF_USE_INERTIA_FROM_FILE flag. By default, URDF2Bullet will re-compute the inertia tensor based on mass and volume, because most URDF files have bogus Inertia values.
2017-03-27 08:30:20 -07:00
Erwin Coumans
7503418c72 Split Bullet/src/LinearMath/btSerializer.cpp into btSerializer64.cpp to make it easier to rebuild serialization structure.
Add several MSVC optimization flags to cmake.
Bump up VERSION because serialization format changed
Expose btScalar& jointMaxForce, btScalar& jointMaxVelocity to 'getJointInfo2' API, add backwards compatibility to examples\Importers\ImportURDFDemo\URDFImporterInterface::getJointInfo.

pybullet: expose 4 more fields to getJointInfo: jointLowerLimit/jointUpperLimit/jointMaxForce/jointMaxVelocity
fix performance issue in CMD_ACTUAL_STATE_UPDATE_COMPLETED
2017-03-26 13:06:46 -07:00
yunfeibai
d717b1db84 Add the API to get the body name and pybullet example call. 2017-03-23 13:54:44 -07:00
Erwin Coumans
59d16b2c42 expose video capture as logging command in b3RobotSimulatorClientAPI (C++) and pybullet (use STATE_LOGGING_VIDEO_MP4) 2017-03-16 09:13:33 -07:00
Erwin Coumans
34fc2fb589 create premake/cmake file for Bullet/Extras/obj2sdf
add missing 1.sdf for Bullet/data/kitchens/1.sdf
add support for getting keyboard events (pybullet.getKeyboardEvents and b3RobotSimulatorClientAPI::getKeyboardEvents)
2017-03-02 12:33:22 -08:00
Erwin Coumans
6a40c1cca7 pybullet expose resetDebugVisualizerCamera
example: pybullet.resetDebugVisualizerCamera(cameraDistance=3,cameraYaw=30,cameraPitch=52,cameraTargetPosition=[0,0,0])
2017-03-01 15:04:07 -08:00
Erwin Coumans
a4f1e34899 expose timeout in pybullet/shared memory API
add RobotSimulator, a C++ API similar to pybullet. (work-in-progress, only part of API implemeted)
2017-02-24 15:34:11 -08:00
Erwin Coumans
bd30ba30ce Replace large timeout (1024*1024*1024) using real-time clock timeout (10 seconds default)
Change SHARED_MEMORY_MAGIC_NUMBER to make sure server/client are using the same version (shared memory)
add --realtimesimulation to physics server (GUI, VR)
remove --G Xcode from build_cmake_pybullet_double.sh
2017-02-22 09:33:30 -08:00
Erwin Coumans
37890e5a4d allow to enable/disable GUI, shadows, wireframe of OpenGL Visualizer from API
(pybullet.configureDebugVisualizer)
2017-02-21 17:36:54 -08:00
Erwin Coumans
cfd35840f0 initial implementation of state logging.
see examples/pybullet/logMinitaur.py for example. Other state logging will include general robot states and VR controllers state.
2017-02-17 14:25:53 -08:00
Erwin Coumans
34c3fca8d5 prepare state logging system (log state of robot, vr controllers after each stepSimulation) 2017-02-17 10:47:55 -08:00
erwincoumans
3a42b356e2 Add profile markers for BenchmarkDemo raytest.
Implement pybullet enableJointForceTorqueSensor, add forcetorquesensor.py example.
2017-01-31 10:14:00 -08:00
Erwin Coumans
e652696f52 report localVisualFrame instead localInertialFrame 2017-01-25 08:29:45 -08:00
Erwin Coumans
cf9f022d39 [pybullet] getNumConstraints, getConstraintInfo APIs.
[pybullet] updated pybullet_quickstartguide.pdf
Fail clearly (assert, return BT_INFINITY) if link index is out of range for btMultiBody methods localPosToWorld,worldPosToLocal,localDirToWorld,worldDirToLocal.
pybullet getConstraintInfo
Fix warnings due to Mac OSX 10.12 upgrade (with backward compatibility)
2017-01-22 19:08:31 -08:00
Erwin Coumans
64957ece9f add hand.py/hand.ino used to create this VR glove, using MuJoCo Haptix MPL hand (Apache 2 license)
https://www.youtube.com/watch?v=VMJyZtHQL50
added b3InitSyncBodyInfoCommand, to retrieve body info, when connecting to a server with existing bodies
pybullet will call this b3InitSyncBodyInfoCommand automatically after connecting
Avoid overriding the py.setVRCameraState setting in VR
2017-01-20 18:13:24 -08:00
Erwin Coumans
52761f5578 [pybullet] implement addUserDebugParameter / readUserDebugParameter
fix inertial frame for door.urdf
allow picking of links of multi-bodies with a fixed base
2017-01-17 15:42:32 -08:00
Erwin Coumans
4897139dad pybullet.calculateInverseKinematics: expose null space method with and without orientation
add inverse_kinematics.py and hello_pybullet.py pybullet examples
add m_worldLinkFramePosition/Orientation fields to b3LinkState, and in pybullet.getLinkState (URDF link frame in Cartesian/world coordinates)
2017-01-11 21:39:22 -08:00
Erwin Coumans
83e103ac15 Add pybullet setVRCameraState and b3SetVRCameraStateCommandInit to set the VR camera root transform (position/orientation) and optional tracking object unique id (-1 for no tracking)
Fix robotcontrol.py script, getContactPointData -> getContactPoints
2017-01-05 17:41:58 -08:00
Erwin Coumans
826c5854a8 See also pybullet quickstart guide here: https://docs.google.com/document/d/10sXEhzFRSnvFcl3XxNGhnD4N2SedqwdAvK3dsihxVUA/edit#
vrevent.py: add a Tiltbrush-style drawing example using pybullet
Expose getVREvents to pybullet / shared memory API, access to any VR controller state & state changes.
Improve performance of user debug lines (pybullet/shared memory API) by batching lines with same color/width
expose rayTest to pybullet/shared memory API (single ray for now)
add pybullet getMatrixFromQuaterion
2016-12-26 19:40:09 -08:00
Erwin Coumans
9ae40a59ba export joint types in pybullet for pybullet.createConstraint
revert to premake4.exe, the targetsuffix etc doesn't seem to work in premake5.exe
2016-12-14 20:44:10 -08:00
yunfeibai
1fbd78ece5 Add shared memory API for setting shadow and light source distance. 2016-11-29 13:19:35 -08:00
yunfeibai
29809a4471 Render depth buffer. 2016-11-23 13:00:26 -08:00
yunfeibai
24b3e137a6 Render shadow with depth from light. 2016-11-21 10:21:14 -08:00
erwin coumans
c0fb98861d add quadruped.py script to load and initialize the a Minitaur-like quadruped
pybullet removeConstraint, createConstraint
rename b3CreateJoint to b3InitCreateUserConstraintCommand
add int b3GetStatusUserConstraintUniqueId(b3SharedMemoryStatusHandle statusHandle);
b3SharedMemoryCommandHandle  b3InitRemoveUserConstraintCommand(b3PhysicsClientHandle physClient, int userConstraintUniqueId);
2016-11-14 14:08:05 -08:00
Erwin Coumans
c521d816c6 add user debug line/text features in pybullet + shared memory API:
addUserDebugLine,
addUserDebugText
removeUserDebugItem
removeAllUserDebugItems
2016-11-14 07:39:34 -08:00
erwin coumans
7577c6d893 add pybullet loadBullet, saveBullet (work-in-progress) and placeholder for loadMJCF. 2016-11-11 18:07:42 -08:00
erwin coumans
35fc8306fd pybullet load/save .bullet files 2016-11-11 14:44:50 -08:00
erwincoumans
9b5aa9a723 pybullet getOverlappingObjects added: report all object unique ids within a world space bounding box (aabb) 2016-11-10 11:22:22 -08:00
erwincoumans
0d47d61007 pybullet getClosestPoints 2016-11-09 21:01:04 -08:00
erwincoumans
5d66ce20e0 network UDP: transmit structural DNA to deal with version/platform differences.
pybullet: allow to specify shared memory key and hostname/port for UDP.
2016-11-04 17:06:55 -07:00
yunfeibai
4911b14271 Add loading texture API. 2016-10-20 23:40:30 -07:00
yunfeibai
6ef96a4027 Add programmatic render API and a basic test. 2016-10-20 10:56:44 -07:00
erwin coumans
eda400d14c Merge remote-tracking branch 'bp/master' 2016-10-19 07:43:46 -07:00
erwin coumans
f97cb7002d first version of 'getVisualShapeData' to get visual shape information to allow external renderer with pybullet and shared memory robotics API
b3InitRequestVisualShapeInformation/b3GetVisualShapeInformation in shared memory API
2016-10-18 22:05:28 -07:00
yunfeibai
3ffd95fbab Merge remote-tracking branch 'origin/master' 2016-10-17 13:20:31 -07:00
yunfeibai
b07df4d504 Load bunny through shared memory API and RobotSimAPI. Create grasp bunny example. 2016-10-17 13:01:04 -07:00
erwincoumans
33d9603e16 Add rudimentary 'saveWorld' command in shared memory API and pybullet, see examples/pybullet/saveWorld.py
Use trilinear filtering instead of bilinear
2016-10-12 23:03:36 -07:00
erwin coumans
b81eb79ef5 ping-pong back/forward in PGS solving iterations to reduce bias in constraint order
add experimental rhs clamp in btMultiBodyJointMotor to control maximum error resolution.
2016-09-28 11:17:11 -07:00
erwin coumans
0936ae6600 expose getNumBodies, getBodyUniqueId, getBodyInfo (char* baseName) to shared memory API and pybullet., making it easier to serialize the state of the world. 2016-09-27 12:13:45 -07:00
yunfeibai
27fab2adb5 Create a demo for one motor gripper grasp. 2016-09-21 12:08:03 -07:00
yunfeibai
c952c50ad9 Merge remote-tracking branch 'upstream/master' 2016-09-11 04:11:51 -07:00
erwin coumans
32eccdff61 Create project file for BussIK inverse kinematics library (premake, cmake)
URDF/SDF: add a flag to force concave mesh collisiofor static objects. <collision concave="yes" name="pod_collision">
VR: support teleporting using buttong, allow multiple controllers to be used, fast wireframe rendering,
Turn off warnings about deprecated C routine in btScalar.h/b3Scalar.h
Add a dummy return to stop a warning
Expose defaultContactERP in shared memory api/pybullet.
First start to expose IK in shared memory api/pybullet (not working yet)
2016-09-08 15:15:58 -07:00
yunfeibai
c198029cb9 Expose body Jacobian in shared memory API. 2016-09-07 16:00:38 -07:00
Erwin Coumans
e98fca1e5e implement pybullet.getContactPointData(), two optional object unique ids as filter
returns a pylist of contact points. Each point has the following data:

	0     int m_contactFlags;//unused for now
         1     int m_bodyUniqueIdA;
         2     int m_bodyUniqueIdB;
         3     int m_linkIndexA;
         4     int m_linkIndexB;
         5-6-7     double m_positionOnAInWS[3];//contact point location on object A, in world space coordinates
         8-9-10     double m_positionOnBInWS[3];//contact point location on object A, in world space coordinates
         11-12-13     double m_contactNormalOnBInWS[3];//the separating contact normal, pointing from object B towards object A
         14     double m_contactDistance;//negative number is penetration, positive is distance.

         15    double m_normalForce;
2016-09-01 18:28:39 -07:00
erwincoumans
85fd7f560c add first draft of contact point query in shared memory API
b3SharedMemoryCommandHandle b3InitRequestContactPointInformation(b3PhysicsClientHandle physClient);
void b3SetContactFilterBodyA(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdA);
void b3SetContactFilterBodyB(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdB);
void b3GetContactPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointData);
Implemented for PhysicsClientSharedMemory, not for PhysicsDirect yet.
Add btCollisionObject::setUserIndex2
2016-09-01 13:30:07 -07:00
Erwin Coumans
a30ff20e6b preparation for KUKA IK tracking example 2016-08-30 14:44:11 -07:00
yunfeibai
d46710e447 Expose fixed constraint in RobotSimAPI. 2016-08-22 18:14:29 -07:00
Erwin Coumans
c75bebcafe revert accidently renaming of m_depthvalues4 2016-08-12 13:55:37 -07:00
Erwin Coumans
3c30e2f821 add segmentation mask rendering to TinyRenderer and shared memory API
similar to the zbuffer, but storing the object index (int) instead of float depth
2016-08-11 14:55:30 -07:00
erwin coumans
a9b1544a9f Add premake support to build pybullet, Windows and Linux tested, will enable Mac in next commit.
Expose inverse dynamics to Bullet shared memory API, through b3CalculateInverseDynamicsCommandInit and
b3GetStatusInverseDynamicsJointForces command/status. See PhysicsClientExeample or pybullet for usage.
Add option for Windows and Linux to set python_lib_dir and python_include_dir for premake and --enable_pybullet option
Expose inverse dynamics to pybullet: [force] = p.calculateInverseDynamics(objectIndex,[q],[qdot],[acc])
Thanks to Jeff Bingham for the suggestion.
2016-08-09 18:40:12 -07:00
Erwin Coumans
10cc6f14cb add option to use hardware OpenGL renderer for synthetic camera 2016-07-12 18:16:13 -07:00
Erwin Coumans
013dbda023 implement a few more pybullet methods:
pybullet_applyExternalForce, pybullet_applyExternalTorque, pybullet_setTimeStep,
pybullet_resetBasePositionAndOrientation,
pybullet_getQuaternionFromEuler,
pybullet_getEulerFromQuaternion
2016-06-26 18:18:30 -07:00
Erwin Coumans
456c844a6b work-in-progress send object/joint information after loading SDF file 2016-06-14 18:41:19 -07:00
erwincoumans
6523df336e Fix pybullet Windows build errors: C99 requires variables to be defined at the start of the function.
Improve CMake Windows support to build PyBullet (BUILD_PYBULLET)
Implement b3LoadSdfCommandInit in shared memory API
Implement pybullet SDF loading binding, in loadSDF API
TODO for SDF support is provide way to query object/link/joint information.
2016-06-13 10:11:28 -07:00
erwin coumans
4b2c0f6d89 make one of the cubes in two_cubes.sdf static (immovable) using the <static> tag in SDF
add an example using 'direct'
fix the send-desired-state commands, to add flags for arguments set, using default values.
Start exposing SDF loading in shared memory api, not fully implemented yet.
2016-06-03 19:03:56 -07:00
erwin coumans
2fc0358750 Expose a better API to allow any render engine to be used for the physics simulation when loading URDF/SDF files.
See bullet3/examples/Importers/ImportURDFDemo/DefaultVisualShapeConverter.h
Give the kuka_iiwa/model.urdf some blue color, not just orange, to mimick the original a bit better
Preparation for the CMD_CAMERA_IMAGE_COMPLETED command, to expose a virtual camera to the robotics API
2016-05-19 18:37:15 -07:00
erwin coumans
606f78da43 work-in-progress tinyrenderer -> shared memory API synthetic camera image 2016-05-17 23:57:19 -07:00
Erwin Coumans
ab4299f517 expose the local inertial frame for each link in the shared memory API
struct b3LinkState
{
    double m_worldPosition[3];//this is the inertial frame
    double m_worldOrientation[4];

    double m_localInertialPosition[3];//this is the local frame from inertial to link frame
    double m_localInertialOrientation[4];
};

  const btTransform link_frame_world =
               inertial_frame_world * m_local_inertial_frame->inverse();
2016-04-29 14:46:25 -07:00
Erwin Coumans
f99d1c45aa expose multibody link world transform in the shared memory API 2016-04-23 17:29:46 -07:00
Erwin Coumans
0f5ee7a0a9 rename m_jointForce -> m_jointMotorForce to separate the name from m_jointForceTorque (which should have been called m_jointReactionForce) 2016-04-19 12:22:38 -07:00
yunfeibai
f9719e2405 Add measured joint motor force to joint sensor state. 2016-04-19 10:44:59 -07:00
erwincoumans
fe92de3e50 add infrastructure float btMultiBodyLink m_jointDamping, m_jointFriction (actual damping/friction is in a separate commit)
add door.urdf for testing damping/friction
2016-03-17 14:54:46 -07:00
erwincoumans
efbb1edecc Allow InProcessExampleBrowser to use a malloc allocated memory block, instead of system shared memory.
Make shared memory client/server a bit more robust, in case the server is terminated early.
2016-03-10 14:36:46 -08:00
erwincoumans
03bf78ef49 add physics server loopback (both client and server in the same process, using shared memory)
add physics server direct (client and server in the same process, directly processing commands without shared memory transport mechanism)
2015-11-22 20:50:32 -08:00
erwin coumans
9cc2b1ec12 Physics SharedMemory:
Add flags BOX_SHAPE_HAS_MASS and  BOX_SHAPE_HAS_COLLISION_SHAPE_TYPE to CMD_CREATE_RIGID_BODY
(which maps to CMD_CREATE_BOX_COLLISION_SHAPE for backward compatibility for now)
Need to add way to receive world transform
2015-10-27 14:55:46 -07:00
=
e05825f639 improvements to the shared memory physics API:
support picking in C API etc.
2015-09-24 22:42:22 -07:00
=
003a42478b another step closer to useable shared memory C API
(force/torque sensor needs new API)
in a nutshell, users of shared memory physics API should not
directly poke into shared memory, not fill 'SharedMemorCommand'
nor read SharedMemoryStatus directly. The C-API declares 'handles' for those,
to avoid it from happening.
2015-09-16 23:09:10 -07:00