Hello, I want to control the trajectory of the robot going to the target position. For this, I divided the distance between the target point and the first position of the endeffector by a hundred, and each time I control the trajectory by determining the next target of these 100 steps. BUT, as far as I understand, it only takes about one simulation loop time for each of my iterated goal sets of 100 steps. For this reason, let's say the time spent for 100 steps is 5 seconds, it cannot go somewhere it cannot reach in 5 seconds. I tried to fix this problem and ensure that it doesn't enter the next loop step until it reaches the target step each time, but it doesn't work. I'm sure the error is in this while part because it works without it.
So why doesn't this part work?
Thank you
Code: Select all
#python
theta1 += dq[0]
theta2 += dq[1]
sim.setJointTargetPosition(joint1,theta1)
sim.setJointTargetPosition(joint2,theta2)
while joint1 != theta1:
while joint2 != theta2:
sim.setJointTargetPosition(joint1,theta1)
sim.setJointTargetPosition(joint2,theta2)