Cable-driven fingers¶
Tendons are supported through actuators.add_cable, a polyline
embedded anywhere in a soft body, driven by a tension or wound in to a target
length. Three examples: a straight finger, a notched finger and a four-tendon
tentacle.
drive = (actuators.LengthDrive(law=actuators.LinearCable(CABLE_AXIAL_STIFFNESS)) if mode == "length"
else actuators.TensionDrive())
cable = actuators.add_cable(world, finger, points, drive)
| Drive | Command | Behaviour |
|---|---|---|
TensionDrive() |
set_cable_tension (N) |
pulls with a fixed force |
LengthDrive(law=LinearCable(axial_stiffness=EA)) |
set_cable_length (m) |
a winch: pulls like a spring while the path is longer than the target, slack otherwise |
if mode == "tension":
actuators.set_cable_tension(world, cable, s * tension_max)
return f"T = {s * tension_max:.2f} N"
actuators.set_cable_length(world, cable, rest_length - s * PULL_MAX)
return f"pull-in = {1e3 * s * PULL_MAX:.1f} mm"
A finger that folds¶
A notched finger with self-contact on, so the notch walls stop each other as the tendon closes them.
points = hanging(tendon_points())
cable = actuators.add_cable(
world, finger, points,
actuators.LengthDrive(law=actuators.LinearCable(CABLE_AXIAL_STIFFNESS)))
# Self-contact: the closing notch walls press on each other instead of passing through.
trusty.contact.set_self_contact(world, finger, True)
A tentacle with four tendons¶
Four tendons in a quadratic hexahedral body steer its tip around a circle.
zs = np.linspace(0.0, LENGTH, NUM_CABLE_POINTS)
cables = []
for angle in (0.0, 0.5 * np.pi, np.pi, 1.5 * np.pi): # +x, +y, -x, -y sides
x, y = TENDON_OFFSET * np.cos(angle), TENDON_OFFSET * np.sin(angle)
points = np.stack([np.full_like(zs, x), np.full_like(zs, y), zs], axis=1)
drive = (actuators.LengthDrive(law=actuators.LinearCable(CABLE_AXIAL_STIFFNESS)) if mode == "length"
else actuators.TensionDrive())
cables.append(actuators.add_cable(world, tentacle, points, drive))