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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2022-03-15T04:40:39+00:00</updated>

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

		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2022-03-15T04:40:39+00:00</updated>

		<published>2022-03-15T04:40:39+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43938#p43938</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43938#p43938"/>
		<title type="html"><![CDATA[Re: pybullet.calculateInverseKinematics2 memory leak?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43938#p43938"><![CDATA[
This needs a full minimal reproduction case, not just a small code snippet.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Tue Mar 15, 2022 4:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[jsung]]></name></author>
		<updated>2022-02-19T18:28:07+00:00</updated>

		<published>2022-02-19T18:28:07+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43874#p43874</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43874#p43874"/>
		<title type="html"><![CDATA[pybullet.calculateInverseKinematics2 memory leak?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43874#p43874"><![CDATA[
Hi, I have a problem with the "pybullet.calculateInverseKinematics2" function. Whenever I call it, the memory usage on my PC increases a little bit. I call this method multiple times a second and the memory seems to keep increasing even after I've exited the function. I replaced the function with its single end effector alternative "pybullet.calculateInverseKinematics" and the memory issue is fixed (it no longer increases). The problem with using the regular "pybullet.calculateInverseKinematics" is that there is computational overhead because now I'm manually calculating each end effector in a for loop and that slows down the processing. Is there a way I can use the multi-end-effector IK function without the memory issue? Thanks.<br><div class="codebox"><p>Code: </p><pre><code>def calculateIK3(feet_positions, jointDamping):    pos_body = np.array(p.getBasePositionAndOrientation(hexapod_ID)[0])    orn_body = p.getBasePositionAndOrientation(hexapod_ID)[1]    rest_poses = []    target_pos = []    link_indexes = [x for x in range(3, 24, 4)]    for j in range(6):        rest_poses.append(pos_body + p.multiplyTransforms([0, 0, 0], orn_body, baseToEndEffectorConstVec[j], [0, 0, 0, 1])[0])        tp = p.multiplyTransforms(rest_poses[j], orn_body, feet_positions[j], [0, 0, 0, 1])        target_pos.append(tp[0])    ik2 = [0] * 18    # ik = p.calculateInverseKinematics2(    #     hexapod_ID,    #     [link_indexes[0]],    #     [target_pos[0]],    #     lowerLimits=ll,    #     upperLimits=ul,    #     jointRanges=jr,    #     restPoses=rest_poses    # )    # print(ik, len(ik))    iks = []    for j in range(6):        temp_ik = p.calculateInverseKinematics(            hexapod_ID,            link_indexes[j],            target_pos[j]        )        temp_ik = list(temp_ik[(3 * j):3 + (3 * j)])        # print(len(temp_ik), temp_ik)        iks.extend(temp_ik)    # print(iks)    # iks = list(temp_ik[:3]) + [0] * 15    return iks</code></pre></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14266">jsung</a> — Sat Feb 19, 2022 6:28 pm</p><hr />
]]></content>
	</entry>
	</feed>
