๐Ÿค– Deploying Learned Policies (CRISP-Style Tutorial)ยถ

Learned policies and teleoperation devices send a new end-effector target only 10โ€“30 times per second. CRISPTracker runs a compliant Cartesian impedance controller configured like the CRISP controllers that follows such targets smoothly:

from franky import CRISPTracker, Robot

robot = Robot("172.16.0.2")
robot.recover_from_errors()

with CRISPTracker(robot, period=0.05) as tracker:  # 20 Hz policy
    while tracker.tick():
        tracker.set_target(policy_action())  # an Affine end-effector pose

The tracker starts by holding the current pose, tick() paces the loop and returns None once the controller stops (for example after a reflex), and leaving the with block stops the controller.

A runnable version with a circle standing in for the policy is crisp_tracker.py in the examples folder. Try it in simulation first:

pip install franky-sim
python examples/crisp_tracker.py --sim

Adjusting the defaultsยถ

Any keyword argument of CartesianImpedanceTracker overrides the CRISP default:

from franky import CRITICAL, ImpedanceFilterParams

with CRISPTracker(
    robot,
    translational_stiffness=800.0,
    damping=CRITICAL,  # the default damping is tuned for the default stiffness
    filters=ImpedanceFilterParams(target_pose_time_constant=0.05),  # replaces CRISP's light filters
    use_operational_space=True,
    period=0.05,
) as tracker:
    ...

At runtime, the policy can also press with a feedforward wrench, and a teleoperation setup can stream a leader armโ€™s configuration as the posture target:

tracker.set_target(pose, wrench=[0.0, 0.0, -5.0, 0.0, 0.0, 0.0])  # press down with 5 N
tracker.set_gains(posture_target=leader_joint_positions)

All options are explained in Operational Space Control and CRISP Features, and Ending a Torque Motion covers stopping the controller safely.