Skip to content

Body wrench from forces applied at different points #589

@ferrolho

Description

@ferrolho

Hello, @tkoolen! 🙂 I am trying to model the surface-to-surface contact between a humanoid's foot and flat ground. For that, I am defining four contact points per foot, similar to what you did for Atlas and Valkyrie. The image below shows the four contact points of the left foot, as well as a triad located at the frame origin of the sole.

cps

This next image shows some forces being applied at each contact point.

feet

My question is: for each foot, how can I compute the total wrench acting on the link given the individual contact forces? I want to do this so I can call dynamics!(result, state, torques, externalwrenches) with the external wrenches acting on each foot.

I will leave the code for a single force applied at the frame origin below, as it may be a helpful reference for the discussion:

frame_foot = findbody(mechanism, "left_sole_link")

force_in_world_frame = FreeVector3D(root_frame(mechanism), [0.0, 0.0, 100.0])
force_in_foot_frame = transform(state, force_in_world_frame, frame_foot)

wrench = Wrench(Point3D(frame_foot, zeros(T, 3)), force_in_foot_frame)

externalwrenches = Dict{BodyID,Wrench{T}}(
    BodyID(findbody(mechanism, "leg_left_6_link")) => transform(state, wrench, root_frame(mechanism)),
)

result = robot.dynamicsresultcache[T]
dynamics!(result, state, torques, externalwrenches)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions