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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2020-10-09T08:17:23+00:00</updated>

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

		<entry>
		<author><name><![CDATA[FredP]]></name></author>
		<updated>2020-10-09T08:17:23+00:00</updated>

		<published>2020-10-09T08:17:23+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43115#p43115</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43115#p43115"/>
		<title type="html"><![CDATA[Best way to scale up]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43115#p43115"><![CDATA[
Hi,<br><br>I'm a beginner with Bullet and I'm trying to use it to detect collisions in an environment using industrial robots.<br>Everything seems to be working fine in small scale but if I try to scale up to the real size (the size of the models given by the robots constructor) I have problems with the forces to move the robots.<br><br>I'm receiving joint position updates from the simulation and for each update I'm using setJointMotorControl2() with the new position and then call stepSimulation() to move to it.<br><br>I tried to replicate the problem with a simple example. It moves one joint to a direction twice and then once in the opposite direction:<br><div class="codebox"><p>Code: </p><pre><code>import pybullet as pimport timeimport pybullet_datap.connect(p.GUI)p.setAdditionalSearchPath(pybullet_data.getDataPath())txId = p.loadURDF("kuka_iiwa/model.urdf", [0, 0, 0], globalScaling=1, useFixedBase=True)    numJoints = p.getNumJoints(txId)p.setGravity(0, 0, -10)for i in range(numJoints):    p.resetJointState(txId, i, 0)startTime = time.time()increment = 0.2position = 0.0direction = [1, 1, -1]max = len(direction)count = 0while 1:    currentTime = time.time()    t = currentTime - startTime    if t &gt; 1.0:        startTime = currentTime        position += increment * direction[count % max]        count += 1        for i in range(numJoints):            p.setJointMotorControl2(bodyIndex=txId,                                               jointIndex=i,                                               controlMode=p.POSITION_CONTROL,                                               targetPosition=position if i == 1 else 0,                                               targetVelocity=0,                                               force=500000,                                               positionGain=1,                                               velocityGain=1)        p.stepSimulation()    time.sleep(1/240)  p.disconnect()</code></pre></div>In this example everything is working fine but if I scale up the robot, let's say with globalScaling=5, the joint can't reach the target position anymore in a single stepSimulation(). I'm guessing that the force needs to be scaled up as well and if I do it it works... until the point where upping the force doesn't compensate the scaling anymore (the models I have for the robots are about 1000 times bigger than the Kuka model).<br><br>What is the best way to scale up ? Actually I'm doing 2 stepSimulation() for every movement but it hardly seems like a good solution. I have thought about scaling everything down but I have a lot of objects in my simulation and I would prefer to avoid it.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13775">FredP</a> — Fri Oct 09, 2020 8:17 am</p><hr />
]]></content>
	</entry>
	</feed>
