Tin

Examples · robots · 336 of 339

pick

Waypoints, then a chunked policy, then seeded noise on top: every run of this program is identical.

examples/robots/pick.tintin run examples/robots/pick.tin
// Waypoints, then a chunked policy, then seeded noise on top: every run of this program is identical.
robot Arm = so101

fn main() {
  var arm = Arm()
  let reach = sequence([
    step(Pose { shoulder_lift: 20deg, elbow_flex: 40deg }, 1s),
    step(Pose { gripper: 0.8rad }, 300ms),
    step(Pose { gripper: 0rad }, 300ms),
  ])
  let r = arm.run(reach, 2s, 50Hz)
  print("reach: {r.steps} steps, gripper at {r.final.at("gripper").deg().fixed(1)}deg")

  let shake = perturb(policy(o => Some(Pose { wrist_roll: 0rad })), 42, 5deg)
  let s = arm.run(shake, 1s, 100Hz)
  print("shake: {s.steps} steps, wrist_roll at {s.final.at("wrist_roll").deg().fixed(3)}deg")
}
reach: 100 steps, gripper at 0.0deg
shake: 100 steps, wrist_roll at -0.018deg