Commit Graph

163 Commits

Author SHA1 Message Date
erwincoumans
f5cdd6e015
Merge branch 'master' into master 2020-07-24 18:10:40 -07:00
Erwin Coumans
1e8f39b492 improve premake4 build in case X11 headers are missing
improve video_sync_mp4.py example
allow to create a heightfield from file or programmatically in C++ robotics api. Example:

{
		b3RobotSimulatorCreateCollisionShapeArgs shapeArgs;
		shapeArgs.m_shapeType = GEOM_HEIGHTFIELD;
		bool useFile = true;
		if (useFile)
		{
			shapeArgs.m_fileName = "D:/dev/bullet3/data/heightmaps/gimp_overlay_out.png";
			shapeArgs.m_meshScale.setValue(.05, .05, 1);
		}
		else
		{
			shapeArgs.m_numHeightfieldColumns = 256;
			shapeArgs.m_numHeightfieldRows = 256;
			shapeArgs.m_meshScale.setValue(.05, .05, 1);
			shapeArgs.m_heightfieldData.resize(shapeArgs.m_numHeightfieldRows * shapeArgs.m_numHeightfieldColumns);
			double heightPerturbationRange = 0.05;
			for (int j = 0; j<int(shapeArgs.m_numHeightfieldColumns / 2); j++)
			{
				for (int i = 0; i < (int(shapeArgs.m_numHeightfieldRows / 2)); i++)
				{
					double height = ((double)rand() / (RAND_MAX)) * heightPerturbationRange;
					shapeArgs.m_heightfieldData[2 * i + 2 * j * shapeArgs.m_numHeightfieldRows] = height;
					shapeArgs.m_heightfieldData[2 * i + 1 + 2 * j * shapeArgs.m_numHeightfieldRows] = height;
					shapeArgs.m_heightfieldData[2 * i + (2 * j + 1) * shapeArgs.m_numHeightfieldRows] = height;
					shapeArgs.m_heightfieldData[2 * i + 1 + (2 * j + 1) * shapeArgs.m_numHeightfieldRows] = height;
				}
			}
		}
		int shape = sim->createCollisionShape(shapeArgs.m_shapeType, shapeArgs);
		b3RobotSimulatorCreateMultiBodyArgs bodyArgs;
		bodyArgs.m_baseCollisionShapeIndex = shape;
		int groundId = sim->createMultiBody(bodyArgs);
		int texId = sim->loadTexture(shapeArgs.m_fileName);
		b3RobotSimulatorChangeVisualShapeArgs args;
		args.m_objectUniqueId = groundId;
		args.m_linkIndex = -1;
		args.m_textureUniqueId = texId;
		sim->changeVisualShape(args);
	}
