Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Measuring the torque in a joint with sensor? #1095

Closed
QiyangYan opened this issue Oct 12, 2023 · 7 comments
Closed

Measuring the torque in a joint with sensor? #1095

QiyangYan opened this issue Oct 12, 2023 · 7 comments
Labels
question Request for help or information

Comments

@QiyangYan
Copy link

Hi,

I'm a student and I'm trying to use MuJoCo for sim2real of a gripper.

I'm looking for some help with measuring the torque in a joint.

Here is my question:
I would like to measure the joint torque for the gripper, like what you did in OP3 where you measured the joint torque as a penalty. Did you add a force-torque sensor to the joint or there is a different way of measuring it? Would you mind providing me with a short example or a guide for measuring the torque of a joint? THANKS!

@QiyangYan QiyangYan added the question Request for help or information label Oct 12, 2023
@yuvaltassa
Copy link
Collaborator

You need to define more accurately what you mean by "torque in a joint". You could mean:

  1. The torque generated by the actuator
  2. The total torque along the joint axis due to the actuator and everything else.
  3. The total 3D torque through the joint, including in axes orthogonal to the joint axis.

Which is it?

@QiyangYan
Copy link
Author

Hi, by torque in joint, I’m referring to second point. I would like to measure the torque within the joint due to external force.

@yuvaltassa
Copy link
Collaborator

yuvaltassa commented Oct 13, 2023

What do you mean "external force"? Not including the actuator or including the actuator?

Also, are you using C++ or Python?

@QiyangYan
Copy link
Author

The joint is a position-controlled joint, like the knees' joint of OP3, and I want to monitor the variation of torque generated by the actuator when an external force is applied to the joint in the opposite direction, resisting the movement. So it should include the actuator?

For example, in the paper of the OP3, inside the reward, there is a penalty, equal to the magnitude of the torque measured at the player’s knees. This discourages the player from learning gaits which cause high forces on the knees, for example during ground impacts, which can damage a physical robot.

And, I'm using python.

@yuvaltassa
Copy link
Collaborator

data.joint("my_joint").qfrc_constraint + data.joint("my_joint").qfrc_smooth

@ziqiao30
Copy link

ziqiao30 commented Jun 6, 2024

Hi i just curiosity whats the difference bewteen: data.joint("my_joint").qfrc_constraint + data.joint("my_joint").qfrc_smooth;
and just put a site to the joint and use torque sensor to read the torque value. I try to plot on axis from the torque sensor and the value calculate from the data.joint, there are different scale, and some time the value are quite different(not only in different scale)

@NuCapybara
Copy link

NuCapybara commented Jul 30, 2024

Hi i just curiosity whats the difference bewteen: data.joint("my_joint").qfrc_constraint + data.joint("my_joint").qfrc_smooth; and just put a site to the joint and use torque sensor to read the torque value. I try to plot on axis from the torque sensor and the value calculate from the data.joint, there are different scale, and some time the value are quite different(not only in different scale)

Hi Ziqiao, I found a post somewhat related to your question. Have you figured out?
https://www.roboti.us/forum/index.php?threads/best-way-to-represent-robots-torque-sensors.4181/

Also, I found out qfrc_unc listed on the above forum was renamed to qfrc_smooth in 2022. So qfrc_unc + qfrc_constraint = qfrc_smooth + qfrc_constraint
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Request for help or information
Projects
None yet
Development

No branches or pull requests

4 participants