Commit Graph

159 Commits

Author SHA1 Message Date
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
4c06fd27b3 Example Browser: add option (keypress 'p') to dump json timing profile trace, that you can open using Chrome about://tracing
Make btQuickprof thread safe
Add option in btQuickprof to override custom timing profile (btSetCustomEnterProfileZoneFunc, btSetCustomLeaveProfileZoneFunc)
remove b3Printf in a user/physics thread (those added added, while drawing the GUI running in the main thread)
2016-12-23 15:20:04 -08:00
Erwin Coumans
17570c4700 tweak color of quadruped robot URDF, tweak quadruped.py script to make it more compatible with VR demo
allow VR physics server to run with or without 'realTimeSimulation'
2016-12-11 09:28:36 -08:00
erwincoumans
61cfa18923 save default VR camera tuning, requires MIDI controller
tweak some values in VR demo
2016-12-02 17:44:00 -08:00
Erwin Coumans
746c4d0d2a add a tray, similar to those ones:
https://research.googleblog.com/2016/03/deep-learning-for-robots-learning-from.html

tune the VR demo a bit, to make it more user friendly.
2016-11-29 17:08:47 -08:00
erwincoumans
1bc427df6b fix compile issue when using VR 2016-11-20 16:22:20 -08:00
erwincoumans
f9c1e19587 revert 'addUserDebugLine/Text' to lockless rendering on main thread, at the cost of slower add/remove for now. 2016-11-20 15:38:42 -08:00
erwincoumans
9ee1c4ec24 regular OR wireframe rendering, not both
add option to perform filtering of 'getClosestPoints' using linkA/linkB.
don't use 'realtimesimulation' as default
add/remove debug items within same thread
pybullet, report contact points and normal as [x,y,z] triplet/vector, not 3 scalars
separate 'getClosestPointsAlgorithm': box-box doesn't report closest points with positive distance, and the query shouldn't impact regular 'closesst points'
2016-11-19 17:13:56 -08:00
erwincoumans
2329c00faa Add RtMidi for midi control, use the --midi option in premake, and see
update to OpenVR sdk 1.03 from https://github.com/ValveSoftware/openvr
add camPosX/Y/Z and camRotZ to adjust relative camera/world transform for VR (so you can align virtual table with real table etc)
tweak quadruped.py to move a bit
add mouse picking to physics server
2016-11-16 16:12:59 -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
erwincoumans
0d47d61007 pybullet getClosestPoints 2016-11-09 21:01:04 -08:00
erwincoumans
c2ca88bf44 added b3PhysicsParamSetInternalSimFlags command, and pybullet setInternalSimFlags API.
//Use at own risk: magic things may or my not happen when calling this API.

This allows to enable/disable robot assets (samurai world, gripper, KUKA robot etc) in Physics Server (and App_PhysicsServerVR etc)
1 = create robot assets
2 = create experimental box-vr-gui

