Skip to content

how to sovle for contact force #29

@hengxiangchen

Description

@hengxiangchen

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions