<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/13450" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2022-06-27T13:13:05+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/13450</id>

		<entry>
		<author><name><![CDATA[mkale96]]></name></author>
		<updated>2022-06-27T13:13:05+00:00</updated>

		<published>2022-06-27T13:13:05+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=44047#p44047</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=44047#p44047"/>
		<title type="html"><![CDATA[Visualizing multiple bullet server instances using PyBullet]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=44047#p44047"><![CDATA[
Hi, I'd like to spawn multiple instances of the physics server, send them some geometry, start them and then combine their output in a single rendering window. Note that the geometry on "worker" servers might not be the same.<br>I'm trying to repurpose the existing 3D rendering infrastructure that pyBullet provides. Here's what I'm trying to do so far:<br><br>I'm currently looking into the saveBullet() and restoreState() methods to do this (spawning only 1 worker server for simplicity):<br><div class="codebox"><p>Code: </p><pre><code>import pybullet_utils.bullet_client as bcimport pybullet as pimport pybullet_dataimport timeSTATE_FILE = 'state.bullet'def setupServer(handle):    handle.setAdditionalSearchPath(pybullet_data.getDataPath())    handle.setPhysicsEngineParameter(deterministicOverlappingPairs=1)    startOrientation = handle.getQuaternionFromEuler([0, 0, 0])    handle.loadURDF("r2d2.urdf", [0, 0, 1], startOrientation)    handle.loadURDF("plane.urdf")    handle.setGravity(0, 0, -10)p1 = bc.BulletClient(connection_mode=p.DIRECT)setupServer(p1)pgui = bc.BulletClient(connection_mode=p.GUI)#setupServer(pgui)while 1:    p1.stepSimulation()    p1.saveBullet(STATE_FILE)    pgui.restoreState(fileName=STATE_FILE)    pgui.stepSimulation()    time.sleep(1. / 240.)</code></pre></div>Which gives me the error:<br><div class="codebox"><p>Code: </p><pre><code>Traceback (most recent call last):  File "C:\Users\m84241864\Desktop\projects\bullet\python\multi_server.py", line 43, in &lt;module&gt;    pgui.restoreState(fileName=STATE_FILE)pybullet.error: Couldn't restore state.</code></pre></div>If I load the same geometry as p1 in pgui, I don't get the error. However, I do want p1, p2... to have different geometries and pgui to render all of them. How should I do this? If this is not supported OOTB, I don't mind changing the C++ source code. Some pointers on where to start would be very helpful. Thanks!<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14361">mkale96</a> — Mon Jun 27, 2022 1:13 pm</p><hr />
]]></content>
	</entry>
	</feed>
