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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2020-05-10T14:47:04+00:00</updated>

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

		<entry>
		<author><name><![CDATA[kfa22]]></name></author>
		<updated>2020-05-10T14:47:04+00:00</updated>

		<published>2020-05-10T14:47:04+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42839#p42839</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42839#p42839"/>
		<title type="html"><![CDATA[Re: control robot using jupyter notebook with threads]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42839#p42839"><![CDATA[
Found a solution that kind of works, see attached jupyter notebook - it provides a way to control Minitaur motors with Sliders in realtime, and plots resulting angles in realtime.<br><br>It uses <a href="https://github.com/kirill888/jupyter-ui-poll" class="postlink">https://github.com/kirill888/jupyter-ui-poll</a> to request information from sliders in realtime, and convert to an action array.<br><br>Live graphing is done via: <a href="https://github.com/matplotlib/ipympl" class="postlink">https://github.com/matplotlib/ipympl</a>. The frame rate is not great (about 1 fps), but blitting doesn't seem to work in jupyterlab yet.<dl class="file"><dt><span class="imageset icon_topic_attach"></span> <a class="postlink" href="https://pybullet.org/Bullet/phpBB3/download/file.php?id=1826">MinitaurControlWithSliders.zip</a></dt></dl><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13602">kfa22</a> — Sun May 10, 2020 2:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kfa22]]></name></author>
		<updated>2020-04-26T09:10:17+00:00</updated>

		<published>2020-04-26T09:10:17+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42808#p42808</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42808#p42808"/>
		<title type="html"><![CDATA[control robot using jupyter notebook with threads]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42808#p42808"><![CDATA[
Hi,<br><br>I am controlling a minitaur environment from jupyter notebook, and want to experiment with different gaits. For this, I have set up several slider widgets, one for each leg motor. Every time I move a slider, a new action array is sent to env.step(action_array), which causes the simulation to move one step.<br><br>Now I would like to make it realtime, but as soon as i enable pb.setRealtimeSimulation(1) the robot falls over. I am guessing it needs to receive an action array continuously, not just when my slider values change.<br><br>My attempt to do this was:<br>a) create an infinite loop that reads the latest action_array and calls env.step(action_array) - I assume this would stabilise the robot and keep it fixed in position<br>b) have a seperate thread for the sliders, which updates the action_array<br><br>I used python multiprocessing to create the infinite loop, passing variable env to a worker, which calls env.step, reading action_array from a Queue, but the simulation does not step. Elsewhere I put an action_array on the queue. I would expect the worker thread to read action_array from the queue, and run env.step. If there is nothing on the queue, it will just sent latest_action_array.<br><br>Could someone help, maybe I am making it too complicated.<br><br>Many thanks,<br>Kai<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13602">kfa22</a> — Sun Apr 26, 2020 9:10 am</p><hr />
]]></content>
	</entry>
	</feed>