2020-07-24 18:09:13 -07:00
root
6af885aa12 fix premake4 script when X11 is missing 2020-07-18 07:40:40 -07:00
Steve Streeting
4182c8ca9c Add --dynamic-runtime option to compile with /MD[d] in MSVC for compat 2020-06-30 17:12:11 +01:00
Ellie
78602fe656 Implementing a simple velocity clamping to reduce floating point errors 2020-03-17 01:22:07 +01:00
erwincoumans
226819b839 premake add enable_stable_pd option, so Bullet can be compiled without C++11 (Visual Studio 2010 etc)
PyBullet: improve sleeping: if the base is static and all joints in the chain between this link and the base are fixed, then this link is static too (doesn't merge islands)
Fix PyBullet compilation of Visual Studion 2010
2019-08-07 21:57:05 -07:00
Rémi Verschelde
d85b800702 Convert DOS (CRLF) source files to Unix (LF) line endings
Excluded `examples/pybullet/gym/pybullet_data/` which has many (3000+)
CRLF data files (obj, mtl, urdf), and `docs/pybullet_quickstart_guide`
which has generated .js and .htm files with CRLF line endings too.
2019-05-22 10:01:32 +02:00
Erwin Coumans
ef9570c315 add yapf style and apply yapf to format all Python files
This recreates pull request #2192
2019-04-27 07:31:15 -07:00
erwincoumans
a6244d714e more PyBullet PhysX preliminary work. 2019-01-25 10:14:54 -08:00
Erwin Coumans
21d9465d94 update premake5.exe (note we still use premake4.exe by default) 2018-12-22 17:55:50 -08:00
Erwin Coumans
dc2d54df2c remove 32bit build ARCH from xcode4 generated files (premake4)
optimization in btMultiBody::fillConstraintJacobianMultiDof:
only compute links between current link and root
2018-10-20 10:44:43 -07:00
erwincoumans
5bcd43711a PyBullet OpenGL/EGL hardware getCameraImage: use glViewport to reduce the glReadPixels calling cost dramatically for small images
PyBullet Allow OpenGL/EGL hardware to render segmentation mask. Use pybullet.ER_SEGMENTATION_MASK_OBJECT_AND_LINKINDEX or pybullet.ER_SEGMENTATION_MASK
PyBullet.removeBody fix indexing bug (use foundIndex, not i)
PyBullet bump up version to 2.2.3
2018-09-30 07:10:40 -07:00
erwincoumans
c4fe0f7357 disable enable_egl by default (?!?) 2018-09-09 14:39:56 -07:00
erwincoumans
adb5c049c7 Thanks to @dchichkov for some of the fixes in the eglRendererPlugin!
Rename tinyRenderer -> eglRenderer in the eglRendererPlugin.
Allow to run the eglRendererPlugin to run on Windows (not in EGL mode but Win32OpenGLWindow mode)

Here is a script I tested on Windows:
~~~~~~~~~~~~
mport pybullet as p
import time

p.connect(p.DIRECT)
plugin = p.loadPlugin("e:/develop/bullet3/bin/pybullet_eglRendererPlugin_vs2010_x64_debug.dll","_eglRendererPlugin")
print("plugin=",plugin)
p.setGravity(0,0,-10)
p.loadURDF("plane.urdf",[0,0,-1])
p.loadURDF("r2d2.urdf")
pixelWidth = 320
pixelHeight = 220
while (1):
	p.stepSimulation()
	viewMatrix = [1.0, 0.0, -0.0, 0.0, -0.0, 0.1736481785774231, -0.9848078489303589, 0.0, 0.0, 0.9848078489303589, 0.1736481785774231, 0.0, -0.0, -5.960464477539063e-08, -4.0, 1.0]
	projectionMatrix  = [1.0825318098068237, 0.0, 0.0, 0.0, 0.0, 1.732050895690918, 0.0, 0.0, 0.0, 0.0, -1.0002000331878662, -1.0, 0.0, 0.0, -0.020002000033855438, 0.0]

	#img_arr = p.getCameraImage(pixelWidth, pixelHeight, viewMatrix,projectionMatrix, shadow=1,lightDirection=[1,1,1])#,renderer=pybullet.ER_BULLET_HARDWARE_OPENGL)
	img_arr = p.getCameraImage(pixelWidth, pixelHeight, shadow=1,lightDirection=[1,1,1])#,renderer=pybullet.ER_BULLET_HARDWARE_OPENGL)
	#print("img_arr=",img_arr)
	time.sleep(1)
~~~~~~~~~~~~~
2018-09-09 13:37:49 -07:00
erwincoumans
233a7083d1
Merge pull request #1790 from BlGene/egl-plugin
OpenGL render plugin
2018-09-09 09:27:15 -07:00
erwincoumans
5164f2f9a7 remove pre-build proto/grpc files (they differ for each platform and proto/grpc version) 2018-09-07 15:44:33 -07:00
erwincoumans
0efc67841d allow pybullet to connect to GRPC server. (need to use flag --enable_grpc in premake build system)
add grpcPlugin, it can work in GUI, SHARED_MEMORY_SERVER, DIRECT and other modes.
example script to start server from pybullet:
import pybullet as p
p.connect(p.GUI)
#if statically linked plugin
id = p.loadPlugin("grpcPlugin")
#dynamics loading the plugin
#id = p.loadPlugin("E:/develop/bullet3/bin/pybullet_grpcPlugin_vs2010_x64_debug.dll", postFix="_grpcPlugin")

#start the GRPC server at hostname, port
if (id>=0):
	p.executePluginCommand(id, "localhost:1234")

Only in DIRECT mode, since there is no 'ping' you need to call to handle RCPs:
numRPC = 10
while (1):
	p.executePluginCommand(id, intArgs=[numRPC])
2018-09-05 17:58:14 -07:00
Erwin Coumans
18b782847d make GRPC work on Linux, 2018-09-04 16:56:34 -07:00
Erwin Coumans
51f9a6fd0d make grpc work on Mac OSX with premake 2018-09-04 14:49:12 -07:00
erwincoumans
9e2f6c7935 more GRPC work 2018-09-03 23:13:15 -07:00
a
3d499c8a7a pybullet: added EGL render device and window_backend option.
EGL review.
EGL dynamic loading, windowType to int
moved to glad2
Require GL 3.3 as GLInstancingRenderer.cpp uses glVertexAttribDivisor
glad2 update with dynamic X11 added
removed old file
build fix
fix mac/win
EGL w/o c++11, off by default
fix premake
fixup: premake fix 2
2018-08-30 13:24:25 +02:00
erwincoumans
4f7dfc2069 Add preliminary GRPC server for PyBullet and BulletRobotics.
Will add GRPC client and PyBullet GRPC server plugin.
Will cover most/all SharedMemoryCommand/SharedMemoryStatus messages.
Run the server, then test using the pybullet_client.py
2018-08-29 21:12:13 -07:00
Lunkhound
04e0d57dc1 add premake option 'enable-multithreading' 2018-03-16 23:42:43 -07:00
erwincoumans
94bc897067
Merge pull request #1574 from erwincoumans/master
fix glx include
2018-02-22 09:41:01 -08:00
Erwin Coumans
05b02d6b3e fix glx include 2018-02-22 09:08:10 -08:00
erwincoumans
3508a4523b
Merge pull request #1560 from YunfeiBai/master
Add shader and example for projective texture.
2018-02-21 10:23:18 -08:00
Erwin Coumans
dacafda88a use glad instead of glew in mac build and pybullet setup.py 2018-02-20 20:09:12 -08:00
Erwin Coumans
b0984de046 preparation to replace glew by glad 2018-02-20 19:44:02 -08:00
Erwin Coumans
8bb40b632b allow to build GLFW version of Bullet examples on Linux (use premake4_linux --enable_glfw gmake) 2018-02-20 16:21:22 -08:00
yunfeibai
2947cd54ce Add shader for projective texture. 2018-02-11 21:29:02 -08:00
Andrew Hundt
706013b87a
FindPythonLibs.cmake add missing quotes
This avoids problems in the case that the the path has a space in it.
2017-12-07 21:47:38 -05:00
erwincoumans
29aa9cb789 Bullet bump up to version 2.88
add preliminary support to import btMultiBody from a .bullet file (will help save/restore state)
fix some Windows char/widechar issues
2017-11-22 18:12:02 -08:00
erwincoumans
6a9300809d premake4 add option --enable_static_vr_plugin to statically link the VR sync plugin
fix texture caching from previous commit (what happened there?)
2017-10-25 10:00:45 -07:00
Andrew Hundt
4810b99155 Add special search paths for linux python libraries such as libpython3.5m.so 2017-09-29 17:38:40 -04:00
Andrew Hundt
b720bd6290 cmake python fix typos for linux #1322 2017-09-21 23:47:31 -04:00
Andrew Hundt
ff15f2e702 cmake python fix for linux #1322
Search did not cover inconsistent lib location defined within python under linux versions
https://stackoverflow.com/questions/20582270/distribution-independent-libpython-path
2017-09-21 23:42:52 -04:00
Erwin Coumans
c47019e0af fix Windows build for premake
d
2017-09-20 08:18:42 -07:00
Erwin Coumans
3e0b72b632 allow to configure glfw on Mac OSX, disabled by default 2017-09-20 08:12:59 -07:00
erwincoumans
390f111547 enable option to use GLFW, instead of our own cross-platform X11/Cocoa/Windows OpenGLWindow classes 2017-09-19 21:10:54 -07:00
Andrew Hundt
1e83630c1d cmake minor fixes 2017-05-21 09:32:00 -04:00
Andrew Hundt
263ccec18a cmake python config bugs fixed
Python and pybullet remain optional with these changes.
A specific python version can now be selected by setting PYTHON_VERSION_PYBULLET.
The python library version must now match the interpreter version exactly.
If all required python dependencies are found, pybullet is now enabled by default.
Changes incorporate the following BSD licensed cmake code:
32bf5c7ad8/CMakeScripts/FindNumPy.cmake
https://github.com/NikolausDemmel/CMake/pull/2/files
86578eccf2/Modules/SelectLibraryConfigurations.cmake
2017-05-20 20:47:46 -04:00
Erwin Coumans
305725e52e add --serial option in premake, added serial library to test vr glove in C++ (pybullet works already fine) 2017-05-01 15:04:00 -07:00
Erwin Coumans
eef76af663 create basic audio, towards sound sensors etc. 2017-04-14 12:22:38 -07:00
Erwin Coumans
f73b54e4ab testing ImGUI 2017-04-11 20:16:49 -07:00
Erwin Coumans (Google)
865d37fcb5 add premake4_arm64 that works on NVIDIA TX2 2017-03-18 18:32:21 +00: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
35b92c43d3 remove some standalone-example from the premake build (re-enable using option --standalone-examples
move PhysicsServer and PhysicsClient into Physics Server-Client in its own ExampleBrowser section (out of Experiments)
2017-02-22 06:13:32 -08:00
Erwin Coumans
3faab1b019 adjusted clsocket build and test, so there is an EchoServer and QueryDayTime sending a string to the EchoServer. 2017-02-19 12:08:58 -08:00
Erwin Coumans
4faa6613c9 first draft of premake/cmake build files for clsocket (tiny cross-platform TCP socket library) 2017-02-19 11:48:01 -08:00
Erwin Coumans
04d78cccfb remove obsolete batch file 2017-01-07 19:31:34 -08:00