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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2022-02-23T15:05:58+00:00</updated>

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

		<entry>
		<author><name><![CDATA[Dragonlord]]></name></author>
		<updated>2022-02-23T15:05:58+00:00</updated>

		<published>2022-02-23T15:05:58+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43894#p43894</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43894#p43894"/>
		<title type="html"><![CDATA[Re: Unstable behavior on shapes like cylinder or box]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43894#p43894"><![CDATA[
It seems to use rolling friction you need to also enable anisotropic rolling friction. Doing so makes the rolling friction work without objects standing on the edges that much. There is still some  angles at which they stand still but I'll go through the bullet examples and collect the parameters used. Maybe I see something that changed. I'm also used to the old code and just updated from 2.87 to 2.89 . I guess I have to adjust some more values to get it working again. As good as in the examples would be enough for me. Right now a tower of cans for ball throwing won't stack beyond the bottom layer so there is something still off.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=798">Dragonlord</a> — Wed Feb 23, 2022 3:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[drleviathan]]></name></author>
		<updated>2022-02-23T14:26:52+00:00</updated>

		<published>2022-02-23T14:26:52+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43893#p43893</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43893#p43893"/>
		<title type="html"><![CDATA[Re: Unstable behavior on shapes like cylinder or box]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43893#p43893"><![CDATA[
Yes interesting. I downloaded your source code this morning and was looking around.  I checked the commit logs and saw that you may have made some progress on the problem.  I then diffed with history to browse the relevant changes.<br><br>To tell the truth, I don't have any experience with rolling/spinning friction.  It looks like they were added/enabled back in late 2019 and all of my personal Bullet experience is prior to that year (maybe I should stop trying to answer questions on this forum).  It is possible you've encountered a new/real bug in the Bullet simulation.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11033">drleviathan</a> — Wed Feb 23, 2022 2:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dragonlord]]></name></author>
		<updated>2022-02-23T00:56:56+00:00</updated>

		<published>2022-02-23T00:56:56+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43890#p43890</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43890#p43890"/>
		<title type="html"><![CDATA[Re: Unstable behavior on shapes like cylinder or box]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43890#p43890"><![CDATA[
I've done some more experimenting and disabled this and that rigid body option until I got a change. It looks like the rolling friction cause the problem. I used the value from the RollingFrictionDemo which is 0.1f . Using this value the cylinder does not roll but can even stand on its edge at 80 degrees. If I set the rolling friction to 0 (which is the default) then the edge standing problem is gone but the cylinder starts rolling away accelerating while doing so.<br><br>How can I thus prevent cylinders from rolling (and accelerating) on the floor without standing ridiculously on their edge? The demo values do not seem to work.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=798">Dragonlord</a> — Wed Feb 23, 2022 12:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dragonlord]]></name></author>
		<updated>2022-02-22T21:46:15+00:00</updated>

		<published>2022-02-22T21:46:15+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43888#p43888</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43888#p43888"/>
		<title type="html"><![CDATA[Re: Unstable behavior on shapes like cylinder or box]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43888#p43888"><![CDATA[
<blockquote class="uncited"><div>Ok that <strong class="text-strong">debpMotionState</strong> looks fine: I don't see any misbehaving logic there.</div></blockquote>Any ideas where I could put a lever to debug this problem? I tried examining the contact constraint generated but I did not get the impression something is wrong. That said I'm not much into physics coding so I don't know what kind of values would look wrong.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=798">Dragonlord</a> — Tue Feb 22, 2022 9:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[drleviathan]]></name></author>
		<updated>2022-02-22T17:50:11+00:00</updated>

		<published>2022-02-22T17:50:11+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43887#p43887</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43887#p43887"/>
		<title type="html"><![CDATA[Re: Unstable behavior on shapes like cylinder or box]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43887#p43887"><![CDATA[
Ok that <strong class="text-strong">debpMotionState</strong> looks fine: I don't see any misbehaving logic there.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11033">drleviathan</a> — Tue Feb 22, 2022 5:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dragonlord]]></name></author>
		<updated>2022-02-22T17:14:46+00:00</updated>

		<published>2022-02-22T17:14:46+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43886#p43886</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43886#p43886"/>
		<title type="html"><![CDATA[Re: Unstable behavior on shapes like cylinder or box]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43886#p43886"><![CDATA[
<blockquote class="uncited"><div>The beer can... when it lands on the ground does it get deactivated?  or does it remain active?<br><br>Are you using a custom <strong class="text-strong">MotionState</strong> in your game?  If so, what does its <strong class="text-strong">getWorldTransform()</strong> and <strong class="text-strong">setWorldTransform()</strong> implementations look like?</div></blockquote>Yes, a motion state is used. The code is here: <a href="https://github.com/LordOfDragons/dragengine/blob/master/src/modules/physics/bullet/src/debpMotionState.cpp" class="postlink">https://github.com/LordOfDragons/dragen ... nState.cpp</a><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=798">Dragonlord</a> — Tue Feb 22, 2022 5:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[drleviathan]]></name></author>
		<updated>2022-02-22T16:55:00+00:00</updated>

		<published>2022-02-22T16:55:00+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43885#p43885</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43885#p43885"/>
		<title type="html"><![CDATA[Re: Unstable behavior on shapes like cylinder or box]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43885#p43885"><![CDATA[
The beer can... when it lands on the ground does it get deactivated?  or does it remain active?<br><br>Are you using a custom <strong class="text-strong">MotionState</strong> in your game?  If so, what does its <strong class="text-strong">getWorldTransform()</strong> and <strong class="text-strong">setWorldTransform()</strong> implementations look like?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11033">drleviathan</a> — Tue Feb 22, 2022 4:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dragonlord]]></name></author>
		<updated>2022-02-22T12:03:41+00:00</updated>

		<published>2022-02-22T12:03:41+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43884#p43884</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43884#p43884"/>
		<title type="html"><![CDATA[Re: Unstable behavior on shapes like cylinder or box]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43884#p43884"><![CDATA[
<blockquote class="uncited"><div>The box and cylinder shapes are not unstable.  I've seen them work fine.<br><br>I don't know what is wrong with your beer can.  It behaves as if... the moment it hits the ground its world-frame inverse inertia tensor gets zero elements in the two axes perpendicular to the UP direction.  That is: it is constrained to only rotate about world-frame UP axis.  I can't imagine what would do that except for rogue custom code that is somehow <strong class="text-strong">(a)</strong> messing with the object's inertia tensor, <strong class="text-strong">(b)</strong> applying a hinge constraint or <strong class="text-strong">(c)</strong> some Action that is incorrectly slamming the object's angular velocity every frame.<br><br>Friction can be set per-object via <strong class="text-strong">btCollisionObject::setFriction()</strong>, but I assume you've been trying that.  I've seen situations where some bodies never settle and instead just rattle around.  As I recall they was caused by: <strong class="text-strong">(1)</strong> incorrect inertia tensor for tiny objects, <strong class="text-strong">(2)</strong> high restitution, zero damping, and too-small sleeping thresholds, and <strong class="text-strong">(3)</strong> a bug where custom Action was incorrectly re-activating the object every frame.</div></blockquote>I added a printf to check the inertia tensor. I have the impression it is okay. At last I see no zero's:<br>updateInertiaTensor: 0x555abd8c9a80 [83.7424,9.44874,-22.1889][9.44874,92.087,-34.0537][-22.1889,-34.0537,157.556]<br><br>This method is called every call to stepSimulation(). Is this correct?<br><br>I also put a printf on setAngularVelocity in btRigidBody. There is no call to this method so none of my code messes with the angular velocity without my knowledge.<br><br>I'm also adding no constraint.<br><br>Any other ideas what could be wrong? How can I approach debugging this issue?<br><br>EDIT: I tried getting values from a single run of setupContactConstraint of the situation above where the can is nearly flat on the ground spinning. Maybe you see some value which is glaringly off or broken? <a href="https://pastebin.com/7VaYd9U0" class="postlink">https://pastebin.com/7VaYd9U0</a><br><br>EDIT: EDIT: I've also logged all updateInertiaTensor() calls of the object. At no time zero values are present in the tensor.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=798">Dragonlord</a> — Tue Feb 22, 2022 12:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[drleviathan]]></name></author>
		<updated>2022-02-22T01:42:30+00:00</updated>

		<published>2022-02-22T01:42:30+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43883#p43883</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43883#p43883"/>
		<title type="html"><![CDATA[Re: Unstable behavior on shapes like cylinder or box]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43883#p43883"><![CDATA[
The box and cylinder shapes are not unstable.  I've seen them work fine.<br><br>I don't know what is wrong with your beer can.  It behaves as if... the moment it hits the ground its world-frame inverse inertia tensor gets zero elements in the two axes perpendicular to the UP direction.  That is: it is constrained to only rotate about world-frame UP axis.  I can't imagine what would do that except for rogue custom code that is somehow <strong class="text-strong">(a)</strong> messing with the object's inertia tensor, <strong class="text-strong">(b)</strong> applying a hinge constraint or <strong class="text-strong">(c)</strong> some Action that is incorrectly slamming the object's angular velocity every frame.<br><br>Friction can be set per-object via <strong class="text-strong">btCollisionObject::setFriction()</strong>, but I assume you've been trying that.  I've seen situations where some bodies never settle and instead just rattle around.  As I recall they was caused by: <strong class="text-strong">(1)</strong> incorrect inertia tensor for tiny objects, <strong class="text-strong">(2)</strong> high restitution, zero damping, and too-small sleeping thresholds, and <strong class="text-strong">(3)</strong> a bug where custom Action was incorrectly re-activating the object every frame.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11033">drleviathan</a> — Tue Feb 22, 2022 1:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dragonlord]]></name></author>
		<updated>2022-02-21T16:07:12+00:00</updated>

		<published>2022-02-21T16:07:12+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43881#p43881</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43881#p43881"/>
		<title type="html"><![CDATA[Re: Unstable behavior on shapes like cylinder or box]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43881#p43881"><![CDATA[
I've added a small video showing the problem.<div class="inline-attachment"><dl class="file"><dt class="attach-image"><img src="https://pybullet.org/Bullet/phpBB3/download/file.php?id=1925" class="postimage" alt="screencap.gif" onclick="viewableArea(this);" /></dt></dl></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=798">Dragonlord</a> — Mon Feb 21, 2022 4:07 pm</p><hr />
]]></content>
	</entry>
	</feed>
