<?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/12722" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2022-03-15T02:44:50+00:00</updated>

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

		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2022-03-15T02:44:50+00:00</updated>

		<published>2022-03-15T02:44:50+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43933#p43933</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43933#p43933"/>
		<title type="html"><![CDATA[Re: Not connected to physics server when trying to run environment]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43933#p43933"><![CDATA[
Please check out those examples, they show how to implement multiprocessing with PyBullet, you need to be careful:<br><br><a href="https://github.com/bulletphysics/bullet3/tree/master/examples/pybullet/gym/pybullet_robots/panda" class="postlink">https://github.com/bulletphysics/bullet ... bots/panda</a><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Tue Mar 15, 2022 2:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dogbuilder23]]></name></author>
		<updated>2022-03-14T17:52:02+00:00</updated>

		<published>2022-03-14T17:52:02+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43932#p43932</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43932#p43932"/>
		<title type="html"><![CDATA[Re: Not connected to physics server when trying to run environment]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43932#p43932"><![CDATA[
Forgot to mention, the other script from the same github repo work fine.<br>E.g. <br>spot_ars_eval.py<br>env_tester.py<br><br>The problem seems to be when spot_ars.py is using multiprocessing workers for the training.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14284">dogbuilder23</a> — Mon Mar 14, 2022 5:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dogbuilder23]]></name></author>
		<updated>2022-03-14T17:49:37+00:00</updated>

		<published>2022-03-14T17:49:37+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43931#p43931</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43931#p43931"/>
		<title type="html"><![CDATA[Re: Not connected to physics server when trying to run environment]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43931#p43931"><![CDATA[
I'm getting this error when trying to run <br><a href="https://github.com/OpenQuadruped/spot_mini_mini/blob/spot/spot_bullet/src/spot_ars.py" class="postlink">https://github.com/OpenQuadruped/spot_m ... pot_ars.py</a><br><br>regardless of the flag values I choose.<br><br>I'm running <br>Python 3.8.9 <br>pybullet build time: Dec 27 2021 18:13:03<br>MacOS 12.0.1, on a MacBook Pro (16-inch, 2021) M1 Max.<br><br>I'm a PyBullet noob. Any advice would be appreciated.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14284">dogbuilder23</a> — Mon Mar 14, 2022 5:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2020-06-06T06:35:20+00:00</updated>

		<published>2020-06-06T06:35:20+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42895#p42895</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42895#p42895"/>
		<title type="html"><![CDATA[Re: Not connected to physics server when trying to run environment]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42895#p42895"><![CDATA[
<blockquote class="uncited"><div>Comment this code and replace them with a pass, everything will be fine. </div></blockquote>The pybullet connection for those envs are created in the env.reset() method.<br>You are making a call to global pybullet.getNumBodies before calling the reset, which is wrong.<br>Also, it is unsafe to use global pybullet together with a bullet_client.<br><br><div class="codebox"><p>Code: </p><pre><code>env = gym.make("AntBulletEnv-v0")print(p.getNumBodies())print(env.reset())</code></pre></div>Change the code to this:<br><div class="codebox"><p>Code: </p><pre><code>env = gym.make("AntBulletEnv-v0")print(env.reset())print(p.getNumBodies())</code></pre></div>The delayed __del__ is not an issue at all, since the env.close() calls the disconnect.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Sat Jun 06, 2020 6:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caffett]]></name></author>
		<updated>2019-11-14T05:30:59+00:00</updated>

		<published>2019-11-14T05:30:59+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42473#p42473</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42473#p42473"/>
		<title type="html"><![CDATA[Re: Not connected to physics server when trying to run environment]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42473#p42473"><![CDATA[
Sorry, this just can fix my issue.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13464">caffett</a> — Thu Nov 14, 2019 5:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caffett]]></name></author>
		<updated>2019-11-14T05:24:13+00:00</updated>

		<published>2019-11-14T05:24:13+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42472#p42472</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42472#p42472"/>
		<title type="html"><![CDATA[Re: Not connected to physics server when trying to run environment]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42472#p42472"><![CDATA[
<a href="https://github.com/bulletphysics/bullet3/blob/master/examples/pybullet/gym/pybullet_envs/bullet/bullet_client.py#L18-#L22" class="postlink">https://github.com/bulletphysics/bullet ... y#L18-#L22</a><br><br>Comment this code and replace them with a pass, everything will be fine. <br><br>The python garbage collection mechanism will not delete the variable immediately. Thus,  there will be a delay to call the __del__. When the __del__ is called, it will close the current connection, however, due to the delay, the connection might not be the connection we want to close at begin.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13464">caffett</a> — Thu Nov 14, 2019 5:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caffett]]></name></author>
		<updated>2019-11-13T21:40:55+00:00</updated>

		<published>2019-11-13T21:40:55+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42471#p42471</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42471#p42471"/>
		<title type="html"><![CDATA[Re: Not connected to physics server when trying to run environment]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42471#p42471"><![CDATA[
Similar bug.<div class="codebox"><p>Code: </p><pre><code># -*- coding: utf-8 -*-import pybullet as pimport pybullet_envsimport gymdef show_bug():env = gym.make("AntBulletEnv-v0")print(env.reset())print(p.getNumBodies())env.step(env.action_space.sample())env.close()env = gym.make("AntBulletEnv-v0")print(env.reset())print(p.getNumBodies())env.step(env.action_space.sample())env.close()env = gym.make("AntBulletEnv-v0")print(p.getNumBodies())print(env.reset())env.step(env.action_space.sample())env.close()print("end!")if __name__ == "__main__":show_bug()</code></pre></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13464">caffett</a> — Wed Nov 13, 2019 9:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jboyml]]></name></author>
		<updated>2019-07-22T20:52:44+00:00</updated>

		<published>2019-07-22T20:52:44+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42282#p42282</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42282#p42282"/>
		<title type="html"><![CDATA[Not connected to physics server when trying to run environment]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42282#p42282"><![CDATA[
Hi,<br><br>I'm trying to use PyBullet for reinforcement learning and can't get started with a simple example. The code below fails with the following error:<blockquote class="uncited"><div>Traceback (most recent call last):<br>  File "test.py", line 10, in &lt;module&gt;<br>    observation, reward, done, info = env.step(action)<br>  File "/home/john/anaconda3/lib/python3.6/site-packages/gym/wrappers/time_limit.py", line 15, in step<br>    observation, reward, done, info = self.env.step(action)<br>  File "/home/john/anaconda3/lib/python3.6/site-packages/pybullet_envs/gym_pendulum_envs.py", line 31, in step<br>    self.robot.apply_action(a)<br>  File "/home/john/anaconda3/lib/python3.6/site-packages/pybullet_envs/robot_pendula.py", line 25, in apply_action<br>    self.slider.set_motor_torque(100 * float(np.clip(a[0], -1, +1)))<br>  File "/home/john/anaconda3/lib/python3.6/site-packages/pybullet_envs/robot_bases.py", line 381, in set_motor_torque<br>    self.set_torque(torque)<br>  File "/home/john/anaconda3/lib/python3.6/site-packages/pybullet_envs/robot_bases.py", line 387, in set_torque<br>    force=torque)#,  positionGain=0.1, velocityGain=0.1)<br>pybullet.error: Not connected to physics server.</div></blockquote><div class="codebox"><p>Code: </p><pre><code>import gymimport pybullet, pybullet_envsenv = gym.make('InvertedPendulumBulletEnv-v0')observation = env.reset()for _ in range(1000):    env.render()    action = env.action_space.sample()    observation, reward, done, info = env.step(action)    if done:        observation = env.reset()    env.close()</code></pre></div>I'm using Python 3.6.7 and PyBullet 2.5.2 installed using pip on Ubuntu. Any ideas?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13354">jboyml</a> — Mon Jul 22, 2019 8:52 pm</p><hr />
]]></content>
	</entry>
	</feed>
