Page 1 of 1

Question Regarding stepSimulation()

Posted: Sun Oct 11, 2020 1:39 pm
by Dyu
Hi,
I'm trying to understand 2 things:
1) I have the franka_panda urdf file loaded. When I run

Code: Select all

p.setJointMotorControl2(objUid, jointIndex, controlMode=p.POSITION_CONTROL, targetPosition=2)
p.stepSimulation()
The robot doesn't complete the entire motion even though the target position is within the joint limits: which is understandable, because "stepSimulation" runs only for 1/240 seconds. But how is this final position calculated? Does the physics client take the maximum joint velocity into account and calculate the position accordingly? Like so:

Code: Select all

final_pos = max_joint_velocity * (1/240)
2) While using realTimeSimulation, the actions seem to be completed instantaneously. Would I be correct in saying that the maximum joint velocity is not taken into account in this case? If this is true how can I regulate the joint to stay withing its maximum joint velocity limit?

Re: Question Regarding stepSimulation()

Posted: Wed Oct 14, 2020 3:05 am
by Erwin Coumans
The position is achieved taken all constraints into account, including the maximum force and joint limits, contact, friction etc.

There is a maxVelocity argument to clamp the maximum velocity. Alternatively, keep the max force low.
You can also use classical PD control.