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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2021-01-06T13:47:55+00:00</updated>

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

		<entry>
		<author><name><![CDATA[Ehsanizadi]]></name></author>
		<updated>2021-01-06T13:47:55+00:00</updated>

		<published>2021-01-06T13:47:55+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43243#p43243</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43243#p43243"/>
		<title type="html"><![CDATA[Re: Spring between two dynamic objects]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43243#p43243"><![CDATA[
Hi there,<br><br>I am exactly looking for the same thing.<br>I did not find a point to point spring feature, however, a workaround might be to dynamically adjust the stiffness and damping of the point to point object at each time step when the orientation of the two dynamic bodies are altered.<br><br>BTW if you found or wrote a snippet for handling this, please let me know.<br><br>Thanks<br>E30<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10588">Ehsanizadi</a> — Wed Jan 06, 2021 1:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[random]]></name></author>
		<updated>2019-11-24T02:49:22+00:00</updated>

		<published>2019-11-24T02:49:22+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42495#p42495</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42495#p42495"/>
		<title type="html"><![CDATA[Re: Spring between two dynamic objects]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42495#p42495"><![CDATA[
UPDATE: <br><br>Apparently it was not the spring that was causing the issue. It was the setting of linear limits on 6DOF constraint.<br>It only happens with some combinations of initial position / pivot point offset / linear range. <br>Once I changed them it was quite difficult to reproduce the problem again. Anyway the code below shows the problem. <br>Note how the issue does not happen with btSliderConstraint, only with 6DOF constraint.<br><div class="codebox"><p>Code: </p><pre><code>btTransform Tr(double x, double y, double z){return btTransform( btQuaternion(0,0,0,1), btVector3(x,y,z) );}btTransform Rot(int axis){btVector3 a(0,0,0);a.m_floats[axis] = 1;return btTransform( btQuaternion(a,M_PI/2), btVector3(0,0,0) );}void SpringTest::initPhysics(){m_guiHelper-&gt;setUpAxis(1);createEmptyDynamicsWorld();btBoxShape* groundShape = createBoxShape(btVector3(btScalar(50.), btScalar(50.), btScalar(50.)));m_collisionShapes.push_back(groundShape);createRigidBody(0.0f, Tr(0,-50,0), groundShape, btVector4(0, 0, 1, 1));auto shape1 = new btBoxShape(btVector3(0.5, 0.25,0.75));auto shape2 = new btBoxShape(btVector3(0.4, 0.2,0.6));m_collisionShapes.push_back(shape1);m_collisionShapes.push_back(shape2);auto b1 = createRigidBody(1, Tr(0, 2, 0), shape1);auto b2 = createRigidBody(1, Tr(0, 4, 0), shape2);auto t1 = Rot(2)*Tr(0,0,0);auto t2 = Rot(2)*Tr(2,0,0);#if 0auto spring = new btSliderConstraint(*b1, *b2, t1, t2,true);spring-&gt;setLowerLinLimit(3);spring-&gt;setUpperLinLimit(4);#elseauto spring = new btGeneric6DofConstraint(*b1, *b2, t1, t2, true);spring-&gt;setOverrideNumSolverIterations(30);spring-&gt;setLimit(0, 3, 4);spring-&gt;setLimit(1, 0, 0);spring-&gt;setLimit(2, 0, 0);spring-&gt;setLimit(3, 0, 0);spring-&gt;setLimit(4, 0, 0);spring-&gt;setLimit(5, 0, 0);#endifm_dynamicsWorld-&gt;addConstraint(spring, true);m_guiHelper-&gt;autogenerateGraphicsObjects(m_dynamicsWorld);}</code></pre></div><br>PS: I realized what I really need is a point-to-point spring constraint (where both ends of sprint are allowed to rotate).  Is there such a thing in bullet or do I have to make it myself?<br><br>Regards,<br>R<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13194">random</a> — Sun Nov 24, 2019 2:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[random]]></name></author>
		<updated>2019-11-22T10:05:57+00:00</updated>

		<published>2019-11-22T10:05:57+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42490#p42490</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42490#p42490"/>
		<title type="html"><![CDATA[Spring between two dynamic objects]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42490#p42490"><![CDATA[
Greetings,<br><br>I'm trying to create a spring using either btGeneric6DofSpring2Constraint or btGeneric6DofSpringConstraint and I'm failing miserably.<br>In all the examples I could find one body is always static, and that seems to work fine. As soon as I make both bodies dynamic the whole thing just spins like crazy and shoots off to outer space.<br><br>In fact I couldn't even get btGeneric6DofConstraint to act like a slider. Eg, this works as expected:<div class="codebox"><p>Code: </p><pre><code>auto spring = new btSliderConstraint(*disk1, *disk2, t1, t2,true);spring-&gt;setLowerLinLimit(3);spring-&gt;setUpperLinLimit(4);</code></pre></div>while this doesn't:<div class="codebox"><p>Code: </p><pre><code>auto spring = new btGeneric6DofConstraint(*disk1, *disk2, t1, t2, true);spring-&gt;setLimit(0, 3, 4);spring-&gt;setLimit(1, 0, 0);spring-&gt;setLimit(2, 0, 0);spring-&gt;setLimit(3, 0, 0);spring-&gt;setLimit(4, 0, 0);spring-&gt;setLimit(5, 0, 0);</code></pre></div>Interestingly, rotation works fine, it is only linear motion that causes problems.<br>I must be missing something obvious.Can someone point me to a working example?<br><br>Another question is how do I set the parameters? What are the units? <br>For example I would like to have two disks (say cylinders R=0.5, h = 0.2, mass 1) constrained to move slide in the direction of cylinder axis within the range (say say 2 to 4 between CM) and with the spring between them with equilibrium point at max range and parameters set so that when the bottom disk is laying on the ground the top one sags by 1 under the force of gravity and oscillates with a freq of say 2 Hz and the damping set so that it stops oscillating after 3..5 periods. <br><br>Thanks,<br>R<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13194">random</a> — Fri Nov 22, 2019 10:05 am</p><hr />
]]></content>
	</entry>
	</feed>