Add optional command-line parameter for App_PhysicsServerVR, --norobotassets, to start with an empty world, no assets in VR (no gripper, no kuka)
2016-10-23 07:14:50 -07:00
erwin coumans
29f3afe2a4 don't use GL_LINEAR_MIPMAP_LINEAR for shadow maps
optimize gpu upload (use glBufferSubData instead of glMapBuffer
Avoid checking char array against zero.
2016-10-14 15:06:09 -07:00
erwincoumans
bbb2fac940 App_SharedMemoryPhysics_VR: Add a command-line flag (--emptyworld) to disable the Samurai/KUKA robot creation in the VR demo, and use pybullet to populate the VR world. Note that either way, you can use pybullet to interact and control the world. 2016-10-08 18:40:09 -07:00
erwin coumans
d6f449762b avoid wavefront obj texture index out-of-bounds (most obj out-of-bounds are not checked)
use second controller button
2016-10-04 08:53:59 -07:00
erwincoumans
f5e65197f4 fix pybullet.c compilation for Windows
add lego.urdf, duck.urdf (optimized using VHACD convex decomposition)
optimize Kiva shelf collision model (by hand, using boxes/Blender)
physics timescale toggle between  1 -> 0,25 -> 0
2016-09-24 11:25:05 -07:00
erwin coumans
e356f4f1f6 add test end-effector for Kuka iiwa (IK) 2016-09-22 19:48:26 -07:00
erwincoumans
46b32f17bb Add small sphere, make teddy small too
Add physics time scale in VR mode
Fix compound collision margin in physics server
Enable visuals for rigid body (non-multi-body) URDF/SDF loading in physics server.
2016-09-22 08:50:28 -07:00
erwin coumans
0a628f06cc decrease some gjk/epa tolerance to improve collision detection using very small collision margins (0.001/1mm)
tweak pr2 gripper.
2016-09-20 12:37:13 -07:00
erwin coumans
db3122233f remove that odd triangle in the origin of samurai castle (VR)
add rolling/spinning friction to cube, remove it from plane/samurai.urdf
URDF2Bullet: support joint limits for revolute and prismatic, only if defined (if upper < lower, disable limit)
add some profiling markers to improve performance
2016-09-19 07:02:43 -07:00
Erwin Coumans
567b003654 separate spinning and rolling friction coefficients, exposed in URDF as spinning_friction / m_rolling_friction
improvements in VR demo, add grasper etc.
2016-09-16 00:57:00 +01:00
erwincoumans
e5a8eb2425 rolling friction -> combine using rolling*normal friction, add for both objects.
rolling friction -> only along the normal, until we have separate rolling friction coefficients on normal and non-normal directions
Don't teleport with grasping controller (VR)
Tune VR grasping a bit.
2016-09-12 19:10:20 +01:00
Erwin Coumans
7df9b69039 pybullet: add option to use NumPy to speed up, thanks to moof2k
option is disabled by default. When using cmake, use
cmake -DBUILD_PYBULLET=ON -DBUILD_PYBULLET_NUMPY=ON
then both testrender.py and testrender_np.py will work
without numpy only testrender.py works.
The numpy.reshape is likely a no-op when using numpy array,
so we could remove testrender_np.py...

See https://github.com/bulletphysics/bullet3/pull/774
2016-09-11 11:35:12 +01:00
erwin coumans
3c706306cd add experimental pr2-gripper support in VR physics server
add setErp to btMultiBodyJointMotor
2016-09-09 14:30:37 -07:00
erwin coumans
f72982306e fix issues with VR physics server 2016-09-09 11:28:38 -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
erwin coumans
de5d1b5cfc make husky wheels soft/compliant
reduce shadow size to make VR on older GPU (Mac Pro 2013) perform more smooth
less sleep in physics thread.
2016-09-03 08:39:40 -07:00
YunfeiBai
6751648bce add some micro-sleep to prevent 100% CPU/memory bus hogging, preventing the graphics thread from making progress.
debug draw color black for contact normal
move debug draw option for constraint frames into 'k' key.
2016-08-19 13:58:53 -07:00
erwin coumans
a68c9ca845 avoid MT crash in VR/physics server due to printf from separate thread.
add fps display in VR
use 1./240. internal substep for real-time physics sim in VR/physics server for more accurate robotics sim.
2016-08-18 21:43:43 -07:00
erwin coumans
3bdcf23a05 Add sleep to avoid 100% busy CPU loop in PhysicsServerExample
Added btClock::usleep
Fix broken TinyRenderer example code.
2016-08-13 12:21:18 -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
f416644481 set the camera, even in multi-threaded mode 2016-08-11 11:20:31 -07:00
Erwin Coumans
b880ddf76b add pybullet render API with yaw/pitch/roll option
add testrender.py file
allow option to enable OpenGL hardware renderer in multithreaded sim

b3RequestCameraImageSelectRenderer(commandHandle,ER_BULLET_HARDWARE_OPENGL);
2016-08-08 14:23:44 -07:00
erwin coumans
2302709e2d OpenVR support: track multiple controllers and buttons 2016-07-18 23:13:46 -07:00
erwin coumans
c28cd03fbd OpenVR controller can pick/drag objects. Instructions, Windows only:
Compile using premake+visual studio, and compile App_SharedMemoryPhysics_VR
Compile pybullet using cmake using cmake -DBUILD_PYBULLET=OFF -DCMAKE_BUILD_TYPE=Release ..
Create a symbolic link from c:\python\dlls\pybullet.pyd to C:\develop\bullet3\cmp\lib\Release\pybullet.dll
App_SharedMemoryPhysics_VR
Run Python. Here are some Python lines to get going:
import pybullet as p
p.connect(p.SHARED_MEMORY)
p.loadURDF("cube.urdf")
p.setGravity(0,0,-10)
p.setRealTimeSimulation(1)

Allow real-time simulation in physics server, add pybullet command setRealTimeSimulation to control it
Mesh decimation (reduce number of triangles/vertices) using a Blender modifier for Kuka IIWA and Husky
Disabled the 'glFlush' commands in GLInstancingRenderer.
Add VR controller methods to examples\CommonInterfaces\CommonExampleInterface.h
Use the ANSI version in Windows file/string operations instead of unicode, hope this doesn't break builds.
2016-07-17 23:50:11 -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
7633cfb800 prepare robotics learning examples, see examples/RoboticsLearning/b3RobotSimAPI.h
prepare compliant contact work, urdf loading of parameters (see data/cube.urdf)
2016-07-11 00:26:40 -07:00
erwin coumans
02582e3a78 shrink down cube size of BasicDemo 10 times (it looked ginormous in VR) from 2x2x2 meter to 0.2
add test for VR HUD/sub-titles
fix issue in previous commit, partial string use %.8s not %8.s
use long long int in b3Clock
fix warning/error in pointer alignment in serialization
Fix pybullet Windows compilation.
(thanks to bkeys/https://github.com/bulletphysics/bullet3/pull/687)
2016-07-09 15:09:09 -07:00
erwin coumans
60d2b99151 Physics runs in a separate thread from rendering in PhysicsServerExample (preliminary)
Improve rendering performance. OpenVR experience is smooth now.
commit needs a bit more testing before pushing in main repo.
2016-07-07 19:24:44 -07:00
erwin coumans
d0f20eafd1 Allow to build PhysicsServer in VR mode, to see the URDF/SDF robots in proper scale in VR.
Add option to have Z as up-axis for VR examples.
Add OpenVR LICENSE + README file
Don't crash VR app when no HMD is detected, just exit.
For now, don't request debug lines in client, it slows down physics server in VR mode too much.
2016-07-02 18:53:19 -07:00
Erwin Coumans
fb2134f15f add combobox to select software/opengl rendering to compare 2016-05-18 17:57:13 -07:00
Erwin Coumans
7994a339ee disable RTC update for Physics Server by default 2016-05-18 16:21:40 -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
erwincoumans
d6464ce40d add 'replay' command log feature: no mouse interaction during replay, and use a fixed number of sim steps in stepSimulation.
workaround for reversed separating normal in gjk/epa when using very small shapes, detect case and revert normal.
use smaller world size (10 units versus 100) for higher resolution shadow map
use a hard-coded rolling friction of 0.2 for objects in physics server (will make this configurable)
fix loading of command log files, when platform features are different (64bit/32bit)
2015-11-01 12:48:15 -08:00
erwin coumans
c68c215ead add rudimentary command logging for shared memory physics server 2015-10-30 10:30:48 -07:00
erwin coumans
f7bbbd88e6 preparation for CommandLogging for PhysicsServer. 2015-10-29 11:25:50 -07:00
Takuya NAKAOKA
3a11fff3ad Fix slow simulation in PhysicsServerExample
Removed maxSteps to regain simulation speed
2015-10-20 14:51:40 +09:00
erwin coumans
4a29986662 initial support for multiple robots in shared memory API 2015-10-13 11:32:25 -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
=
5be9119455 run the PhysicsServerExample 'stepSimulation' smoother
fix a warning in ThirdParty/stb_image
fix an single/double precision issue in btPolyhedralContactClipping.cpp
2015-09-08 13:39:09 -07:00
erwin coumans
2909b5fae3 add picking to shared memory physics server 2015-09-04 11:28:08 -07:00
erwin coumans
f75df90d82 Allow batches of debug lines. The PhysicsClientExample rendering is still slow (one line at a time, instead of batches)
Prepare for IMU sensor in Shared Memory Server
2015-09-03 14:18:22 -07:00
Erwin Coumans
03d991c92b add command-line argument for example browser and shared memory app, --shared_memory_key=<int>
fix some shared memory issues, client uses attach/detach, server uses create/remove shared memory
implement CMD_RESET_SIMULATION
2015-08-07 00:13:26 -07:00
=
46fae61c69 fixes in shared memory:
only allow server to create and initialize shared memory,
client will report failure
intercept signals to cleanup shared memory in standalone app, thanks to
Roland Philippsen.
2015-08-06 11:59:31 -07:00
=
3fe9138e8c minor refactoring 2015-07-23 11:51:25 -07:00
erwin coumans
259bcb1989 mix physics client/server into a single example for easier/faster development of shared memory experiment
add premake option to choose targetdir for binaries/libraries
add simple hinge.urdf file
2015-07-15 12:57:45 -07:00
erwin coumans
54a76f6e0c Refactor of PhysicsClient/PhysicsServer, to separate from the example browser code.
(as usual, work-in-progress)
2015-07-14 15:30:17 -07:00