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

how to sovle for contact force #29

Open
Hency-727 opened this issue Feb 24, 2025 · 0 comments
Open

how to sovle for contact force #29

Hency-727 opened this issue Feb 24, 2025 · 0 comments

Comments

@Hency-727
Copy link

Thank you for this awaresome job! I am aslo a gelsight mini user, now I have an issue about how to solve for contact force( tangential force and normal pressure), and I check out that the related code as follow, is dnet the contact force? what kind of force? why * 0.075? If possible, could u pls tell me how to solve for contact force? Thank you!!!

def draw_flow(frame, flow):
Ox, Oy, Cx, Cy, Occupied = flow

dx = np.mean(np.abs(np.asarray(Ox) - np.asarray(Cx)))
dy = np.mean(np.abs(np.asarray(Oy) - np.asarray(Cy)))
dnet = np.sqrt(dx**2 + dy**2)
# print (dnet * 0.075, '\n')

K = 1
for i in range(len(Ox)):
    for j in range(len(Ox[i])):
        pt1 = (int(Ox[i][j]), int(Oy[i][j]))
        pt2 = (int(Cx[i][j] + K * (Cx[i][j] - Ox[i][j])), int(Cy[i][j] + K * (Cy[i][j] - Oy[i][j])))
        color = (0, 0, 255)
        if Occupied[i][j] <= -1:
            color = (127, 127, 255)
        cv2.arrowedLine(frame, pt1, pt2, color, 2,  tipLength=0.25)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant