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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2025-03-05T01:52:11+00:00</updated>

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

		<entry>
		<author><name><![CDATA[lorde]]></name></author>
		<updated>2025-03-05T01:52:11+00:00</updated>

		<published>2025-03-05T01:52:11+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=44513#p44513</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=44513#p44513"/>
		<title type="html"><![CDATA[Re: SDF link collisions change robot behavior, despite no interaction with robot]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=44513#p44513"><![CDATA[
Is PyBullet recalculating physics differently when objects are moved manually in GUI mode?<br><a href="https://geometrydashlitepc.io/" class="postlink"><span style="color:#FFFFFF"><span style="font-size:1%;line-height:116%">Geometry Dash</span></span></a><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14540">lorde</a> — Wed Mar 05, 2025 1:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[joro4o]]></name></author>
		<updated>2024-01-05T19:17:28+00:00</updated>

		<published>2024-01-05T19:17:28+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=44485#p44485</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=44485#p44485"/>
		<title type="html"><![CDATA[SDF link collisions change robot behavior, despite no interaction with robot]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=44485#p44485"><![CDATA[
I created a robot that sends motor values to joints at each step of the simulation. I also generate a grid of SDF links. For some reason, the behavior changes when if I drag the SDF links in GUI mode, despite no interaction between them and the robot. Why could this be? I've included relevant code:<br><br>generate.py:<br>--------------------------------------------<br>import pyrosim.pyrosim as pyrosim<br>def Create_World():<br>    pyrosim.Start_SDF("world.sdf")<br><br>    for i in range(10):<br>        for j in range(10):<br>            pyrosim.Send_Cube(name=f"Box{i}", pos=[-10+i*1.5,10+j*1.5,.51] , size=[1,1,1])<br>    pyrosim.End()<br><br><br>def Create_Robot():<br>    pyrosim.Start_URDF("body.urdf")<br>    pyrosim.Send_Cube(name="Torso", pos=[0,0,1.5] , size=[1,1,1])<br>    pyrosim.Send_Joint( name = "Torso_FrontLeg" , parent= "Torso" , child = "FrontLeg" , type = "revolute", position = [0.5,0,1])<br>    pyrosim.Send_Cube(name="FrontLeg", pos=[0.5,0,-0.5] , size=[1,1,1])<br><br>    pyrosim.Send_Joint( name = "Torso_BackLeg" , parent= "Torso" , child = "BackLeg" , type = "revolute", position = [-0.5,0,1])<br>    pyrosim.Send_Cube(name="BackLeg", pos=[-0.5,0,-0.5] , size=[1,1,1])<br><br>    pyrosim.End()<br><br>Create_World()<br>Create_Robot()<br><br>simulate.py:<br>----------------------------------<br>import pybullet_data<br>import pybullet as p<br>import time<br>import pyrosim.pyrosim as pyrosim<br>import numpy as np<br>import random<br><br>physicsClient = p.connect(p.GUI)<br>p.setAdditionalSearchPath(pybullet_data.getDataPath())<br><br><br>p.configureDebugVisualizer(p.COV_ENABLE_GUI,0)    <br><br>p.setGravity(0,0,-9.<img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_cool.gif" width="15" height="15" alt="8)" title="Cool"><br><br>planeId = p.loadURDF("plane.urdf")<br>p.loadSDF("world.sdf")<br>robotId = p.loadURDF("body.urdf")                   <br><br>pyrosim.Prepare_To_Simulate(robotId)             <br><br>backLegSensorValues = np.zeros(1000)<br>frontTargetAngles = np.zeros(1000)<br>backTargetAngles = np.zeros(1000)<br><br>frontAmplitude = np.pi/4<br>frontFrequency = 10<br>frontPhaseOffset = 0<br><br>backAmplitude =  np.pi/4<br>backFrequency = 10<br>backPhaseOffset =  np.pi/3<br><br>stateOfLinkZero = p.getBasePositionAndOrientation(robotId)                               <br>positionOfLinkZero = stateOfLinkZero[0]<br>xCoord = positionOfLinkZero[0]<br>print('Initial X Coordinate= ', xCoord)<br><br>for i in range(1000):<br><br>    p.stepSimulation()<br>    frontTargetAngles<em class="text-italics"> = frontAmplitude * np.sin(frontFrequency * i + frontPhaseOffset)<br>    backTargetAngles<em class="text-italics"> = backAmplitude * np.sin(backFrequency * i + backPhaseOffset)<br><br><br>    pyrosim.Set_Motor_For_Joint(<br>    bodyIndex = robotId,<br>    jointName = "Torso_FrontLeg",<br>    controlMode = p.POSITION_CONTROL,<br>    targetPosition = frontTargetAngles<em class="text-italics">,<br>    maxForce = 500)<br><br>    pyrosim.Set_Motor_For_Joint(<br>    bodyIndex = robotId,<br>    jointName = "Torso_BackLeg",<br>    controlMode = p.POSITION_CONTROL,<br>    targetPosition = backTargetAngles<em class="text-italics">,<br>    maxForce = 500)<br><br>    time.sleep(1/4000)<br><br><br>    if i%100 == 0 or i == 999:<br>        stateOfLinkZero = p.getBasePositionAndOrientation(robotId)                              <br>        positionOfLinkZero = stateOfLinkZero[0]<br>        xCoord = positionOfLinkZero[0]<br>        print('X Coordinate= ', xCoord)<br><br>p.disconnect()</em></em></em></em><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14457">joro4o</a> — Fri Jan 05, 2024 7:17 pm</p><hr />
]]></content>
	</entry>
	</feed>
