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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2020-06-07T10:05:37+00:00</updated>

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

		<entry>
		<author><name><![CDATA[garcieri]]></name></author>
		<updated>2020-06-07T10:05:37+00:00</updated>

		<published>2020-06-07T10:05:37+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42896#p42896</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42896#p42896"/>
		<title type="html"><![CDATA[Re: Rewards function]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42896#p42896"><![CDATA[
Hi, <br>Thank you for your reply. I downgraded to that version of pybullet because, when making an environment (e.g. env = gym.make('HalfCheetahMuJoCoEnv-v0')) using pybullet 2.8.1, I receive the error: ImportError: cannot import name 'bullet_client'. This does not happen with pybullet 2.5.9. Not sure why, but since I am rather new with pybullet, I trusted other people who suggested to downgrade the version.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13652">garcieri</a> — Sun Jun 07, 2020 10:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2020-06-06T06:03:08+00:00</updated>

		<published>2020-06-06T06:03:08+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42894#p42894</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42894#p42894"/>
		<title type="html"><![CDATA[Re: Rewards function]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42894#p42894"><![CDATA[
<blockquote class="uncited"><div>I am using PyBullet 2.5.9 and Python 3.6.9</div></blockquote>That is a very old pybullet version, can you update to the latest and check again?<br><br><div class="codebox"><p>Code: </p><pre><code>pip3 install pybullet --upgrade --user</code></pre></div>&gt;&gt; delay with env.close() as reported here<br><br>No, that is not the issue and not a bug.<br>The Gym env creates a connection during 'reset', not at gym.make, so you cannot use 'p' until after env.reset.<br>In that 'bug' he uses 'p' before calling reset.<br>Also, you should not mix a global pybullet 'p' with a bullet_client 'env._p'.<br>Can you create a small reproduction case and file it in <a href="https://github.com/bulletphysics/bullet3/issues" class="postlink">https://github.com/bulletphysics/bullet3/issues</a><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:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[garcieri]]></name></author>
		<updated>2020-06-05T12:13:03+00:00</updated>

		<published>2020-06-05T12:13:03+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42893#p42893</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42893#p42893"/>
		<title type="html"><![CDATA[Re: Rewards function]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42893#p42893"><![CDATA[
I found another way to simulate the reward function of a MuJoCo environment without actually defining it. Basically, I create a new environment, as a "copy" of the first one, as explained here <a href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?f=24&amp;t=12855&amp;p=42599" class="postlink">viewtopic.php?f=24&amp;t=12855&amp;p=42599</a>, then I apply the action to the second env and collect the reward (to make this work, you also need to set the env.robot.pos_after equal to the one of the first env, otherwise the potential is different). After computing the reward, I close the env, since this step is repeated many times in my RL algorithm. <br>Anyway, after having computed 5 rewards, my loop is interrupted because pybullet is no longer connected to the physics server. The reason seems to be in a delay with env.close() as reported here <a href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?t=12722" class="postlink">viewtopic.php?t=12722</a>.<br><br>How can I solve this bug?<br><br>I am using PyBullet 2.5.9 and Python 3.6.9<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13652">garcieri</a> — Fri Jun 05, 2020 12:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[garcieri]]></name></author>
		<updated>2020-06-03T14:26:10+00:00</updated>

		<published>2020-06-03T14:26:10+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42886#p42886</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42886#p42886"/>
		<title type="html"><![CDATA[Rewards function]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42886#p42886"><![CDATA[
Hi,<br><br>I am using pybullet environments to benchmark some model-based RL algorithms. In my work, I access the reward function of the environments, so I usually write a function that takes as inputs a state and an action, and outputs the reward. Anyway for locomotion environments, it is not trivial to write this function on my own, looking at the pybullet github code. So my question is: has anyone implemented this kind of function for locomotion tasks?<br><br>Thank you!<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13652">garcieri</a> — Wed Jun 03, 2020 2:26 pm</p><hr />
]]></content>
	</entry>
	</feed>
