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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2021-09-10T15:24:29+00:00</updated>

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

		<entry>
		<author><name><![CDATA[StriderH]]></name></author>
		<updated>2021-09-10T15:24:29+00:00</updated>

		<published>2021-09-10T15:24:29+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43595#p43595</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43595#p43595"/>
		<title type="html"><![CDATA[btMultiBodyJointLimitConstraint issues]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43595#p43595"><![CDATA[
I'm having trouble using a btMultiBodyJointLimitConstraint, as I'm seeing the revolute joint violate the upper and lower limits often. Does anybody know how to make the joint respect the constraint in these two scenarios?<br><br><strong class="text-strong">Scenario A</strong><br>1) I start with the InvertedPendulumPDControl example.<br>2) I comment out the m_multiBody-&gt;addJointTorque line, so the pendulum isn't being moved.<br>3) I (theoretically) constrain the pendulum to be pointed to the side with:<div class="codebox"><p>Code: </p><pre><code>m_dynamicsWorld-&gt;addMultiBodyConstraint(new btMultiBodyJointLimitConstraint(m_multiBody, 0, btRadians(80.f), btRadians(90.f)));</code></pre></div>If I run the program, the pendulum happily sits outside the 80-90 limit. If I click it with the mouse and move it into the 80-90 range, then it'll respect the constraint, but before that it doesn't. Is there a way to make the limit constraint come into effect immediately?<br><br><strong class="text-strong">Scenario B</strong><br>I change the base to be floating, but with a btMultiBodyFixedConstraint (so I can move it around later):<br><div class="codebox"><p>Code: </p><pre><code>m_multiBody = createInvertedPendulumMultiBody(m_dynamicsWorld, m_guiHelper, baseWorldTrans, false);m_dynamicsWorld-&gt;addMultiBodyConstraint(new btMultiBodyFixedConstraint(m_multiBody, -1, nullptr, btVector3(0, 0, 0), btVector3(1, 2, 3), btMatrix3x3::getIdentity(), btMatrix3x3::getIdentity()));</code></pre></div>And again, I try limiting the pendulum angle:<div class="codebox"><p>Code: </p><pre><code>m_dynamicsWorld-&gt;addMultiBodyConstraint(new btMultiBodyJointLimitConstraint(m_multiBody, 0, btRadians(80.f), btRadians(90.f)));</code></pre></div>In this case, the revolute limit constraint on the pendulum doesn't work at all, the joint can freely spin a full 360 degrees, as if the limit constraint wasn't even added. Is there some rule forbidding the use of btMultiBodyFixedConstraint and btMultiBodyJointLimitConstraint on the same multibody?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14091">StriderH</a> — Fri Sep 10, 2021 3:24 pm</p><hr />
]]></content>
	</entry>
	</feed>
