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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2020-01-17T07:43:50+00:00</updated>

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

		<entry>
		<author><name><![CDATA[krishna]]></name></author>
		<updated>2020-01-17T07:43:50+00:00</updated>

		<published>2020-01-17T07:43:50+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42571#p42571</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42571#p42571"/>
		<title type="html"><![CDATA[How to control the joint rotation]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=42571#p42571"><![CDATA[
Hello,<br>I am new to pybullet. Request your help to solve the below issue<br><br>I am building a quadruped robot where each leg has 3 joint (motors). 2 at the hip and 1 at keen joint.<br>When I run the below code 2 hip joint joints move (rotate) at the same time. <br><br>Is it possible to rotate the joints one after the other. Ex. Joint 2 starts after Joint 1 finishes its rotation.<br><br><div class="codebox"><p>Code: </p><pre><code>def LegBR(hip,knee):   motrotvalue = hip   p.setJointMotorControl2(vision, motor_back_rightR_joint, p.POSITION_CONTROL, targetPosition=motrotvalue, force=maxMotorForce)   motrotvalue = knee   p.setJointMotorControl2(vision, knee_back_rightR_joint, p.POSITION_CONTROL, targetPosition=motrotvalue, force=maxMotorForce)   p.stepSimulation()def LegBL(hip,knee):   motrotvalue = hip   p.setJointMotorControl2(vision, motor_back_leftL_joint, p.POSITION_CONTROL, targetPosition=motrotvalue, force=maxMotorForce)   motrotvalue = knee   p.setJointMotorControl2(vision, knee_back_leftL_joint, p.POSITION_CONTROL, targetPosition=motrotvalue, force=maxMotorForce)   p.stepSimulation()maxMotorForce = 5000t = 0prevTime = time.time()while (1):   timeScale = 1.0   amplitude = 0.4999   newTime = time.time()   dt = (newTime - prevTime) * timeScale   t = t + dt   prevTime = newTime   legpos = 0.05   amp = amplitude   a = math.sin(t) * amp + legpos   b = -(math.sin(t) * amp + legpos)         LegBR(a,0)   LegBL(-b,0)   #LegFR(a,0)   #LegFL(b,0)   p.setGravity(0, 0, -10)   #time.sleep(1/240)</code></pre></div> <br><img src="https://i.ibb.co/6ZtPhBj/image-robo1.png" class="postimage" alt="Image"><br><br>In the above image both joint 1 and joint 2 start at the same time. I want that joint 2 (motor) to start after joint 1 completes its rotation.<br><br>Thank you for your support.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13511">krishna</a> — Fri Jan 17, 2020 7:43 am</p><hr />
]]></content>
	</entry>
	</feed>
