Page 1 of 1

Best way to read torques from joints

Posted: 08 May 2022, 12:04
by amirmmi
Hello,
In my Coppeliasim scene, I have joints that are motor enabled + control loop enabled. I am using position control for these joints using the sim.setJointTargetPosition command, and I want to retrieve the torques that these joints are applying to the links. What is the most precise way of reading these joint torques? Is it OK to use sim.getJointForce, or should I have to use a force sensor along with sim.readForceSensor command to get the torque amount?

Re: Best way to read torques from joints

Posted: 09 May 2022, 13:08
by coppelia
Hello,

sim.getJointForce is the correct way of doing this. But why do you want to read those forces/torques?

Cheers

Re: Best way to read torques from joints

Posted: 09 May 2022, 13:43
by amirmmi
Thanks for your reply,
I want to store torque values as the robot's actions at each time step so I can use this data for imitation learning.

Re: Best way to read torques from joints

Posted: 10 May 2022, 12:20
by coppelia
that won't work. The position control will try to drive each joint to a specific position at a given time. Normally, a controller trying to follow a specific path will not actuate the joints in position control, but in velocity control, by driving through (or near) the points with a specific velocity.

Cheers