-
Notifications
You must be signed in to change notification settings - Fork 53
Description
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.
This next image shows some forces being applied at each contact point.
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)
