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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2006-01-02T02:32:45+00:00</updated>

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

		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2006-01-02T02:32:45+00:00</updated>

		<published>2006-01-02T02:32:45+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=560#p560</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=560#p560"/>
		<title type="html"><![CDATA[Trouble with BulletOde]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=560#p560"><![CDATA[
Hi Jan,<br><br>Thanks for the feedback. BulletOde is not very robust for large size-ratios. Partly this is due to the implementation, and partly due to the nature of the sub-distance algorithm (innerloop replacement of Johnson within GJK).<br><br>There are are couple of options to check out, and I will have a look at it.<br>Basically there are several independent cases in contact generation:<br>penetration deeper then the  collision margins, distance within the collision margins, separating distance bigger then the collision margin.<br><br>BulletOde will pick up 1 contact point at a time, and add new points to a persistent manifold. Usually this isn't a big problem, but it does add artifacts. I don't think this is your problem.<br><br>I will try to make some tests and let you know. If the problem turns out to be GJK related, I will ask Gino or Christer if they also experienced problems with large ratios between features (150 versus 0.1 in your testcase) are similar.<br><br>Thanks again,<br>Erwin<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Mon Jan 02, 2006 2:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jst]]></name></author>
		<updated>2006-01-02T00:02:25+00:00</updated>

		<published>2006-01-02T00:02:25+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=559#p559</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=559#p559"/>
		<title type="html"><![CDATA[Trouble with BulletOde]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=559#p559"><![CDATA[
Hello Erwin,<br><br>many thanks for your wonderful project.<br><br>I am currently trying to use BulletOde to add collision support for convex shapes to my application, but have run into some difficulies with that : eg. my usually well-behaved stack of Jenga blocks is exploding like popcorn in a microwave, single Jenga blocks are gaining momentum and rolling across the tabletop when they should just rest in place, and I get displays of collision points in far outside the geoms involved.<br><br>To investigate this, I have made some simple tests (without using my own framework to avoid introducing errors from there):<br>I create a large tabletop using an ode box primitive (object1 o1) and a small box by adding the 8 corner points to a convex shape (object2 o2).<br>I manually position o2 so that is just intersects the top surface of o1 and then call dCollide directly on the two geoms.<br>The result is just 1 contact point, which I think would need to be in the center of contact area to avoid generating torque for o2.<br>If o2 is centered on top of o1, the results are as expected, but as o2 moves away from the center of o1 towards the edge of the "table", the difference between the expected and reported contact position get larger. This effect seems very small if o1 and o2 have similar scale, but increases dramatically if that is not the case.<br>If the scale ratio is large enough (75:1) the system can even miss the collision entirely if o2 isn't close to the center of the table o1.<br><br>Example 1:<br>Ratio 2.5:1<br>o1 Tabletop length/width/height 5.0/5.0/2.0<br>o1 Position 0.0, 0.0, -1.0<br>o2 ConvexBox x: (-1)...(1) y: (-1)...(1) z: (-0.1)...(0.1)<br>o2 Position (2.0, 0.0, 0.05)<br><br>1 Collisions detected @ (1.42857 , 1.04305e-007 , -0.0250005) Normal : (0 , 1.78803e-006 , -1) Depth : 0.050001<br><br>Deviation from expected collision point (x-axis only) (2.0 - 1.42857) = 0.571429 ~ 57% relative to o2's size<br><br><br>Example 2:<br>Ratio 75:1<br>o1 Tabletop length/width/height 150.0/150.0/2.0<br>o1 Position 0.0, 0.0, -1.0<br>o2 ConvexBox x: (-1)...(1) y: (-1)...(1) z: (-0.1)...(0.1)<br>o2 Position (48.75, 0.0, 0.05)<br><br>0 Collisions detected. !!!<br><br><br>This is the code that I used for the tests:<div class="codebox"><p>Code: </p><pre><code>#include "ode/ode.h"#include "CollisionShapes/ConvexHullShape.h"#include "BulletOdeCollide.h"#include &lt;iostream&gt;#include &lt;fstream&gt;#include &lt;sstream&gt;void buildBox(std::stringstream&amp; LOG, ConvexHullShape* hullShape, float x_min, float x_max, float y_min, float y_max, float z_min, float z_max){hullShape-&gt;AddPoint(SimdPoint3(x_min, y_min, z_min));hullShape-&gt;AddPoint(SimdPoint3(x_min, y_min, z_max));hullShape-&gt;AddPoint(SimdPoint3(x_min, y_max, z_min));hullShape-&gt;AddPoint(SimdPoint3(x_min, y_max, z_max));hullShape-&gt;AddPoint(SimdPoint3(x_max, y_min, z_min));hullShape-&gt;AddPoint(SimdPoint3(x_max, y_min, z_max));hullShape-&gt;AddPoint(SimdPoint3(x_max, y_max, z_min));hullShape-&gt;AddPoint(SimdPoint3(x_max, y_max, z_max));//hullShape-&gt;SetMargin(0.04f);hullShape-&gt;SetMargin(1e-6f);hullShape-&gt;setLocalScaling(SimdVector3(1.f, 1.f, 1.f));LOG &lt;&lt; "o2 ConvexBox x:(" &lt;&lt; x_min &lt;&lt; ")...(" &lt;&lt; x_max &lt;&lt; ") y:(" &lt;&lt; y_min &lt;&lt; ")...(" &lt;&lt; y_max &lt;&lt; ") z:(" &lt;&lt; z_min &lt;&lt; ")...(" &lt;&lt; z_max &lt;&lt; ")";}void collideLOG(std::stringstream&amp; LOG, dGeomID o1, dGeomID o2, float cboxhsize){dContactGeom contactGeom[1024];int numc = dCollide(o1, o2, 128, contactGeom, sizeof(dContactGeom));LOG &lt;&lt; std::endl;LOG &lt;&lt; "Geom 1 Pos: (" &lt;&lt; dGeomGetPosition(o1)[0] &lt;&lt; " , " &lt;&lt;dGeomGetPosition(o1)[1] &lt;&lt; " , " &lt;&lt;dGeomGetPosition(o1)[2] &lt;&lt; ") ";LOG &lt;&lt; "Geom 2 Pos: (" &lt;&lt; dGeomGetPosition(o2)[0] &lt;&lt; " , " &lt;&lt;dGeomGetPosition(o2)[1] &lt;&lt; " , " &lt;&lt;dGeomGetPosition(o2)[2] &lt;&lt; ")" &lt;&lt; std::endl;LOG &lt;&lt;  numc &lt;&lt; " Collisions detected." ;if (numc &gt; 0)LOG &lt;&lt; " Contact diff.%: " &lt;&lt; ((dGeomGetPosition(o2)[0] - contactGeom[0].pos[0]) / cboxhsize * 100.f )&lt;&lt; std::endl;elseLOG &lt;&lt; std::endl;for (int i = 0; i &lt; numc; ++i) {LOG &lt;&lt; "Col " &lt;&lt; (i+1) &lt;&lt; ": (" &lt;&lt;contactGeom[i].pos[0] &lt;&lt; " , " &lt;&lt;contactGeom[i].pos[1] &lt;&lt; " , " &lt;&lt;contactGeom[i].pos[2] &lt;&lt; ")" &lt;&lt;" Normal : (" &lt;&lt;contactGeom[i].normal[0] &lt;&lt; " , " &lt;&lt;contactGeom[i].normal[1] &lt;&lt; " , " &lt;&lt;contactGeom[i].normal[2] &lt;&lt; ")" &lt;&lt;" Depth : " &lt;&lt;contactGeom[i].depth &lt;&lt; std::endl;}}void BulletOdeTest(){// setup loggingstd::stringstream LOG;LOG.precision(6);LOG.width(0);LOG.fill(' ');// create worlddSpaceID World = dSimpleSpaceCreate(0);const dQuaternion identity = {1.f, 0.f, 0.f, 0.f};// setup object parameters// EDIT HEREconst float o1length = 150.0f;const float o1width = 150.0f;const float o1height = 2.0f;const float cboxhsize = 1.0f;const float cboxhheight = 0.1f;const float startpos = 0.f;// create object 1LOG &lt;&lt; "o1 Box l:" &lt;&lt; o1length &lt;&lt; " w: " &lt;&lt; o1width &lt;&lt; " h: " &lt;&lt; o1height &lt;&lt; " ";dGeomID o1 = dCreateBox(World, o1length, o1width, o1height);dGeomSetPosition(o1, startpos, 0.0f, -(o1height / 2.f));dGeomSetQuaternion(o1, identity);// create object 2ConvexHullShape* hullShape = new ConvexHullShape(0,0);buildBox(LOG, hullShape, -cboxhsize, +cboxhsize, -cboxhsize, +cboxhsize, -cboxhheight, +cboxhheight);dGeomID o2 = dCreateConvex(World,hullShape);dGeomSetQuaternion(o2, identity);// move object 2 across o1's surfacefor (float pos = startpos; pos &lt; startpos + (o1length / 2.f); pos += (o1length / 40.f)) {dGeomSetPosition(o2, pos, 0.f, cboxhheight / 2.f);collideLOG(LOG, o1, o2, cboxhsize);}std::ofstream LOGFILE;LOGFILE.open("logfile.txt");LOGFILE &lt;&lt; LOG.str();LOGFILE.close();std::cout &lt;&lt; LOG.str();}int main(int argc, char* argv[]){BulletOdeTest();return 0;}</code></pre></div>Is this behavior to be expected, e.g. a weakness of the GJK-algorithm (of which I know nothing yet, will pick up Christer Ericson's book tomorrow) or just a fluke in Bullet or BulletOde?<br><br>Thanks in advance,<br>Jan<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=395">jst</a> — Mon Jan 02, 2006 12:02 am</p><hr />
]]></content>
	</entry>
	</feed>
