Commit Graph

6810 Commits

Author SHA1 Message Date
erwincoumans
87e8711b0a
Merge pull request #1872 from RanTig/GetLinkStateFix
Change b3GetLinkState to use numLinks in status handle
2018-09-11 08:48:30 -07:00
Tigran Gasparian
58699258dd Change b3GetLinkState to use numLinks in status handle
Changes the b3GetLinkState function to use numLinks from the
SharedMemoryStatus returned from RequestActualState instead of the
cached number of link value returned by b3GetNumJoints.

The cached value can be outdated when a new body is added and
SyncBodyInfo isn't used, while using the value in the status is always
up-to-date.
2018-09-11 14:44:06 +02:00
erwincoumans
ab84975ca9
Merge pull request #1870 from erwincoumans/master
pybullet eglPlugin: fix Mac OSX build
2018-09-10 12:23:36 -07:00
Erwin Coumans
f26d4fdc4c pybullet eglPlugin: fix Mac OSX build 2018-09-10 08:55:47 -07:00
erwincoumans
1a047901ce
Merge pull request #1869 from erwincoumans/master
fixes in eglRendererPlugin
2018-09-10 07:51:39 -07:00
bla
6992195ba8 add pybullet example for eglRendererPlugin, will use EGL in a plugin on Linux, Win32OpenGLWindow in a plugin on Windows 2018-09-09 23:03:07 -07:00
bla
8f711462e0 fix setup.py to work better on Windows and Linux (with default eglPlugin static built-in,
just use pybullet.loadPlugin("eglRendererPlugin") before loading/creating any objects.
use end/startRendering (swap buffers) before the rendering in the eglPlugin
2018-09-09 22:58:08 -07:00
erwincoumans
9698c3d600 PyBullet setup.py: only enable BT_USE_EGL on Linux, but allow to run the eglPlugin on Windows and Mac as well (using their default opengl window).
postpone the 'loadPlugin' for static eglPlugin, so that the init and exit happen in the same thread.
When you don't call unloadPlugin, the program may crash when exiting in SHARED_MEMORY_SERVER mode.
2018-09-09 21:08:47 -07:00
erwincoumans
2744e84592 Merge branch 'master' of https://github.com/erwincoumans/bullet3 2018-09-09 15:25:27 -07:00
erwincoumans
7369005402 pybullet, use eglPlugin statically instead of dynamic loading an Extension -DSTATIC_EGLRENDERER_PLUGIN
Fix compile errors of pybullet on Windows.
2018-09-09 15:23:26 -07:00
bla
de14006c2c Merge branch 'master' of https://github.com/erwincoumans/bullet3 2018-09-09 14:47:41 -07:00
bla
ced4645429 add missing include 2018-09-09 14:47:09 -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
dc7feb9027 Merge remote-tracking branch 'bp/master' 2018-09-09 10:48:58 -07:00
erwincoumans
233a7083d1
Merge pull request #1790 from BlGene/egl-plugin
OpenGL render plugin
2018-09-09 09:27:15 -07:00
erwincoumans
377a89c09c
Merge pull request #1866 from jna29/bug-fix/robot-manipulators-errors
Fixed bugs mistaking forearm_roll_joint for upper_arm_roll_joint
2018-09-08 18:53:47 -07:00
Joshua Aduol
cc4c02edc7 Fixed bugs mistaking forearm_roll_joint for upper_arm_roll_joint 2018-09-09 00:17:06 +01:00
erwincoumans
63f4a63e15 since parent collision is always disabled by default for self-collision, we add a new flag
URDF_USE_SELF_COLLISION_INCLUDE_PARENT, to force self-collision between direct parent/child (not recommended in general)
2018-09-08 14:46:43 -07:00
erwincoumans
cc91b4a7cf
Merge pull request #1865 from erwincoumans/master
update quickstart guide, bump up pybullet version
2018-09-08 13:50:52 -07:00
Erwin Coumans
bc0a201bd1 update quickstart guide from https://docs.google.com/document/d/10sXEhzFRSnvFcl3XxNGhnD4N2SedqwdAvK3dsihxVUA/edit#heading=h.2ye70wns7io3
bump up pybullet version to 2.1.4
2018-09-08 12:48:26 -07:00
Erwin Coumans
0515d5a5f6 Merge remote-tracking branch 'bp/master' 2018-09-08 07:51:30 -07:00
Erwin Coumans
b40fc10184 Merge branch 'master' of https://github.com/erwincoumans/bullet3 2018-09-08 07:51:16 -07:00
erwincoumans
9085c18354
Merge pull request #1863 from erwincoumans/master
remove pre-build proto/grpc files (they differ for each platform and …
2018-09-07 16:17:06 -07:00
Erwin Coumans
7376c26e4b remove gl libs from openvr 2018-09-07 16:06:42 -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
12409f1118
Merge pull request #1860 from erwincoumans/master
allow pybullet to connect to GRPC server. (need to use flag --enable_…
2018-09-05 21:20:21 -07:00
Erwin Coumans
b7d143429b Merge remote-tracking branch 'bp/master' 2018-09-05 18:54:45 -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
erwincoumans
437c0426c9
Merge pull request #1859 from erwincoumans/master
only add notifications if there is a plugin that needs them
2018-09-04 20:59:29 -07:00
Erwin Coumans
31b06f508a only add notifications if there is a plugin that needs them
call the 'reportNotifications' in GRPC server main
2018-09-04 19:24:31 -07:00
erwincoumans
c084763795
Merge pull request #1858 from erwincoumans/master
make GRPC work on Linux,
2018-09-04 17:49:49 -07:00
erwincoumans
2006f134b6
Merge pull request #1857 from erwincoumans/master
make grpc work on Mac OSX with premake
2018-09-04 17:03:27 -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
710e660763
Merge pull request #1855 from erwincoumans/master
more work on grpc/proto/pybullet.proto
2018-09-04 12:11:03 -07:00
erwincoumans
c4842220a8
Merge pull request #1852 from RanTig/remove-visual-shape
Removes visual shape data when a body gets removed.
2018-09-04 09:42:48 -07:00
erwincoumans
5b5e4f4d74
Merge pull request #1854 from RanTig/pybullet-plugincommand-fix
Small fix in executePluginCommand
2018-09-04 09:42:32 -07:00
erwincoumans
9b66074949 add some missing GRPC files 2018-09-04 09:10:57 -07:00
erwincoumans
9e2f6c7935 more GRPC work 2018-09-03 23:13:15 -07:00
Tigran Gasparian
a670041793 Small fix in executePluginCommand, now you can pass int arguments while keeping floats null without errors. 2018-09-03 10:41:38 +02:00
Tigran Gasparian
93145f3979 Adding space to make compiler happy. 2018-09-03 10:37:22 +02:00
erwincoumans
23e84ca9b6 more work on proto/pybullet.proto 2018-09-01 13:49:56 -07:00
erwincoumans
3285143232
Merge pull request #1851 from RanTig/use-dlmopen
Uses dlmopen() instead of dlopen() in b3PluginManager.cpp. This allow…
2018-08-31 14:13:13 -07:00
erwincoumans
a9299fbd0c
Merge pull request #1853 from erwincoumans/master
fix crash in btInternalEdgeUtility when a mesh is not the expected type
2018-08-31 14:12:43 -07:00
Erwin Coumans
9a26d4aaaf fix type 2018-08-31 09:59:18 -07:00
Erwin Coumans
f1cb4fe29c fix crash in btInternalEdgeUtility when a mesh is not the expected type
(don't wrap a mesh in a btCompoundShape if you want to use the edge utility)
2018-08-31 09:25:49 -07:00
Tigran Gasparian
9799f356de . 2018-08-31 15:35:35 +02:00
Tigran Gasparian
f132b4d16b Only make the change for Linux, since OSX doesn't have dlmopen() 2018-08-31 15:33:08 +02:00
Tigran Gasparian
c062bfc2d5 Removes visual shape data when a body gets removed.
Problem description:
When you add a body, remove it and then add a new
body, the body id may be reused by Bullet.
Because the visual shape data was not being removed when a body was
removed, requesting the visual shape data for a 'recycled' body id
results in both the visual shape data of the new body as well as the old
one.
Removing the visual shape data when the body gets removed fixes this.

Changes the btAlignedObjectArray for visual shapes to a hashmap, so
that removing is faster. Additionally, functions like getNumVisualShape
don't perform a linear search anymore.
2018-08-31 15:12:28 +02:00