import{s as ta,o as la,n as I}from"../chunks/scheduler.eb244325.js";import{S as sa,i as aa,e as M,s as i,c as y,h as oa,a as c,d as l,b as r,f as Ks,g as d,j as T,k as ea,l as na,m as a,n as m,t as J,o as u,p as b}from"../chunks/index.3fe63ad3.js";import{T as ia}from"../chunks/Tip.8a9a4ce7.js";import{C as ra}from"../chunks/CopyLLMTxtMenu.88bde5f2.js";import{C as g}from"../chunks/CodeBlock.934d290d.js";import{H as j,E as pa}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.341974a5.js";import{H as Mt,a as $}from"../chunks/HfOption.0914e9f3.js";function Ma(f){let o,p='Want to quickly get the right commands for your setup? The <a href="https://github.com/huggingface/lerobot/blob/main/examples/notebooks/quickstart.ipynb" rel="nofollow">quickstart notebook</a> <a href="https://colab.research.google.com/github/huggingface/lerobot/blob/main/examples/notebooks/quickstart.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"/></a> lets you configure your robot once and generates all the commands below ready to paste.';return{c(){o=M("p"),o.innerHTML=p},l(s){o=c(s,"P",{"data-svelte-h":!0}),T(o)!=="svelte-gwmkyy"&&(o.innerHTML=p)},m(s,U){a(s,o,U)},p:I,d(s){s&&l(o)}}}function ca(f){let o,p;return o=new g({props:{code:"bGVyb2JvdC10ZWxlb3BlcmF0ZSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcm9ib3QudHlwZSUzRHNvMTAxX2ZvbGxvd2VyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1yb2JvdC5wb3J0JTNEJTJGZGV2JTJGdHR5LnVzYm1vZGVtNTg3NjA0MzE1NDElMjAlNUMlMEElMjAlMjAlMjAlMjAtLXJvYm90LmlkJTNEbXlfYXdlc29tZV9mb2xsb3dlcl9hcm0lMjAlNUMlMEElMjAlMjAlMjAlMjAtLXRlbGVvcC50eXBlJTNEc28xMDFfbGVhZGVyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS10ZWxlb3AucG9ydCUzRCUyRmRldiUyRnR0eS51c2Jtb2RlbTU4NzYwNDMxNTUxJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS10ZWxlb3AuaWQlM0RteV9hd2Vzb21lX2xlYWRlcl9hcm0=",highlighted:`lerobot-teleoperate \\
    --robot.type=so101_follower \\
    --robot.port=/dev/tty.usbmodem58760431541 \\
    --robot.id=my_awesome_follower_arm \\
    --teleop.type=so101_leader \\
    --teleop.port=/dev/tty.usbmodem58760431551 \\
    --teleop.id=my_awesome_leader_arm`,wrap:!1}}),{c(){y(o.$$.fragment)},l(s){d(o.$$.fragment,s)},m(s,U){m(o,s,U),p=!0},p:I,i(s){p||(J(o.$$.fragment,s),p=!0)},o(s){u(o.$$.fragment,s),p=!1},d(s){b(o,s)}}}function ya(f){let o,p;return o=new g({props:{code:"ZnJvbSUyMGxlcm9ib3QudGVsZW9wZXJhdG9ycy5zb19sZWFkZXIlMjBpbXBvcnQlMjBTTzEwMUxlYWRlciUyQyUyMFNPMTAxTGVhZGVyQ29uZmlnJTBBZnJvbSUyMGxlcm9ib3Qucm9ib3RzLnNvX2ZvbGxvd2VyJTIwaW1wb3J0JTIwU08xMDFGb2xsb3dlciUyQyUyMFNPMTAxRm9sbG93ZXJDb25maWclMEElMEFyb2JvdF9jb25maWclMjAlM0QlMjBTTzEwMUZvbGxvd2VyQ29uZmlnKCUwQSUyMCUyMCUyMCUyMHBvcnQlM0QlMjIlMkZkZXYlMkZ0dHkudXNibW9kZW01ODc2MDQzMTU0MSUyMiUyQyUwQSUyMCUyMCUyMCUyMGlkJTNEJTIybXlfcmVkX3JvYm90X2FybSUyMiUyQyUwQSklMEElMEF0ZWxlb3BfY29uZmlnJTIwJTNEJTIwU08xMDFMZWFkZXJDb25maWcoJTBBJTIwJTIwJTIwJTIwcG9ydCUzRCUyMiUyRmRldiUyRnR0eS51c2Jtb2RlbTU4NzYwNDMxNTUxJTIyJTJDJTBBJTIwJTIwJTIwJTIwaWQlM0QlMjJteV9ibHVlX2xlYWRlcl9hcm0lMjIlMkMlMEEpJTBBJTBBcm9ib3QlMjAlM0QlMjBTTzEwMUZvbGxvd2VyKHJvYm90X2NvbmZpZyklMEF0ZWxlb3BfZGV2aWNlJTIwJTNEJTIwU08xMDFMZWFkZXIodGVsZW9wX2NvbmZpZyklMEFyb2JvdC5jb25uZWN0KCklMEF0ZWxlb3BfZGV2aWNlLmNvbm5lY3QoKSUwQSUwQXdoaWxlJTIwVHJ1ZSUzQSUwQSUyMCUyMCUyMCUyMGFjdGlvbiUyMCUzRCUyMHRlbGVvcF9kZXZpY2UuZ2V0X2FjdGlvbigpJTBBJTIwJTIwJTIwJTIwcm9ib3Quc2VuZF9hY3Rpb24oYWN0aW9uKQ==",highlighted:`<span class="hljs-keyword">from</span> lerobot.teleoperators.so_leader <span class="hljs-keyword">import</span> SO101Leader, SO101LeaderConfig
<span class="hljs-keyword">from</span> lerobot.robots.so_follower <span class="hljs-keyword">import</span> SO101Follower, SO101FollowerConfig

robot_config = SO101FollowerConfig(
    port=<span class="hljs-string">&quot;/dev/tty.usbmodem58760431541&quot;</span>,
    <span class="hljs-built_in">id</span>=<span class="hljs-string">&quot;my_red_robot_arm&quot;</span>,
)

teleop_config = SO101LeaderConfig(
    port=<span class="hljs-string">&quot;/dev/tty.usbmodem58760431551&quot;</span>,
    <span class="hljs-built_in">id</span>=<span class="hljs-string">&quot;my_blue_leader_arm&quot;</span>,
)

robot = SO101Follower(robot_config)
teleop_device = SO101Leader(teleop_config)
robot.connect()
teleop_device.connect()

<span class="hljs-keyword">while</span> <span class="hljs-literal">True</span>:
    action = teleop_device.get_action()
    robot.send_action(action)`,wrap:!1}}),{c(){y(o.$$.fragment)},l(s){d(o.$$.fragment,s)},m(s,U){m(o,s,U),p=!0},p:I,i(s){p||(J(o.$$.fragment,s),p=!0)},o(s){u(o.$$.fragment,s),p=!1},d(s){b(o,s)}}}function da(f){let o,p,s,U;return o=new $({props:{id:"teleoperate_so101",option:"Command",$$slots:{default:[ca]},$$scope:{ctx:f}}}),s=new $({props:{id:"teleoperate_so101",option:"API example",$$slots:{default:[ya]},$$scope:{ctx:f}}}),{c(){y(o.$$.fragment),p=i(),y(s.$$.fragment)},l(n){d(o.$$.fragment,n),p=r(n),d(s.$$.fragment,n)},m(n,w){m(o,n,w),a(n,p,w),m(s,n,w),U=!0},p(n,w){const h={};w&2&&(h.$$scope={dirty:w,ctx:n}),o.$set(h);const C={};w&2&&(C.$$scope={dirty:w,ctx:n}),s.$set(C)},i(n){U||(J(o.$$.fragment,n),J(s.$$.fragment,n),U=!0)},o(n){u(o.$$.fragment,n),u(s.$$.fragment,n),U=!1},d(n){n&&l(p),b(o,n),b(s,n)}}}function ma(f){let o,p;return o=new g({props:{code:"bGVyb2JvdC10ZWxlb3BlcmF0ZSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcm9ib3QudHlwZSUzRGtvY2hfZm9sbG93ZXIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXJvYm90LnBvcnQlM0QlMkZkZXYlMkZ0dHkudXNibW9kZW01ODc2MDQzMTU0MSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcm9ib3QuaWQlM0RteV9hd2Vzb21lX2ZvbGxvd2VyX2FybSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcm9ib3QuY2FtZXJhcyUzRCUyMiU3QiUyMGZyb250JTNBJTIwJTdCdHlwZSUzQSUyMG9wZW5jdiUyQyUyMGluZGV4X29yX3BhdGglM0ElMjAwJTJDJTIwd2lkdGglM0ElMjAxOTIwJTJDJTIwaGVpZ2h0JTNBJTIwMTA4MCUyQyUyMGZwcyUzQSUyMDMwJTdEJTdEJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS10ZWxlb3AudHlwZSUzRGtvY2hfbGVhZGVyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS10ZWxlb3AucG9ydCUzRCUyRmRldiUyRnR0eS51c2Jtb2RlbTU4NzYwNDMxNTUxJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS10ZWxlb3AuaWQlM0RteV9hd2Vzb21lX2xlYWRlcl9hcm0lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRpc3BsYXlfZGF0YSUzRHRydWU=",highlighted:`lerobot-teleoperate \\
    --robot.type=koch_follower \\
    --robot.port=/dev/tty.usbmodem58760431541 \\
    --robot.id=my_awesome_follower_arm \\
    --robot.cameras=<span class="hljs-string">&quot;{ front: {type: opencv, index_or_path: 0, width: 1920, height: 1080, fps: 30}}&quot;</span> \\
    --teleop.type=koch_leader \\
    --teleop.port=/dev/tty.usbmodem58760431551 \\
    --teleop.id=my_awesome_leader_arm \\
    --display_data=<span class="hljs-literal">true</span>`,wrap:!1}}),{c(){y(o.$$.fragment)},l(s){d(o.$$.fragment,s)},m(s,U){m(o,s,U),p=!0},p:I,i(s){p||(J(o.$$.fragment,s),p=!0)},o(s){u(o.$$.fragment,s),p=!1},d(s){b(o,s)}}}function Ja(f){let o,p;return o=new g({props:{code:"ZnJvbSUyMGxlcm9ib3QuY2FtZXJhcy5vcGVuY3YlMjBpbXBvcnQlMjBPcGVuQ1ZDYW1lcmFDb25maWclMEFmcm9tJTIwbGVyb2JvdC50ZWxlb3BlcmF0b3JzLmtvY2hfbGVhZGVyJTIwaW1wb3J0JTIwS29jaExlYWRlciUyQyUyMEtvY2hMZWFkZXJDb25maWclMEFmcm9tJTIwbGVyb2JvdC5yb2JvdHMua29jaF9mb2xsb3dlciUyMGltcG9ydCUyMEtvY2hGb2xsb3dlciUyQyUyMEtvY2hGb2xsb3dlckNvbmZpZyUwQSUwQWNhbWVyYV9jb25maWclMjAlM0QlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjJmcm9udCUyMiUzQSUyME9wZW5DVkNhbWVyYUNvbmZpZyhpbmRleF9vcl9wYXRoJTNEMCUyQyUyMHdpZHRoJTNEMTkyMCUyQyUyMGhlaWdodCUzRDEwODAlMkMlMjBmcHMlM0QzMCklMEElN0QlMEElMEFyb2JvdF9jb25maWclMjAlM0QlMjBLb2NoRm9sbG93ZXJDb25maWcoJTBBJTIwJTIwJTIwJTIwcG9ydCUzRCUyMiUyRmRldiUyRnR0eS51c2Jtb2RlbTU4NUEwMDc2ODQxJTIyJTJDJTBBJTIwJTIwJTIwJTIwaWQlM0QlMjJteV9yZWRfcm9ib3RfYXJtJTIyJTJDJTBBJTIwJTIwJTIwJTIwY2FtZXJhcyUzRGNhbWVyYV9jb25maWclMEEpJTBBJTBBdGVsZW9wX2NvbmZpZyUyMCUzRCUyMEtvY2hMZWFkZXJDb25maWcoJTBBJTIwJTIwJTIwJTIwcG9ydCUzRCUyMiUyRmRldiUyRnR0eS51c2Jtb2RlbTU4NzYwNDMxNTUxJTIyJTJDJTBBJTIwJTIwJTIwJTIwaWQlM0QlMjJteV9ibHVlX2xlYWRlcl9hcm0lMjIlMkMlMEEpJTBBJTBBcm9ib3QlMjAlM0QlMjBLb2NoRm9sbG93ZXIocm9ib3RfY29uZmlnKSUwQXRlbGVvcF9kZXZpY2UlMjAlM0QlMjBLb2NoTGVhZGVyKHRlbGVvcF9jb25maWcpJTBBcm9ib3QuY29ubmVjdCgpJTBBdGVsZW9wX2RldmljZS5jb25uZWN0KCklMEElMEF3aGlsZSUyMFRydWUlM0ElMEElMjAlMjAlMjAlMjBvYnNlcnZhdGlvbiUyMCUzRCUyMHJvYm90LmdldF9vYnNlcnZhdGlvbigpJTBBJTIwJTIwJTIwJTIwYWN0aW9uJTIwJTNEJTIwdGVsZW9wX2RldmljZS5nZXRfYWN0aW9uKCklMEElMjAlMjAlMjAlMjByb2JvdC5zZW5kX2FjdGlvbihhY3Rpb24p",highlighted:`<span class="hljs-keyword">from</span> lerobot.cameras.opencv <span class="hljs-keyword">import</span> OpenCVCameraConfig
<span class="hljs-keyword">from</span> lerobot.teleoperators.koch_leader <span class="hljs-keyword">import</span> KochLeader, KochLeaderConfig
<span class="hljs-keyword">from</span> lerobot.robots.koch_follower <span class="hljs-keyword">import</span> KochFollower, KochFollowerConfig

camera_config = {
    <span class="hljs-string">&quot;front&quot;</span>: OpenCVCameraConfig(index_or_path=<span class="hljs-number">0</span>, width=<span class="hljs-number">1920</span>, height=<span class="hljs-number">1080</span>, fps=<span class="hljs-number">30</span>)
}

robot_config = KochFollowerConfig(
    port=<span class="hljs-string">&quot;/dev/tty.usbmodem585A0076841&quot;</span>,
    <span class="hljs-built_in">id</span>=<span class="hljs-string">&quot;my_red_robot_arm&quot;</span>,
    cameras=camera_config
)

teleop_config = KochLeaderConfig(
    port=<span class="hljs-string">&quot;/dev/tty.usbmodem58760431551&quot;</span>,
    <span class="hljs-built_in">id</span>=<span class="hljs-string">&quot;my_blue_leader_arm&quot;</span>,
)

robot = KochFollower(robot_config)
teleop_device = KochLeader(teleop_config)
robot.connect()
teleop_device.connect()

<span class="hljs-keyword">while</span> <span class="hljs-literal">True</span>:
    observation = robot.get_observation()
    action = teleop_device.get_action()
    robot.send_action(action)`,wrap:!1}}),{c(){y(o.$$.fragment)},l(s){d(o.$$.fragment,s)},m(s,U){m(o,s,U),p=!0},p:I,i(s){p||(J(o.$$.fragment,s),p=!0)},o(s){u(o.$$.fragment,s),p=!1},d(s){b(o,s)}}}function ua(f){let o,p,s,U;return o=new $({props:{id:"teleoperate_koch_camera",option:"Command",$$slots:{default:[ma]},$$scope:{ctx:f}}}),s=new $({props:{id:"teleoperate_koch_camera",option:"API example",$$slots:{default:[Ja]},$$scope:{ctx:f}}}),{c(){y(o.$$.fragment),p=i(),y(s.$$.fragment)},l(n){d(o.$$.fragment,n),p=r(n),d(s.$$.fragment,n)},m(n,w){m(o,n,w),a(n,p,w),m(s,n,w),U=!0},p(n,w){const h={};w&2&&(h.$$scope={dirty:w,ctx:n}),o.$set(h);const C={};w&2&&(C.$$scope={dirty:w,ctx:n}),s.$set(C)},i(n){U||(J(o.$$.fragment,n),J(s.$$.fragment,n),U=!0)},o(n){u(o.$$.fragment,n),u(s.$$.fragment,n),U=!1},d(n){n&&l(p),b(o,n),b(s,n)}}}function ba(f){let o,p;return o=new g({props:{code:"bGVyb2JvdC1yZWNvcmQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXJvYm90LnR5cGUlM0RzbzEwMV9mb2xsb3dlciUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcm9ib3QucG9ydCUzRCUyRmRldiUyRnR0eS51c2Jtb2RlbTU4NUEwMDc2ODQxJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1yb2JvdC5pZCUzRG15X2F3ZXNvbWVfZm9sbG93ZXJfYXJtJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1yb2JvdC5jYW1lcmFzJTNEJTIyJTdCJTIwZnJvbnQlM0ElMjAlN0J0eXBlJTNBJTIwb3BlbmN2JTJDJTIwaW5kZXhfb3JfcGF0aCUzQSUyMDAlMkMlMjB3aWR0aCUzQSUyMDE5MjAlMkMlMjBoZWlnaHQlM0ElMjAxMDgwJTJDJTIwZnBzJTNBJTIwMzAlN0QlN0QlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXRlbGVvcC50eXBlJTNEc28xMDFfbGVhZGVyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS10ZWxlb3AucG9ydCUzRCUyRmRldiUyRnR0eS51c2Jtb2RlbTU4NzYwNDMxNTUxJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS10ZWxlb3AuaWQlM0RteV9hd2Vzb21lX2xlYWRlcl9hcm0lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRpc3BsYXlfZGF0YSUzRHRydWUlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXQucmVwb19pZCUzRCUyNCU3QkhGX1VTRVIlN0QlMkZyZWNvcmQtdGVzdCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldC5udW1fZXBpc29kZXMlM0Q1JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0LnNpbmdsZV90YXNrJTNEJTIyR3JhYiUyMHRoZSUyMGJsYWNrJTIwY3ViZSUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldC5zdHJlYW1pbmdfZW5jb2RpbmclM0R0cnVlJTIwJTVDJTBBJTIwJTIwJTIwJTIwJTIzJTIwLS1kYXRhc2V0LnZjb2RlYyUzRGF1dG8lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXQuZW5jb2Rlcl90aHJlYWRzJTNEMg==",highlighted:`lerobot-record \\
    --robot.type=so101_follower \\
    --robot.port=/dev/tty.usbmodem585A0076841 \\
    --robot.id=my_awesome_follower_arm \\
    --robot.cameras=<span class="hljs-string">&quot;{ front: {type: opencv, index_or_path: 0, width: 1920, height: 1080, fps: 30}}&quot;</span> \\
    --teleop.type=so101_leader \\
    --teleop.port=/dev/tty.usbmodem58760431551 \\
    --teleop.id=my_awesome_leader_arm \\
    --display_data=<span class="hljs-literal">true</span> \\
    --dataset.repo_id=<span class="hljs-variable">\${HF_USER}</span>/record-test \\
    --dataset.num_episodes=5 \\
    --dataset.single_task=<span class="hljs-string">&quot;Grab the black cube&quot;</span> \\
    --dataset.streaming_encoding=<span class="hljs-literal">true</span> \\
    <span class="hljs-comment"># --dataset.vcodec=auto \\</span>
    --dataset.encoder_threads=2`,wrap:!1}}),{c(){y(o.$$.fragment)},l(s){d(o.$$.fragment,s)},m(s,U){m(o,s,U),p=!0},p:I,i(s){p||(J(o.$$.fragment,s),p=!0)},o(s){u(o.$$.fragment,s),p=!1},d(s){b(o,s)}}}function Ta(f){let o,p;return o=new g({props:{code:" ",highlighted:`<span class="hljs-keyword">from</span> lerobot.cameras.opencv <span class="hljs-keyword">import</span> OpenCVCameraConfig
<span class="hljs-keyword">from</span> lerobot.datasets <span class="hljs-keyword">import</span> LeRobotDataset
<span class="hljs-keyword">from</span> lerobot.utils.feature_utils <span class="hljs-keyword">import</span> hw_to_dataset_features
<span class="hljs-keyword">from</span> lerobot.robots.so_follower <span class="hljs-keyword">import</span> SO100Follower, SO100FollowerConfig
<span class="hljs-keyword">from</span> lerobot.teleoperators.so_leader <span class="hljs-keyword">import</span> SO100Leader, SO100LeaderConfig
<span class="hljs-keyword">from</span> lerobot.common.control_utils <span class="hljs-keyword">import</span> init_keyboard_listener
<span class="hljs-keyword">from</span> lerobot.utils.utils <span class="hljs-keyword">import</span> log_say
<span class="hljs-keyword">from</span> lerobot.utils.visualization_utils <span class="hljs-keyword">import</span> init_rerun
<span class="hljs-keyword">from</span> lerobot.scripts.lerobot_record <span class="hljs-keyword">import</span> record_loop
<span class="hljs-keyword">from</span> lerobot.processor <span class="hljs-keyword">import</span> make_default_processors

NUM_EPISODES = <span class="hljs-number">5</span>
FPS = <span class="hljs-number">30</span>
EPISODE_TIME_SEC = <span class="hljs-number">60</span>
RESET_TIME_SEC = <span class="hljs-number">10</span>
TASK_DESCRIPTION = <span class="hljs-string">&quot;My task description&quot;</span>

<span class="hljs-comment"># Create robot configuration</span>
robot_config = SO100FollowerConfig(
    <span class="hljs-built_in">id</span>=<span class="hljs-string">&quot;my_awesome_follower_arm&quot;</span>,
    cameras={
        <span class="hljs-string">&quot;front&quot;</span>: OpenCVCameraConfig(index_or_path=<span class="hljs-number">0</span>, width=<span class="hljs-number">640</span>, height=<span class="hljs-number">480</span>, fps=FPS) <span class="hljs-comment"># Optional: fourcc=&quot;MJPG&quot; for troubleshooting OpenCV async error.</span>
    },
    port=<span class="hljs-string">&quot;/dev/tty.usbmodem58760434471&quot;</span>,
)

teleop_config = SO100LeaderConfig(
    <span class="hljs-built_in">id</span>=<span class="hljs-string">&quot;my_awesome_leader_arm&quot;</span>,
    port=<span class="hljs-string">&quot;/dev/tty.usbmodem585A0077581&quot;</span>,
)

<span class="hljs-comment"># Initialize the robot and teleoperator</span>
robot = SO100Follower(robot_config)
teleop = SO100Leader(teleop_config)

<span class="hljs-comment"># Configure the dataset features</span>
action_features = hw_to_dataset_features(robot.action_features, <span class="hljs-string">&quot;action&quot;</span>)
obs_features = hw_to_dataset_features(robot.observation_features, <span class="hljs-string">&quot;observation&quot;</span>)
dataset_features = {**action_features, **obs_features}

<span class="hljs-comment"># Create the dataset</span>
dataset = LeRobotDataset.create(
    repo_id=<span class="hljs-string">&quot;&lt;hf_username&gt;/&lt;dataset_repo_id&gt;&quot;</span>,
    fps=FPS,
    features=dataset_features,
    robot_type=robot.name,
    use_videos=<span class="hljs-literal">True</span>,
    image_writer_threads=<span class="hljs-number">4</span>,
)

<span class="hljs-comment"># Initialize the keyboard listener and rerun visualization</span>
_, events = init_keyboard_listener()
init_rerun(session_name=<span class="hljs-string">&quot;recording&quot;</span>)

<span class="hljs-comment"># Connect the robot and teleoperator</span>
robot.connect()
teleop.connect()

<span class="hljs-comment"># Create the required processors</span>
teleop_action_processor, robot_action_processor, robot_observation_processor = make_default_processors()

episode_idx = <span class="hljs-number">0</span>
<span class="hljs-keyword">while</span> episode_idx &lt; NUM_EPISODES <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> events[<span class="hljs-string">&quot;stop_recording&quot;</span>]:
    log_say(<span class="hljs-string">f&quot;Recording episode <span class="hljs-subst">{episode_idx + <span class="hljs-number">1</span>}</span> of <span class="hljs-subst">{NUM_EPISODES}</span>&quot;</span>)

    record_loop(
        robot=robot,
        events=events,
        fps=FPS,
        teleop_action_processor=teleop_action_processor,
        robot_action_processor=robot_action_processor,
        robot_observation_processor=robot_observation_processor,
        teleop=teleop,
        dataset=dataset,
        control_time_s=EPISODE_TIME_SEC,
        single_task=TASK_DESCRIPTION,
        display_data=<span class="hljs-literal">True</span>,
    )

    <span class="hljs-comment"># Reset the environment if not stopping or re-recording</span>
    <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> events[<span class="hljs-string">&quot;stop_recording&quot;</span>] <span class="hljs-keyword">and</span> (episode_idx &lt; NUM_EPISODES - <span class="hljs-number">1</span> <span class="hljs-keyword">or</span> events[<span class="hljs-string">&quot;rerecord_episode&quot;</span>]):
        log_say(<span class="hljs-string">&quot;Reset the environment&quot;</span>)
        record_loop(
            robot=robot,
            events=events,
            fps=FPS,
            teleop_action_processor=teleop_action_processor,
            robot_action_processor=robot_action_processor,
            robot_observation_processor=robot_observation_processor,
            teleop=teleop,
            control_time_s=RESET_TIME_SEC,
            single_task=TASK_DESCRIPTION,
            display_data=<span class="hljs-literal">True</span>,
        )

    <span class="hljs-keyword">if</span> events[<span class="hljs-string">&quot;rerecord_episode&quot;</span>]:
        log_say(<span class="hljs-string">&quot;Re-recording episode&quot;</span>)
        events[<span class="hljs-string">&quot;rerecord_episode&quot;</span>] = <span class="hljs-literal">False</span>
        events[<span class="hljs-string">&quot;exit_early&quot;</span>] = <span class="hljs-literal">False</span>
        dataset.clear_episode_buffer()
        <span class="hljs-keyword">continue</span>

    dataset.save_episode()
    episode_idx += <span class="hljs-number">1</span>

<span class="hljs-comment"># Clean up</span>
log_say(<span class="hljs-string">&quot;Stop recording&quot;</span>)
robot.disconnect()
teleop.disconnect()
dataset.push_to_hub()`,wrap:!1}}),{c(){y(o.$$.fragment)},l(s){d(o.$$.fragment,s)},m(s,U){m(o,s,U),p=!0},p:I,i(s){p||(J(o.$$.fragment,s),p=!0)},o(s){u(o.$$.fragment,s),p=!1},d(s){b(o,s)}}}function Ua(f){let o,p,s,U;return o=new $({props:{id:"record",option:"Command",$$slots:{default:[ba]},$$scope:{ctx:f}}}),s=new $({props:{id:"record",option:"API example",$$slots:{default:[Ta]},$$scope:{ctx:f}}}),{c(){y(o.$$.fragment),p=i(),y(s.$$.fragment)},l(n){d(o.$$.fragment,n),p=r(n),d(s.$$.fragment,n)},m(n,w){m(o,n,w),a(n,p,w),m(s,n,w),U=!0},p(n,w){const h={};w&2&&(h.$$scope={dirty:w,ctx:n}),o.$set(h);const C={};w&2&&(C.$$scope={dirty:w,ctx:n}),s.$set(C)},i(n){U||(J(o.$$.fragment,n),J(s.$$.fragment,n),U=!0)},o(n){u(o.$$.fragment,n),u(s.$$.fragment,n),U=!1},d(n){n&&l(p),b(o,n),b(s,n)}}}function wa(f){let o,p;return o=new g({props:{code:"bGVyb2JvdC1yZXBsYXklMjAlNUMlMEElMjAlMjAlMjAlMjAtLXJvYm90LnR5cGUlM0RzbzEwMV9mb2xsb3dlciUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcm9ib3QucG9ydCUzRCUyRmRldiUyRnR0eS51c2Jtb2RlbTU4NzYwNDMxNTQxJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1yb2JvdC5pZCUzRG15X2F3ZXNvbWVfZm9sbG93ZXJfYXJtJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0LnJlcG9faWQlM0QlMjQlN0JIRl9VU0VSJTdEJTJGcmVjb3JkLXRlc3QlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXQuZXBpc29kZSUzRDAlMjAlMjMlMjBjaG9vc2UlMjB0aGUlMjBlcGlzb2RlJTIweW91JTIwd2FudCUyMHRvJTIwcmVwbGF5",highlighted:`lerobot-replay \\
    --robot.type=so101_follower \\
    --robot.port=/dev/tty.usbmodem58760431541 \\
    --robot.id=my_awesome_follower_arm \\
    --dataset.repo_id=<span class="hljs-variable">\${HF_USER}</span>/record-test \\
    --dataset.episode=0 <span class="hljs-comment"># choose the episode you want to replay</span>`,wrap:!1}}),{c(){y(o.$$.fragment)},l(s){d(o.$$.fragment,s)},m(s,U){m(o,s,U),p=!0},p:I,i(s){p||(J(o.$$.fragment,s),p=!0)},o(s){u(o.$$.fragment,s),p=!1},d(s){b(o,s)}}}function fa(f){let o,p;return o=new g({props:{code:"aW1wb3J0JTIwdGltZSUwQSUwQWZyb20lMjBsZXJvYm90LmRhdGFzZXRzJTIwaW1wb3J0JTIwTGVSb2JvdERhdGFzZXQlMEFmcm9tJTIwbGVyb2JvdC5yb2JvdHMuc29fZm9sbG93ZXIlMjBpbXBvcnQlMjBTTzEwMEZvbGxvd2VyJTJDJTIwU08xMDBGb2xsb3dlckNvbmZpZyUwQWZyb20lMjBsZXJvYm90LnV0aWxzLnJvYm90X3V0aWxzJTIwaW1wb3J0JTIwcHJlY2lzZV9zbGVlcCUwQWZyb20lMjBsZXJvYm90LnV0aWxzLnV0aWxzJTIwaW1wb3J0JTIwbG9nX3NheSUwQSUwQWVwaXNvZGVfaWR4JTIwJTNEJTIwMCUwQSUwQXJvYm90X2NvbmZpZyUyMCUzRCUyMFNPMTAwRm9sbG93ZXJDb25maWcocG9ydCUzRCUyMiUyRmRldiUyRnR0eS51c2Jtb2RlbTU4NzYwNDM0NDcxJTIyJTJDJTIwaWQlM0QlMjJteV9hd2Vzb21lX2ZvbGxvd2VyX2FybSUyMiklMEElMEFyb2JvdCUyMCUzRCUyMFNPMTAwRm9sbG93ZXIocm9ib3RfY29uZmlnKSUwQXJvYm90LmNvbm5lY3QoKSUwQSUwQWRhdGFzZXQlMjAlM0QlMjBMZVJvYm90RGF0YXNldCglMjIlM0NoZl91c2VybmFtZSUzRSUyRiUzQ2RhdGFzZXRfcmVwb19pZCUzRSUyMiUyQyUyMGVwaXNvZGVzJTNEJTVCZXBpc29kZV9pZHglNUQpJTBBYWN0aW9ucyUyMCUzRCUyMGRhdGFzZXQuc2VsZWN0X2NvbHVtbnMoJTIyYWN0aW9uJTIyKSUwQSUwQWxvZ19zYXkoZiUyMlJlcGxheWluZyUyMGVwaXNvZGUlMjAlN0JlcGlzb2RlX2lkeCU3RCUyMiklMEFmb3IlMjBpZHglMjBpbiUyMHJhbmdlKGRhdGFzZXQubnVtX2ZyYW1lcyklM0ElMEElMjAlMjAlMjAlMjB0MCUyMCUzRCUyMHRpbWUucGVyZl9jb3VudGVyKCklMEElMEElMjAlMjAlMjAlMjBhY3Rpb24lMjAlM0QlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBuYW1lJTNBJTIwZmxvYXQoYWN0aW9ucyU1QmlkeCU1RCU1QiUyMmFjdGlvbiUyMiU1RCU1QmklNUQpJTIwZm9yJTIwaSUyQyUyMG5hbWUlMjBpbiUyMGVudW1lcmF0ZShkYXRhc2V0LmZlYXR1cmVzJTVCJTIyYWN0aW9uJTIyJTVEJTVCJTIybmFtZXMlMjIlNUQpJTBBJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTIwJTIwcm9ib3Quc2VuZF9hY3Rpb24oYWN0aW9uKSUwQSUwQSUyMCUyMCUyMCUyMHByZWNpc2Vfc2xlZXAobWF4KDEuMCUyMCUyRiUyMGRhdGFzZXQuZnBzJTIwLSUyMCh0aW1lLnBlcmZfY291bnRlcigpJTIwLSUyMHQwKSUyQyUyMDAuMCkpJTBBJTBBcm9ib3QuZGlzY29ubmVjdCgp",highlighted:`<span class="hljs-keyword">import</span> time

<span class="hljs-keyword">from</span> lerobot.datasets <span class="hljs-keyword">import</span> LeRobotDataset
<span class="hljs-keyword">from</span> lerobot.robots.so_follower <span class="hljs-keyword">import</span> SO100Follower, SO100FollowerConfig
<span class="hljs-keyword">from</span> lerobot.utils.robot_utils <span class="hljs-keyword">import</span> precise_sleep
<span class="hljs-keyword">from</span> lerobot.utils.utils <span class="hljs-keyword">import</span> log_say

episode_idx = <span class="hljs-number">0</span>

robot_config = SO100FollowerConfig(port=<span class="hljs-string">&quot;/dev/tty.usbmodem58760434471&quot;</span>, <span class="hljs-built_in">id</span>=<span class="hljs-string">&quot;my_awesome_follower_arm&quot;</span>)

robot = SO100Follower(robot_config)
robot.connect()

dataset = LeRobotDataset(<span class="hljs-string">&quot;&lt;hf_username&gt;/&lt;dataset_repo_id&gt;&quot;</span>, episodes=[episode_idx])
actions = dataset.select_columns(<span class="hljs-string">&quot;action&quot;</span>)

log_say(<span class="hljs-string">f&quot;Replaying episode <span class="hljs-subst">{episode_idx}</span>&quot;</span>)
<span class="hljs-keyword">for</span> idx <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(dataset.num_frames):
    t0 = time.perf_counter()

    action = {
        name: <span class="hljs-built_in">float</span>(actions[idx][<span class="hljs-string">&quot;action&quot;</span>][i]) <span class="hljs-keyword">for</span> i, name <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(dataset.features[<span class="hljs-string">&quot;action&quot;</span>][<span class="hljs-string">&quot;names&quot;</span>])
    }
    robot.send_action(action)

    precise_sleep(<span class="hljs-built_in">max</span>(<span class="hljs-number">1.0</span> / dataset.fps - (time.perf_counter() - t0), <span class="hljs-number">0.0</span>))

robot.disconnect()`,wrap:!1}}),{c(){y(o.$$.fragment)},l(s){d(o.$$.fragment,s)},m(s,U){m(o,s,U),p=!0},p:I,i(s){p||(J(o.$$.fragment,s),p=!0)},o(s){u(o.$$.fragment,s),p=!1},d(s){b(o,s)}}}function ha(f){let o,p,s,U;return o=new $({props:{id:"replay",option:"Command",$$slots:{default:[wa]},$$scope:{ctx:f}}}),s=new $({props:{id:"replay",option:"API example",$$slots:{default:[fa]},$$scope:{ctx:f}}}),{c(){y(o.$$.fragment),p=i(),y(s.$$.fragment)},l(n){d(o.$$.fragment,n),p=r(n),d(s.$$.fragment,n)},m(n,w){m(o,n,w),a(n,p,w),m(s,n,w),U=!0},p(n,w){const h={};w&2&&(h.$$scope={dirty:w,ctx:n}),o.$set(h);const C={};w&2&&(C.$$scope={dirty:w,ctx:n}),s.$set(C)},i(n){U||(J(o.$$.fragment,n),J(s.$$.fragment,n),U=!0)},o(n){u(o.$$.fragment,n),u(s.$$.fragment,n),U=!1},d(n){n&&l(p),b(o,n),b(s,n)}}}function ja(f){let o,p;return o=new g({props:{code:"bGVyb2JvdC1yZWNvcmQlMjAlMjAlNUMlMEElMjAlMjAtLXJvYm90LnR5cGUlM0RzbzEwMF9mb2xsb3dlciUyMCU1QyUwQSUyMCUyMC0tcm9ib3QucG9ydCUzRCUyRmRldiUyRnR0eUFDTTElMjAlNUMlMEElMjAlMjAtLXJvYm90LmNhbWVyYXMlM0QlMjIlN0IlMjB1cCUzQSUyMCU3QnR5cGUlM0ElMjBvcGVuY3YlMkMlMjBpbmRleF9vcl9wYXRoJTNBJTIwJTJGZGV2JTJGdmlkZW8xMCUyQyUyMHdpZHRoJTNBJTIwNjQwJTJDJTIwaGVpZ2h0JTNBJTIwNDgwJTJDJTIwZnBzJTNBJTIwMzAlN0QlMkMlMjBzaWRlJTNBJTIwJTdCdHlwZSUzQSUyMGludGVscmVhbHNlbnNlJTJDJTIwc2VyaWFsX251bWJlcl9vcl9uYW1lJTNBJTIwMjMzNTIyMDc0NjA2JTJDJTIwd2lkdGglM0ElMjA2NDAlMkMlMjBoZWlnaHQlM0ElMjA0ODAlMkMlMjBmcHMlM0ElMjAzMCU3RCU3RCUyMiUyMCU1QyUwQSUyMCUyMC0tcm9ib3QuaWQlM0RteV9hd2Vzb21lX2ZvbGxvd2VyX2FybSUyMCU1QyUwQSUyMCUyMC0tZGlzcGxheV9kYXRhJTNEZmFsc2UlMjAlNUMlMEElMjAlMjAtLWRhdGFzZXQucmVwb19pZCUzRCUyNCU3QkhGX1VTRVIlN0QlMkZldmFsX3NvMTAwJTIwJTVDJTBBJTIwJTIwLS1kYXRhc2V0LnNpbmdsZV90YXNrJTNEJTIyUHV0JTIwbGVnbyUyMGJyaWNrJTIwaW50byUyMHRoZSUyMHRyYW5zcGFyZW50JTIwYm94JTIyJTIwJTVDJTBBJTIwJTIwLS1kYXRhc2V0LnN0cmVhbWluZ19lbmNvZGluZyUzRHRydWUlMjAlNUMlMEElMjAlMjAtLWRhdGFzZXQuZW5jb2Rlcl90aHJlYWRzJTNEMiUyMCU1QyUwQSUyMCUyMCUyMyUyMC0tZGF0YXNldC52Y29kZWMlM0RhdXRvJTIwJTVDJTBBJTIwJTIwJTIzJTIwJTNDLSUyMFRlbGVvcCUyMG9wdGlvbmFsJTIwaWYlMjB5b3UlMjB3YW50JTIwdG8lMjB0ZWxlb3BlcmF0ZSUyMGluJTIwYmV0d2VlbiUyMGVwaXNvZGVzJTIwJTVDJTBBJTIwJTIwJTIzJTIwLS10ZWxlb3AudHlwZSUzRHNvMTAwX2xlYWRlciUyMCU1QyUwQSUyMCUyMCUyMyUyMC0tdGVsZW9wLnBvcnQlM0QlMkZkZXYlMkZ0dHlBQ00wJTIwJTVDJTBBJTIwJTIwJTIzJTIwLS10ZWxlb3AuaWQlM0RteV9hd2Vzb21lX2xlYWRlcl9hcm0lMjAlNUMlMEElMjAlMjAtLXBvbGljeS5wYXRoJTNEJTI0JTdCSEZfVVNFUiU3RCUyRm15X3BvbGljeQ==",highlighted:`lerobot-record  \\
  --robot.type=so100_follower \\
  --robot.port=/dev/ttyACM1 \\
  --robot.cameras=<span class="hljs-string">&quot;{ up: {type: opencv, index_or_path: /dev/video10, width: 640, height: 480, fps: 30}, side: {type: intelrealsense, serial_number_or_name: 233522074606, width: 640, height: 480, fps: 30}}&quot;</span> \\
  --robot.id=my_awesome_follower_arm \\
  --display_data=<span class="hljs-literal">false</span> \\
  --dataset.repo_id=<span class="hljs-variable">\${HF_USER}</span>/eval_so100 \\
  --dataset.single_task=<span class="hljs-string">&quot;Put lego brick into the transparent box&quot;</span> \\
  --dataset.streaming_encoding=<span class="hljs-literal">true</span> \\
  --dataset.encoder_threads=2 \\
  <span class="hljs-comment"># --dataset.vcodec=auto \\</span>
  <span class="hljs-comment"># &lt;- Teleop optional if you want to teleoperate in between episodes \\</span>
  <span class="hljs-comment"># --teleop.type=so100_leader \\</span>
  <span class="hljs-comment"># --teleop.port=/dev/ttyACM0 \\</span>
  <span class="hljs-comment"># --teleop.id=my_awesome_leader_arm \\</span>
  --policy.path=<span class="hljs-variable">\${HF_USER}</span>/my_policy`,wrap:!1}}),{c(){y(o.$$.fragment)},l(s){d(o.$$.fragment,s)},m(s,U){m(o,s,U),p=!0},p:I,i(s){p||(J(o.$$.fragment,s),p=!0)},o(s){u(o.$$.fragment,s),p=!1},d(s){b(o,s)}}}function Ca(f){let o,p;return o=new g({props:{code:" ",highlighted:`<span class="hljs-keyword">from</span> lerobot.cameras.opencv <span class="hljs-keyword">import</span> OpenCVCameraConfig
<span class="hljs-keyword">from</span> lerobot.datasets <span class="hljs-keyword">import</span> LeRobotDataset
<span class="hljs-keyword">from</span> lerobot.utils.feature_utils <span class="hljs-keyword">import</span> hw_to_dataset_features
<span class="hljs-keyword">from</span> lerobot.policies.act <span class="hljs-keyword">import</span> ACTPolicy
<span class="hljs-keyword">from</span> lerobot.policies <span class="hljs-keyword">import</span> make_pre_post_processors
<span class="hljs-keyword">from</span> lerobot.robots.so_follower <span class="hljs-keyword">import</span> SO100Follower, SO100FollowerConfig
<span class="hljs-keyword">from</span> lerobot.scripts.lerobot_record <span class="hljs-keyword">import</span> record_loop
<span class="hljs-keyword">from</span> lerobot.common.control_utils <span class="hljs-keyword">import</span> init_keyboard_listener
<span class="hljs-keyword">from</span> lerobot.utils.utils <span class="hljs-keyword">import</span> log_say
<span class="hljs-keyword">from</span> lerobot.utils.visualization_utils <span class="hljs-keyword">import</span> init_rerun


NUM_EPISODES = <span class="hljs-number">5</span>
FPS = <span class="hljs-number">30</span>
EPISODE_TIME_SEC = <span class="hljs-number">60</span>
TASK_DESCRIPTION = <span class="hljs-string">&quot;My task description&quot;</span>
HF_MODEL_ID = <span class="hljs-string">&quot;&lt;hf_username&gt;/&lt;model_repo_id&gt;&quot;</span>
HF_DATASET_ID = <span class="hljs-string">&quot;&lt;hf_username&gt;/&lt;eval_dataset_repo_id&gt;&quot;</span>

<span class="hljs-comment"># Create the robot configuration</span>
camera_config = {<span class="hljs-string">&quot;front&quot;</span>: OpenCVCameraConfig(index_or_path=<span class="hljs-number">0</span>, width=<span class="hljs-number">640</span>, height=<span class="hljs-number">480</span>, fps=FPS)}
robot_config = SO100FollowerConfig(
    port=<span class="hljs-string">&quot;/dev/tty.usbmodem58760434471&quot;</span>, <span class="hljs-built_in">id</span>=<span class="hljs-string">&quot;my_awesome_follower_arm&quot;</span>, cameras=camera_config
)

<span class="hljs-comment"># Initialize the robot</span>
robot = SO100Follower(robot_config)

<span class="hljs-comment"># Initialize the policy</span>
policy = ACTPolicy.from_pretrained(HF_MODEL_ID)

<span class="hljs-comment"># Configure the dataset features</span>
action_features = hw_to_dataset_features(robot.action_features, <span class="hljs-string">&quot;action&quot;</span>)
obs_features = hw_to_dataset_features(robot.observation_features, <span class="hljs-string">&quot;observation&quot;</span>)
dataset_features = {**action_features, **obs_features}

<span class="hljs-comment"># Create the dataset</span>
dataset = LeRobotDataset.create(
    repo_id=HF_DATASET_ID,
    fps=FPS,
    features=dataset_features,
    robot_type=robot.name,
    use_videos=<span class="hljs-literal">True</span>,
    image_writer_threads=<span class="hljs-number">4</span>,
)

<span class="hljs-comment"># Initialize the keyboard listener and rerun visualization</span>
_, events = init_keyboard_listener()
init_rerun(session_name=<span class="hljs-string">&quot;recording&quot;</span>)

<span class="hljs-comment"># Connect the robot</span>
robot.connect()

preprocessor, postprocessor = make_pre_post_processors(
    policy_cfg=policy,
    pretrained_path=HF_MODEL_ID,
    dataset_stats=dataset.meta.stats,
)

<span class="hljs-keyword">for</span> episode_idx <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(NUM_EPISODES):
    log_say(<span class="hljs-string">f&quot;Running inference, recording eval episode <span class="hljs-subst">{episode_idx + <span class="hljs-number">1</span>}</span> of <span class="hljs-subst">{NUM_EPISODES}</span>&quot;</span>)

    <span class="hljs-comment"># Run the policy inference loop</span>
    record_loop(
        robot=robot,
        events=events,
        fps=FPS,
        policy=policy,
        preprocessor=preprocessor,
        postprocessor=postprocessor,
        dataset=dataset,
        control_time_s=EPISODE_TIME_SEC,
        single_task=TASK_DESCRIPTION,
        display_data=<span class="hljs-literal">True</span>,
    )

    dataset.save_episode()

<span class="hljs-comment"># Clean up</span>
robot.disconnect()
dataset.push_to_hub()`,wrap:!1}}),{c(){y(o.$$.fragment)},l(s){d(o.$$.fragment,s)},m(s,U){m(o,s,U),p=!0},p:I,i(s){p||(J(o.$$.fragment,s),p=!0)},o(s){u(o.$$.fragment,s),p=!1},d(s){b(o,s)}}}function ga(f){let o,p,s,U;return o=new $({props:{id:"eval",option:"Command",$$slots:{default:[ja]},$$scope:{ctx:f}}}),s=new $({props:{id:"eval",option:"API example",$$slots:{default:[Ca]},$$scope:{ctx:f}}}),{c(){y(o.$$.fragment),p=i(),y(s.$$.fragment)},l(n){d(o.$$.fragment,n),p=r(n),d(s.$$.fragment,n)},m(n,w){m(o,n,w),a(n,p,w),m(s,n,w),U=!0},p(n,w){const h={};w&2&&(h.$$scope={dirty:w,ctx:n}),o.$set(h);const C={};w&2&&(C.$$scope={dirty:w,ctx:n}),s.$set(C)},i(n){U||(J(o.$$.fragment,n),J(s.$$.fragment,n),U=!0)},o(n){u(o.$$.fragment,n),u(s.$$.fragment,n),U=!1},d(n){n&&l(p),b(o,n),b(s,n)}}}function Ia(f){let o,p,s,U,n,w,h,C,E,Hl="This tutorial will explain how to train a neural network to control a real robot autonomously.",ct,G,Ll="<strong>You’ll learn:</strong>",yt,X,Dl="<li>How to record and visualize your dataset.</li> <li>How to train a policy using your data and prepare it for evaluation.</li> <li>How to evaluate your policy and visualize the results.</li>",dt,A,ql="By following these steps, you’ll be able to replicate tasks, such as picking up a Lego block and placing it in a bin with a high success rate, as shown in the video below.",mt,N,Pl='<summary><strong>Video: pickup lego block task</strong></summary> <div class="video-container"><video controls="" width="600"><source src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/lerobot/lerobot_task.mp4" type="video/mp4"/></video></div>',Jt,k,Ol="This tutorial isn’t tied to a specific robot: we walk you through the commands and API snippets you can adapt for any supported platform.",ut,Q,Kl="During data collection, you’ll use a “teloperation” device, such as a leader arm or keyboard to teleoperate the robot and record its motion trajectories.",bt,W,es="Once you’ve gathered enough trajectories, you’ll train a neural network to imitate these trajectories and deploy the trained model so your robot can perform the task autonomously.",Tt,Y,ts='If you run into any issues at any point, jump into our <a href="https://discord.com/invite/s3KuuzsPFb" rel="nofollow">Discord community</a> for support.',Ut,v,wt,F,ft,S,ls="If you haven’t yet set up and calibrated your robot and teleop device, please do so by following the robot-specific tutorial.",ht,x,jt,z,ss="In this example, we’ll demonstrate how to teleoperate the SO101 robot. For each command, we also provide a corresponding API example.",Ct,H,as="Note that the <code>id</code> associated with a robot is used to store the calibration file. It’s important to use the same <code>id</code> when teleoperating, recording, and evaluating when using the same setup.",gt,_,It,L,os="The teleoperate command will automatically:",$t,D,ns="<li>Identify any missing calibrations and initiate the calibration procedure.</li> <li>Connect the robot and teleop device and start teleoperation.</li>",vt,q,_t,P,is='To add cameras to your setup, follow this <a href="./cameras#setup-cameras">Guide</a>.',Zt,O,Rt,K,rs="With <code>rerun</code>, you can teleoperate again while simultaneously visualizing the camera feeds and joint positions. In this example, we’re using the Koch arm.",Bt,Z,Vt,ee,Et,te,ps="Once you’re familiar with teleoperation, you can record your first dataset.",Gt,le,Ms='We use the Hugging Face hub features for uploading your dataset. If you haven’t previously used the Hub, make sure you can login via the cli using a write-access token, this token can be generated from the <a href="https://huggingface.co/settings/tokens" rel="nofollow">Hugging Face settings</a>.',Xt,se,cs="Add your token to the CLI by running this command:",At,ae,Nt,oe,ys="Then store your Hugging Face repository name in a variable:",kt,ne,Qt,ie,ds="Now you can record a dataset. To record 5 episodes and upload your dataset to the hub, adapt the code below for your robot and execute the command or API example.",Wt,R,Yt,re,Ft,pe,ms="Locally, your dataset is stored in this folder: <code>~/.cache/huggingface/lerobot/{repo-id}</code>. At the end of data recording, your dataset will be uploaded on your Hugging Face page (e.g. <code>https://huggingface.co/datasets/${HF_USER}/so101_test</code>) that you can obtain by running:",St,Me,xt,ce,Js="Your dataset will be automatically tagged with <code>LeRobot</code> for the community to find it easily, and you can also add custom tags (in this case <code>tutorial</code> for example).",zt,ye,us='You can look for other LeRobot datasets on the hub by searching for <code>LeRobot</code> <a href="https://huggingface.co/datasets?other=LeRobot" rel="nofollow">tags</a>.',Ht,de,bs="You can also push your local dataset to the Hub manually, running:",Lt,me,Dt,Je,qt,ue,Ts="The <code>record</code> function provides a suite of tools for capturing and managing data during robot operation:",Pt,be,Ot,Te,Us=`<li>Data is stored using the <code>LeRobotDataset</code> format and is stored on disk during recording.</li> <li>By default, the dataset is pushed to your Hugging Face page after recording.
<ul><li>To disable uploading, use <code>--dataset.push_to_hub=False</code>.</li></ul></li>`,Kt,Ue,el,we,ws="<li>Checkpoints are automatically created during recording.</li> <li>If an issue occurs, you can resume by re-running the same command with <code>--resume=true</code>. When resuming a recording, <code>--dataset.num_episodes</code> must be set to the <strong>number of additional episodes to be recorded</strong>, and not to the targeted total number of episodes in the dataset !</li> <li>To start recording from scratch, <strong>manually delete</strong> the dataset directory.</li>",tl,fe,ll,he,fs="Set the flow of data recording using command-line arguments:",sl,je,hs=`<li><code>--dataset.episode_time_s=60</code>
Duration of each data recording episode (default: <strong>60 seconds</strong>).</li> <li><code>--dataset.reset_time_s=60</code>
Duration for resetting the environment after each episode (default: <strong>60 seconds</strong>).</li> <li><code>--dataset.num_episodes=50</code>
Total number of episodes to record (default: <strong>50</strong>).</li>`,al,Ce,ol,ge,js="Control the data recording flow using keyboard shortcuts:",nl,Ie,Cs="<li>Press <strong>Right Arrow (<code>→</code>)</strong>: Early stop the current episode or reset time and move to the next.</li> <li>Press <strong>Left Arrow (<code>←</code>)</strong>: Cancel the current episode and re-record it.</li> <li>Press <strong>Escape (<code>ESC</code>)</strong>: Immediately stop the session, encode videos, and upload the dataset.</li>",il,$e,rl,ve,gs="Once you’re comfortable with data recording, you can create a larger dataset for training. A good starting task is grasping an object at different locations and placing it in a bin. We suggest recording at least 50 episodes, with 10 episodes per location. Keep the cameras fixed and maintain consistent grasping behavior throughout the recordings. Also make sure the object you are manipulating is visible on the camera’s. A good rule of thumb is you should be able to do the task yourself by only looking at the camera images.",pl,_e,Is="In the following sections, you’ll train your neural network. After achieving reliable grasping performance, you can start introducing more variations during data collection, such as additional grasp locations, different grasping techniques, and altering camera positions.",Ml,Ze,$s="Avoid adding too much variation too quickly, as it may hinder your results.",cl,Re,vs='If you want to dive deeper into this important topic, you can check out the <a href="https://huggingface.co/blog/lerobot-datasets#what-makes-a-good-dataset" rel="nofollow">blog post</a> we wrote on what makes a good dataset.',yl,Be,dl,Ve,_s='<li>On Linux, if the left and right arrow keys and escape key don’t have any effect during data recording, make sure you’ve set the <code>$DISPLAY</code> environment variable. See <a href="https://pynput.readthedocs.io/en/latest/limitations.html#linux" rel="nofollow">pynput limitations</a>.</li>',ml,Ee,Jl,Ge,Zs='If you uploaded your dataset to the hub with <code>--control.push_to_hub=true</code>, you can <a href="https://huggingface.co/spaces/lerobot/visualize_dataset" rel="nofollow">visualize your dataset online</a> by copy pasting your repo id given by:',ul,Xe,bl,Ae,Tl,Ne,Rs="A useful feature is the <code>replay</code> function, which allows you to replay any episode that you’ve recorded or episodes from any dataset out there. This function helps you test the repeatability of your robot’s actions and assess transferability across robots of the same model.",Ul,ke,Bs="You can replay the first episode on your robot with either the command below or with the API example:",wl,B,fl,Qe,Vs='Your robot should replicate movements similar to those you recorded. For example, check out <a href="https://x.com/RemiCadene/status/1793654950905680090" rel="nofollow">this video</a> where we use <code>replay</code> on a Aloha robot from <a href="https://www.trossenrobotics.com" rel="nofollow">Trossen Robotics</a>.',hl,We,jl,Ye,Es='To train a policy to control your robot, use the <a href="https://github.com/huggingface/lerobot/blob/main/src/lerobot/scripts/lerobot_train.py" rel="nofollow"><code>lerobot-train</code></a> script. A few arguments are required. Here is an example command:',Cl,Fe,gl,Se,Gs="Let’s explain the command:",Il,xe,Xs='<li>We provided the dataset as argument with <code>--dataset.repo_id=${HF_USER}/so101_test</code>.</li> <li>We provided the policy with <code>policy.type=act</code>. This loads configurations from <a href="https://github.com/huggingface/lerobot/blob/main/src/lerobot/policies/act/configuration_act.py" rel="nofollow"><code>configuration_act.py</code></a>. Importantly, this policy will automatically adapt to the number of motor states, motor actions and cameras of your robot (e.g. <code>laptop</code> and <code>phone</code>) which have been saved in your dataset.</li> <li>We provided <code>policy.device=cuda</code> since we are training on a Nvidia GPU, but you could use <code>policy.device=mps</code> to train on Apple silicon.</li> <li>We provided <code>wandb.enable=true</code> to use <a href="https://docs.wandb.ai/quickstart" rel="nofollow">Weights and Biases</a> for visualizing training plots. This is optional but if you use it, make sure you are logged in by running <code>wandb login</code>.</li>',$l,ze,As="Training should take several hours. You will find checkpoints in <code>outputs/train/act_so101_test/checkpoints</code>.",vl,He,Ns="To resume training from a checkpoint, below is an example command to resume from <code>last</code> checkpoint of the <code>act_so101_test</code> policy:",_l,Le,Zl,De,ks="If you do not want to push your model to the hub after training use <code>--policy.push_to_hub=false</code>.",Rl,qe,Qs="Additionally you can provide extra <code>tags</code> or specify a <code>license</code> for your model or make the model repo <code>private</code> by adding this: <code>--policy.private=true --policy.tags=\\[ppo,rl\\] --policy.license=mit</code>",Bl,Pe,Vl,Oe,Ws='If your local computer doesn’t have a powerful GPU you could utilize Google Colab to train your model by following the <a href="./notebooks#training-act">ACT training notebook</a>.',El,Ke,Gl,et,Ys="Once training is done, upload the latest checkpoint with:",Xl,tt,Al,lt,Fs="You can also upload intermediate checkpoints with:",Nl,st,kl,at,Ql,ot,Ss='You can use the <code>record</code> script from <a href="https://github.com/huggingface/lerobot/blob/main/src/lerobot/scripts/lerobot_record.py" rel="nofollow"><code>lerobot-record</code></a> with a policy checkpoint as input, to run inference and evaluate your policy. For instance, run this command or API example to run inference and record 10 evaluation episodes:',Wl,V,Yl,nt,xs="As you can see, it’s almost the same command as previously used to record your training dataset. Two things changed:",Fl,it,zs="<li>There is an additional <code>--control.policy.path</code> argument which indicates the path to your policy checkpoint with (e.g. <code>outputs/train/eval_act_so101_test/checkpoints/last/pretrained_model</code>). You can also use the model repository if you uploaded a model checkpoint to the hub (e.g. <code>${HF_USER}/act_so101_test</code>).</li> <li>The name of dataset begins by <code>eval</code> to reflect that you are running inference (e.g. <code>${HF_USER}/eval_act_so101_test</code>).</li>",Sl,rt,xl,pt,zl;return n=new ra({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),h=new j({props:{title:"Imitation Learning on Real-World Robots",local:"imitation-learning-on-real-world-robots",headingTag:"h1"}}),v=new ia({props:{$$slots:{default:[Ma]},$$scope:{ctx:f}}}),F=new j({props:{title:"Set up and Calibrate",local:"set-up-and-calibrate",headingTag:"h2"}}),x=new j({props:{title:"Teleoperate",local:"teleoperate",headingTag:"h2"}}),_=new Mt({props:{id:"teleoperate_so101",options:["Command","API example"],$$slots:{default:[da]},$$scope:{ctx:f}}}),q=new j({props:{title:"Cameras",local:"cameras",headingTag:"h2"}}),O=new j({props:{title:"Teleoperate with cameras",local:"teleoperate-with-cameras",headingTag:"h2"}}),Z=new Mt({props:{id:"teleoperate_koch_camera",options:["Command","API example"],$$slots:{default:[ua]},$$scope:{ctx:f}}}),ee=new j({props:{title:"Record a dataset",local:"record-a-dataset",headingTag:"h2"}}),ae=new g({props:{code:"aGYlMjBhdXRoJTIwbG9naW4lMjAtLXRva2VuJTIwJTI0JTdCSFVHR0lOR0ZBQ0VfVE9LRU4lN0QlMjAtLWFkZC10by1naXQtY3JlZGVudGlhbA==",highlighted:'hf auth login --token <span class="hljs-variable">${HUGGINGFACE_TOKEN}</span> --add-to-git-credential',wrap:!1}}),ne=new g({props:{code:"SEZfVVNFUiUzRCUyNChOT19DT0xPUiUzRDElMjBoZiUyMGF1dGglMjB3aG9hbWklMjAlN0MlMjBhd2slMjAtRiclM0ElMjAqJyUyMCdOUiUzRCUzRDElMjAlN0JwcmludCUyMCUyNDIlN0QnKSUwQWVjaG8lMjAlMjRIRl9VU0VS",highlighted:`HF_USER=$(NO_COLOR=1 hf auth <span class="hljs-built_in">whoami</span> | awk -F<span class="hljs-string">&#x27;: *&#x27;</span> <span class="hljs-string">&#x27;NR==1 {print $2}&#x27;</span>)
<span class="hljs-built_in">echo</span> <span class="hljs-variable">$HF_USER</span>`,wrap:!1}}),R=new Mt({props:{id:"record",options:["Command","API example"],$$slots:{default:[Ua]},$$scope:{ctx:f}}}),re=new j({props:{title:"Dataset upload",local:"dataset-upload",headingTag:"h4"}}),Me=new g({props:{code:"ZWNobyUyMGh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRiUyNCU3QkhGX1VTRVIlN0QlMkZzbzEwMV90ZXN0",highlighted:'<span class="hljs-built_in">echo</span> https://huggingface.co/datasets/<span class="hljs-variable">${HF_USER}</span>/so101_test',wrap:!1}}),me=new g({props:{code:"aGYlMjB1cGxvYWQlMjAlMjQlN0JIRl9VU0VSJTdEJTJGcmVjb3JkLXRlc3QlMjB+JTJGLmNhY2hlJTJGaHVnZ2luZ2ZhY2UlMkZsZXJvYm90JTJGJTdCcmVwby1pZCU3RCUyMC0tcmVwby10eXBlJTIwZGF0YXNldA==",highlighted:'hf upload <span class="hljs-variable">${HF_USER}</span>/record-test ~/.cache/huggingface/lerobot/{repo-id} --repo-type dataset',wrap:!1}}),Je=new j({props:{title:"Record function",local:"record-function",headingTag:"h4"}}),be=new j({props:{title:"1. Data Storage",local:"1-data-storage",headingTag:"h5"}}),Ue=new j({props:{title:"2. Checkpointing and Resuming",local:"2-checkpointing-and-resuming",headingTag:"h5"}}),fe=new j({props:{title:"3. Recording Parameters",local:"3-recording-parameters",headingTag:"h5"}}),Ce=new j({props:{title:"4. Keyboard Controls During Recording",local:"4-keyboard-controls-during-recording",headingTag:"h5"}}),$e=new j({props:{title:"Tips for gathering data",local:"tips-for-gathering-data",headingTag:"h4"}}),Be=new j({props:{title:"Troubleshooting:",local:"troubleshooting",headingTag:"h4"}}),Ee=new j({props:{title:"Visualize a dataset",local:"visualize-a-dataset",headingTag:"h2"}}),Xe=new g({props:{code:"ZWNobyUyMCUyNCU3QkhGX1VTRVIlN0QlMkZzbzEwMV90ZXN0",highlighted:'<span class="hljs-built_in">echo</span> <span class="hljs-variable">${HF_USER}</span>/so101_test',wrap:!1}}),Ae=new j({props:{title:"Replay an episode",local:"replay-an-episode",headingTag:"h2"}}),B=new Mt({props:{id:"replay",options:["Command","API example"],$$slots:{default:[ha]},$$scope:{ctx:f}}}),We=new j({props:{title:"Train a policy",local:"train-a-policy",headingTag:"h2"}}),Fe=new g({props:{code:"bGVyb2JvdC10cmFpbiUyMCU1QyUwQSUyMCUyMC0tZGF0YXNldC5yZXBvX2lkJTNEJTI0JTdCSEZfVVNFUiU3RCUyRnNvMTAxX3Rlc3QlMjAlNUMlMEElMjAlMjAtLXBvbGljeS50eXBlJTNEYWN0JTIwJTVDJTBBJTIwJTIwLS1vdXRwdXRfZGlyJTNEb3V0cHV0cyUyRnRyYWluJTJGYWN0X3NvMTAxX3Rlc3QlMjAlNUMlMEElMjAlMjAtLWpvYl9uYW1lJTNEYWN0X3NvMTAxX3Rlc3QlMjAlNUMlMEElMjAlMjAtLXBvbGljeS5kZXZpY2UlM0RjdWRhJTIwJTVDJTBBJTIwJTIwLS13YW5kYi5lbmFibGUlM0R0cnVlJTIwJTVDJTBBJTIwJTIwLS1wb2xpY3kucmVwb19pZCUzRCUyNCU3QkhGX1VTRVIlN0QlMkZteV9wb2xpY3k=",highlighted:`lerobot-train \\
  --dataset.repo_id=<span class="hljs-variable">\${HF_USER}</span>/so101_test \\
  --policy.type=act \\
  --output_dir=outputs/train/act_so101_test \\
  --job_name=act_so101_test \\
  --policy.device=cuda \\
  --wandb.enable=<span class="hljs-literal">true</span> \\
  --policy.repo_id=<span class="hljs-variable">\${HF_USER}</span>/my_policy`,wrap:!1}}),Le=new g({props:{code:"bGVyb2JvdC10cmFpbiUyMCU1QyUwQSUyMCUyMC0tY29uZmlnX3BhdGglM0RvdXRwdXRzJTJGdHJhaW4lMkZhY3Rfc28xMDFfdGVzdCUyRmNoZWNrcG9pbnRzJTJGbGFzdCUyRnByZXRyYWluZWRfbW9kZWwlMkZ0cmFpbl9jb25maWcuanNvbiUyMCU1QyUwQSUyMCUyMC0tcmVzdW1lJTNEdHJ1ZQ==",highlighted:`lerobot-train \\
  --config_path=outputs/train/act_so101_test/checkpoints/last/pretrained_model/train_config.json \\
  --resume=<span class="hljs-literal">true</span>`,wrap:!1}}),Pe=new j({props:{title:"Train using Google Colab",local:"train-using-google-colab",headingTag:"h4"}}),Ke=new j({props:{title:"Upload policy checkpoints",local:"upload-policy-checkpoints",headingTag:"h4"}}),tt=new g({props:{code:"aGYlMjB1cGxvYWQlMjAlMjQlN0JIRl9VU0VSJTdEJTJGYWN0X3NvMTAxX3Rlc3QlMjAlNUMlMEElMjAlMjBvdXRwdXRzJTJGdHJhaW4lMkZhY3Rfc28xMDFfdGVzdCUyRmNoZWNrcG9pbnRzJTJGbGFzdCUyRnByZXRyYWluZWRfbW9kZWw=",highlighted:'hf upload <span class="hljs-variable">${HF_USER}</span>/act_so101_test \\\n  outputs/train/act_so101_test/checkpoints/last/pretrained_model',wrap:!1}}),st=new g({props:{code:"Q0tQVCUzRDAxMDAwMCUwQWhmJTIwdXBsb2FkJTIwJTI0JTdCSEZfVVNFUiU3RCUyRmFjdF9zbzEwMV90ZXN0JTI0JTdCQ0tQVCU3RCUyMCU1QyUwQSUyMCUyMG91dHB1dHMlMkZ0cmFpbiUyRmFjdF9zbzEwMV90ZXN0JTJGY2hlY2twb2ludHMlMkYlMjQlN0JDS1BUJTdEJTJGcHJldHJhaW5lZF9tb2RlbA==",highlighted:'CKPT=010000\nhf upload <span class="hljs-variable">${HF_USER}</span>/act_so101_test<span class="hljs-variable">${CKPT}</span> \\\n  outputs/train/act_so101_test/checkpoints/<span class="hljs-variable">${CKPT}</span>/pretrained_model',wrap:!1}}),at=new j({props:{title:"Run inference and evaluate your policy",local:"run-inference-and-evaluate-your-policy",headingTag:"h2"}}),V=new Mt({props:{id:"eval",options:["Command","API example"],$$slots:{default:[ga]},$$scope:{ctx:f}}}),rt=new pa({props:{source:"https://github.com/huggingface/lerobot/blob/main/docs/source/il_robots.mdx"}}),{c(){o=M("meta"),p=i(),s=M("p"),U=i(),y(n.$$.fragment),w=i(),y(h.$$.fragment),C=i(),E=M("p"),E.textContent=Hl,ct=i(),G=M("p"),G.innerHTML=Ll,yt=i(),X=M("ol"),X.innerHTML=Dl,dt=i(),A=M("p"),A.textContent=ql,mt=i(),N=M("details"),N.innerHTML=Pl,Jt=i(),k=M("p"),k.textContent=Ol,ut=i(),Q=M("p"),Q.textContent=Kl,bt=i(),W=M("p"),W.textContent=es,Tt=i(),Y=M("p"),Y.innerHTML=ts,Ut=i(),y(v.$$.fragment),wt=i(),y(F.$$.fragment),ft=i(),S=M("p"),S.textContent=ls,ht=i(),y(x.$$.fragment),jt=i(),z=M("p"),z.textContent=ss,Ct=i(),H=M("p"),H.innerHTML=as,gt=i(),y(_.$$.fragment),It=i(),L=M("p"),L.textContent=os,$t=i(),D=M("ol"),D.innerHTML=ns,vt=i(),y(q.$$.fragment),_t=i(),P=M("p"),P.innerHTML=is,Zt=i(),y(O.$$.fragment),Rt=i(),K=M("p"),K.innerHTML=rs,Bt=i(),y(Z.$$.fragment),Vt=i(),y(ee.$$.fragment),Et=i(),te=M("p"),te.textContent=ps,Gt=i(),le=M("p"),le.innerHTML=Ms,Xt=i(),se=M("p"),se.textContent=cs,At=i(),y(ae.$$.fragment),Nt=i(),oe=M("p"),oe.textContent=ys,kt=i(),y(ne.$$.fragment),Qt=i(),ie=M("p"),ie.textContent=ds,Wt=i(),y(R.$$.fragment),Yt=i(),y(re.$$.fragment),Ft=i(),pe=M("p"),pe.innerHTML=ms,St=i(),y(Me.$$.fragment),xt=i(),ce=M("p"),ce.innerHTML=Js,zt=i(),ye=M("p"),ye.innerHTML=us,Ht=i(),de=M("p"),de.textContent=bs,Lt=i(),y(me.$$.fragment),Dt=i(),y(Je.$$.fragment),qt=i(),ue=M("p"),ue.innerHTML=Ts,Pt=i(),y(be.$$.fragment),Ot=i(),Te=M("ul"),Te.innerHTML=Us,Kt=i(),y(Ue.$$.fragment),el=i(),we=M("ul"),we.innerHTML=ws,tl=i(),y(fe.$$.fragment),ll=i(),he=M("p"),he.textContent=fs,sl=i(),je=M("ul"),je.innerHTML=hs,al=i(),y(Ce.$$.fragment),ol=i(),ge=M("p"),ge.textContent=js,nl=i(),Ie=M("ul"),Ie.innerHTML=Cs,il=i(),y($e.$$.fragment),rl=i(),ve=M("p"),ve.textContent=gs,pl=i(),_e=M("p"),_e.textContent=Is,Ml=i(),Ze=M("p"),Ze.textContent=$s,cl=i(),Re=M("p"),Re.innerHTML=vs,yl=i(),y(Be.$$.fragment),dl=i(),Ve=M("ul"),Ve.innerHTML=_s,ml=i(),y(Ee.$$.fragment),Jl=i(),Ge=M("p"),Ge.innerHTML=Zs,ul=i(),y(Xe.$$.fragment),bl=i(),y(Ae.$$.fragment),Tl=i(),Ne=M("p"),Ne.innerHTML=Rs,Ul=i(),ke=M("p"),ke.textContent=Bs,wl=i(),y(B.$$.fragment),fl=i(),Qe=M("p"),Qe.innerHTML=Vs,hl=i(),y(We.$$.fragment),jl=i(),Ye=M("p"),Ye.innerHTML=Es,Cl=i(),y(Fe.$$.fragment),gl=i(),Se=M("p"),Se.textContent=Gs,Il=i(),xe=M("ol"),xe.innerHTML=Xs,$l=i(),ze=M("p"),ze.innerHTML=As,vl=i(),He=M("p"),He.innerHTML=Ns,_l=i(),y(Le.$$.fragment),Zl=i(),De=M("p"),De.innerHTML=ks,Rl=i(),qe=M("p"),qe.innerHTML=Qs,Bl=i(),y(Pe.$$.fragment),Vl=i(),Oe=M("p"),Oe.innerHTML=Ws,El=i(),y(Ke.$$.fragment),Gl=i(),et=M("p"),et.textContent=Ys,Xl=i(),y(tt.$$.fragment),Al=i(),lt=M("p"),lt.textContent=Fs,Nl=i(),y(st.$$.fragment),kl=i(),y(at.$$.fragment),Ql=i(),ot=M("p"),ot.innerHTML=Ss,Wl=i(),y(V.$$.fragment),Yl=i(),nt=M("p"),nt.textContent=xs,Fl=i(),it=M("ol"),it.innerHTML=zs,Sl=i(),y(rt.$$.fragment),xl=i(),pt=M("p"),this.h()},l(e){const t=oa("svelte-u9bgzb",document.head);o=c(t,"META",{name:!0,content:!0}),t.forEach(l),p=r(e),s=c(e,"P",{}),Ks(s).forEach(l),U=r(e),d(n.$$.fragment,e),w=r(e),d(h.$$.fragment,e),C=r(e),E=c(e,"P",{"data-svelte-h":!0}),T(E)!=="svelte-21t2sw"&&(E.textContent=Hl),ct=r(e),G=c(e,"P",{"data-svelte-h":!0}),T(G)!=="svelte-xo8ua7"&&(G.innerHTML=Ll),yt=r(e),X=c(e,"OL",{"data-svelte-h":!0}),T(X)!=="svelte-1guuyxp"&&(X.innerHTML=Dl),dt=r(e),A=c(e,"P",{"data-svelte-h":!0}),T(A)!=="svelte-wday6x"&&(A.textContent=ql),mt=r(e),N=c(e,"DETAILS",{"data-svelte-h":!0}),T(N)!=="svelte-1xbyi02"&&(N.innerHTML=Pl),Jt=r(e),k=c(e,"P",{"data-svelte-h":!0}),T(k)!=="svelte-1rmorch"&&(k.textContent=Ol),ut=r(e),Q=c(e,"P",{"data-svelte-h":!0}),T(Q)!=="svelte-vwh3sq"&&(Q.textContent=Kl),bt=r(e),W=c(e,"P",{"data-svelte-h":!0}),T(W)!=="svelte-aqc99n"&&(W.textContent=es),Tt=r(e),Y=c(e,"P",{"data-svelte-h":!0}),T(Y)!=="svelte-175e9wr"&&(Y.innerHTML=ts),Ut=r(e),d(v.$$.fragment,e),wt=r(e),d(F.$$.fragment,e),ft=r(e),S=c(e,"P",{"data-svelte-h":!0}),T(S)!=="svelte-3l5nsa"&&(S.textContent=ls),ht=r(e),d(x.$$.fragment,e),jt=r(e),z=c(e,"P",{"data-svelte-h":!0}),T(z)!=="svelte-q14pfj"&&(z.textContent=ss),Ct=r(e),H=c(e,"P",{"data-svelte-h":!0}),T(H)!=="svelte-4dj09k"&&(H.innerHTML=as),gt=r(e),d(_.$$.fragment,e),It=r(e),L=c(e,"P",{"data-svelte-h":!0}),T(L)!=="svelte-utgp5r"&&(L.textContent=os),$t=r(e),D=c(e,"OL",{"data-svelte-h":!0}),T(D)!=="svelte-1ix81x8"&&(D.innerHTML=ns),vt=r(e),d(q.$$.fragment,e),_t=r(e),P=c(e,"P",{"data-svelte-h":!0}),T(P)!=="svelte-12jvdq3"&&(P.innerHTML=is),Zt=r(e),d(O.$$.fragment,e),Rt=r(e),K=c(e,"P",{"data-svelte-h":!0}),T(K)!=="svelte-1dppnmf"&&(K.innerHTML=rs),Bt=r(e),d(Z.$$.fragment,e),Vt=r(e),d(ee.$$.fragment,e),Et=r(e),te=c(e,"P",{"data-svelte-h":!0}),T(te)!=="svelte-1nfhg37"&&(te.textContent=ps),Gt=r(e),le=c(e,"P",{"data-svelte-h":!0}),T(le)!=="svelte-1yil1pb"&&(le.innerHTML=Ms),Xt=r(e),se=c(e,"P",{"data-svelte-h":!0}),T(se)!=="svelte-1wt46f4"&&(se.textContent=cs),At=r(e),d(ae.$$.fragment,e),Nt=r(e),oe=c(e,"P",{"data-svelte-h":!0}),T(oe)!=="svelte-1qc22uu"&&(oe.textContent=ys),kt=r(e),d(ne.$$.fragment,e),Qt=r(e),ie=c(e,"P",{"data-svelte-h":!0}),T(ie)!=="svelte-1rjq902"&&(ie.textContent=ds),Wt=r(e),d(R.$$.fragment,e),Yt=r(e),d(re.$$.fragment,e),Ft=r(e),pe=c(e,"P",{"data-svelte-h":!0}),T(pe)!=="svelte-27mc02"&&(pe.innerHTML=ms),St=r(e),d(Me.$$.fragment,e),xt=r(e),ce=c(e,"P",{"data-svelte-h":!0}),T(ce)!=="svelte-16ex640"&&(ce.innerHTML=Js),zt=r(e),ye=c(e,"P",{"data-svelte-h":!0}),T(ye)!=="svelte-12sit8s"&&(ye.innerHTML=us),Ht=r(e),de=c(e,"P",{"data-svelte-h":!0}),T(de)!=="svelte-1jq5p1b"&&(de.textContent=bs),Lt=r(e),d(me.$$.fragment,e),Dt=r(e),d(Je.$$.fragment,e),qt=r(e),ue=c(e,"P",{"data-svelte-h":!0}),T(ue)!=="svelte-1hxrxsl"&&(ue.innerHTML=Ts),Pt=r(e),d(be.$$.fragment,e),Ot=r(e),Te=c(e,"UL",{"data-svelte-h":!0}),T(Te)!=="svelte-lyz1u1"&&(Te.innerHTML=Us),Kt=r(e),d(Ue.$$.fragment,e),el=r(e),we=c(e,"UL",{"data-svelte-h":!0}),T(we)!=="svelte-1j466wa"&&(we.innerHTML=ws),tl=r(e),d(fe.$$.fragment,e),ll=r(e),he=c(e,"P",{"data-svelte-h":!0}),T(he)!=="svelte-1ytdalz"&&(he.textContent=fs),sl=r(e),je=c(e,"UL",{"data-svelte-h":!0}),T(je)!=="svelte-xo376n"&&(je.innerHTML=hs),al=r(e),d(Ce.$$.fragment,e),ol=r(e),ge=c(e,"P",{"data-svelte-h":!0}),T(ge)!=="svelte-133erjf"&&(ge.textContent=js),nl=r(e),Ie=c(e,"UL",{"data-svelte-h":!0}),T(Ie)!=="svelte-xovzns"&&(Ie.innerHTML=Cs),il=r(e),d($e.$$.fragment,e),rl=r(e),ve=c(e,"P",{"data-svelte-h":!0}),T(ve)!=="svelte-53ok25"&&(ve.textContent=gs),pl=r(e),_e=c(e,"P",{"data-svelte-h":!0}),T(_e)!=="svelte-g5y8pt"&&(_e.textContent=Is),Ml=r(e),Ze=c(e,"P",{"data-svelte-h":!0}),T(Ze)!=="svelte-1gvnhwt"&&(Ze.textContent=$s),cl=r(e),Re=c(e,"P",{"data-svelte-h":!0}),T(Re)!=="svelte-1rzn05f"&&(Re.innerHTML=vs),yl=r(e),d(Be.$$.fragment,e),dl=r(e),Ve=c(e,"UL",{"data-svelte-h":!0}),T(Ve)!=="svelte-1d8rggu"&&(Ve.innerHTML=_s),ml=r(e),d(Ee.$$.fragment,e),Jl=r(e),Ge=c(e,"P",{"data-svelte-h":!0}),T(Ge)!=="svelte-18hgtfq"&&(Ge.innerHTML=Zs),ul=r(e),d(Xe.$$.fragment,e),bl=r(e),d(Ae.$$.fragment,e),Tl=r(e),Ne=c(e,"P",{"data-svelte-h":!0}),T(Ne)!=="svelte-1e1wth5"&&(Ne.innerHTML=Rs),Ul=r(e),ke=c(e,"P",{"data-svelte-h":!0}),T(ke)!=="svelte-1abr8n2"&&(ke.textContent=Bs),wl=r(e),d(B.$$.fragment,e),fl=r(e),Qe=c(e,"P",{"data-svelte-h":!0}),T(Qe)!=="svelte-10lfyd3"&&(Qe.innerHTML=Vs),hl=r(e),d(We.$$.fragment,e),jl=r(e),Ye=c(e,"P",{"data-svelte-h":!0}),T(Ye)!=="svelte-2c9lbu"&&(Ye.innerHTML=Es),Cl=r(e),d(Fe.$$.fragment,e),gl=r(e),Se=c(e,"P",{"data-svelte-h":!0}),T(Se)!=="svelte-1aio4w2"&&(Se.textContent=Gs),Il=r(e),xe=c(e,"OL",{"data-svelte-h":!0}),T(xe)!=="svelte-jwp2v"&&(xe.innerHTML=Xs),$l=r(e),ze=c(e,"P",{"data-svelte-h":!0}),T(ze)!=="svelte-1fsreqm"&&(ze.innerHTML=As),vl=r(e),He=c(e,"P",{"data-svelte-h":!0}),T(He)!=="svelte-1lwh85c"&&(He.innerHTML=Ns),_l=r(e),d(Le.$$.fragment,e),Zl=r(e),De=c(e,"P",{"data-svelte-h":!0}),T(De)!=="svelte-v678sy"&&(De.innerHTML=ks),Rl=r(e),qe=c(e,"P",{"data-svelte-h":!0}),T(qe)!=="svelte-7xiimr"&&(qe.innerHTML=Qs),Bl=r(e),d(Pe.$$.fragment,e),Vl=r(e),Oe=c(e,"P",{"data-svelte-h":!0}),T(Oe)!=="svelte-1bpkjcm"&&(Oe.innerHTML=Ws),El=r(e),d(Ke.$$.fragment,e),Gl=r(e),et=c(e,"P",{"data-svelte-h":!0}),T(et)!=="svelte-15j4w0e"&&(et.textContent=Ys),Xl=r(e),d(tt.$$.fragment,e),Al=r(e),lt=c(e,"P",{"data-svelte-h":!0}),T(lt)!=="svelte-ex9l9h"&&(lt.textContent=Fs),Nl=r(e),d(st.$$.fragment,e),kl=r(e),d(at.$$.fragment,e),Ql=r(e),ot=c(e,"P",{"data-svelte-h":!0}),T(ot)!=="svelte-5t1tne"&&(ot.innerHTML=Ss),Wl=r(e),d(V.$$.fragment,e),Yl=r(e),nt=c(e,"P",{"data-svelte-h":!0}),T(nt)!=="svelte-v77er4"&&(nt.textContent=xs),Fl=r(e),it=c(e,"OL",{"data-svelte-h":!0}),T(it)!=="svelte-j2c0fi"&&(it.innerHTML=zs),Sl=r(e),d(rt.$$.fragment,e),xl=r(e),pt=c(e,"P",{}),Ks(pt).forEach(l),this.h()},h(){ea(o,"name","hf:doc:metadata"),ea(o,"content",$a)},m(e,t){na(document.head,o),a(e,p,t),a(e,s,t),a(e,U,t),m(n,e,t),a(e,w,t),m(h,e,t),a(e,C,t),a(e,E,t),a(e,ct,t),a(e,G,t),a(e,yt,t),a(e,X,t),a(e,dt,t),a(e,A,t),a(e,mt,t),a(e,N,t),a(e,Jt,t),a(e,k,t),a(e,ut,t),a(e,Q,t),a(e,bt,t),a(e,W,t),a(e,Tt,t),a(e,Y,t),a(e,Ut,t),m(v,e,t),a(e,wt,t),m(F,e,t),a(e,ft,t),a(e,S,t),a(e,ht,t),m(x,e,t),a(e,jt,t),a(e,z,t),a(e,Ct,t),a(e,H,t),a(e,gt,t),m(_,e,t),a(e,It,t),a(e,L,t),a(e,$t,t),a(e,D,t),a(e,vt,t),m(q,e,t),a(e,_t,t),a(e,P,t),a(e,Zt,t),m(O,e,t),a(e,Rt,t),a(e,K,t),a(e,Bt,t),m(Z,e,t),a(e,Vt,t),m(ee,e,t),a(e,Et,t),a(e,te,t),a(e,Gt,t),a(e,le,t),a(e,Xt,t),a(e,se,t),a(e,At,t),m(ae,e,t),a(e,Nt,t),a(e,oe,t),a(e,kt,t),m(ne,e,t),a(e,Qt,t),a(e,ie,t),a(e,Wt,t),m(R,e,t),a(e,Yt,t),m(re,e,t),a(e,Ft,t),a(e,pe,t),a(e,St,t),m(Me,e,t),a(e,xt,t),a(e,ce,t),a(e,zt,t),a(e,ye,t),a(e,Ht,t),a(e,de,t),a(e,Lt,t),m(me,e,t),a(e,Dt,t),m(Je,e,t),a(e,qt,t),a(e,ue,t),a(e,Pt,t),m(be,e,t),a(e,Ot,t),a(e,Te,t),a(e,Kt,t),m(Ue,e,t),a(e,el,t),a(e,we,t),a(e,tl,t),m(fe,e,t),a(e,ll,t),a(e,he,t),a(e,sl,t),a(e,je,t),a(e,al,t),m(Ce,e,t),a(e,ol,t),a(e,ge,t),a(e,nl,t),a(e,Ie,t),a(e,il,t),m($e,e,t),a(e,rl,t),a(e,ve,t),a(e,pl,t),a(e,_e,t),a(e,Ml,t),a(e,Ze,t),a(e,cl,t),a(e,Re,t),a(e,yl,t),m(Be,e,t),a(e,dl,t),a(e,Ve,t),a(e,ml,t),m(Ee,e,t),a(e,Jl,t),a(e,Ge,t),a(e,ul,t),m(Xe,e,t),a(e,bl,t),m(Ae,e,t),a(e,Tl,t),a(e,Ne,t),a(e,Ul,t),a(e,ke,t),a(e,wl,t),m(B,e,t),a(e,fl,t),a(e,Qe,t),a(e,hl,t),m(We,e,t),a(e,jl,t),a(e,Ye,t),a(e,Cl,t),m(Fe,e,t),a(e,gl,t),a(e,Se,t),a(e,Il,t),a(e,xe,t),a(e,$l,t),a(e,ze,t),a(e,vl,t),a(e,He,t),a(e,_l,t),m(Le,e,t),a(e,Zl,t),a(e,De,t),a(e,Rl,t),a(e,qe,t),a(e,Bl,t),m(Pe,e,t),a(e,Vl,t),a(e,Oe,t),a(e,El,t),m(Ke,e,t),a(e,Gl,t),a(e,et,t),a(e,Xl,t),m(tt,e,t),a(e,Al,t),a(e,lt,t),a(e,Nl,t),m(st,e,t),a(e,kl,t),m(at,e,t),a(e,Ql,t),a(e,ot,t),a(e,Wl,t),m(V,e,t),a(e,Yl,t),a(e,nt,t),a(e,Fl,t),a(e,it,t),a(e,Sl,t),m(rt,e,t),a(e,xl,t),a(e,pt,t),zl=!0},p(e,[t]){const Hs={};t&2&&(Hs.$$scope={dirty:t,ctx:e}),v.$set(Hs);const Ls={};t&2&&(Ls.$$scope={dirty:t,ctx:e}),_.$set(Ls);const Ds={};t&2&&(Ds.$$scope={dirty:t,ctx:e}),Z.$set(Ds);const qs={};t&2&&(qs.$$scope={dirty:t,ctx:e}),R.$set(qs);const Ps={};t&2&&(Ps.$$scope={dirty:t,ctx:e}),B.$set(Ps);const Os={};t&2&&(Os.$$scope={dirty:t,ctx:e}),V.$set(Os)},i(e){zl||(J(n.$$.fragment,e),J(h.$$.fragment,e),J(v.$$.fragment,e),J(F.$$.fragment,e),J(x.$$.fragment,e),J(_.$$.fragment,e),J(q.$$.fragment,e),J(O.$$.fragment,e),J(Z.$$.fragment,e),J(ee.$$.fragment,e),J(ae.$$.fragment,e),J(ne.$$.fragment,e),J(R.$$.fragment,e),J(re.$$.fragment,e),J(Me.$$.fragment,e),J(me.$$.fragment,e),J(Je.$$.fragment,e),J(be.$$.fragment,e),J(Ue.$$.fragment,e),J(fe.$$.fragment,e),J(Ce.$$.fragment,e),J($e.$$.fragment,e),J(Be.$$.fragment,e),J(Ee.$$.fragment,e),J(Xe.$$.fragment,e),J(Ae.$$.fragment,e),J(B.$$.fragment,e),J(We.$$.fragment,e),J(Fe.$$.fragment,e),J(Le.$$.fragment,e),J(Pe.$$.fragment,e),J(Ke.$$.fragment,e),J(tt.$$.fragment,e),J(st.$$.fragment,e),J(at.$$.fragment,e),J(V.$$.fragment,e),J(rt.$$.fragment,e),zl=!0)},o(e){u(n.$$.fragment,e),u(h.$$.fragment,e),u(v.$$.fragment,e),u(F.$$.fragment,e),u(x.$$.fragment,e),u(_.$$.fragment,e),u(q.$$.fragment,e),u(O.$$.fragment,e),u(Z.$$.fragment,e),u(ee.$$.fragment,e),u(ae.$$.fragment,e),u(ne.$$.fragment,e),u(R.$$.fragment,e),u(re.$$.fragment,e),u(Me.$$.fragment,e),u(me.$$.fragment,e),u(Je.$$.fragment,e),u(be.$$.fragment,e),u(Ue.$$.fragment,e),u(fe.$$.fragment,e),u(Ce.$$.fragment,e),u($e.$$.fragment,e),u(Be.$$.fragment,e),u(Ee.$$.fragment,e),u(Xe.$$.fragment,e),u(Ae.$$.fragment,e),u(B.$$.fragment,e),u(We.$$.fragment,e),u(Fe.$$.fragment,e),u(Le.$$.fragment,e),u(Pe.$$.fragment,e),u(Ke.$$.fragment,e),u(tt.$$.fragment,e),u(st.$$.fragment,e),u(at.$$.fragment,e),u(V.$$.fragment,e),u(rt.$$.fragment,e),zl=!1},d(e){e&&(l(p),l(s),l(U),l(w),l(C),l(E),l(ct),l(G),l(yt),l(X),l(dt),l(A),l(mt),l(N),l(Jt),l(k),l(ut),l(Q),l(bt),l(W),l(Tt),l(Y),l(Ut),l(wt),l(ft),l(S),l(ht),l(jt),l(z),l(Ct),l(H),l(gt),l(It),l(L),l($t),l(D),l(vt),l(_t),l(P),l(Zt),l(Rt),l(K),l(Bt),l(Vt),l(Et),l(te),l(Gt),l(le),l(Xt),l(se),l(At),l(Nt),l(oe),l(kt),l(Qt),l(ie),l(Wt),l(Yt),l(Ft),l(pe),l(St),l(xt),l(ce),l(zt),l(ye),l(Ht),l(de),l(Lt),l(Dt),l(qt),l(ue),l(Pt),l(Ot),l(Te),l(Kt),l(el),l(we),l(tl),l(ll),l(he),l(sl),l(je),l(al),l(ol),l(ge),l(nl),l(Ie),l(il),l(rl),l(ve),l(pl),l(_e),l(Ml),l(Ze),l(cl),l(Re),l(yl),l(dl),l(Ve),l(ml),l(Jl),l(Ge),l(ul),l(bl),l(Tl),l(Ne),l(Ul),l(ke),l(wl),l(fl),l(Qe),l(hl),l(jl),l(Ye),l(Cl),l(gl),l(Se),l(Il),l(xe),l($l),l(ze),l(vl),l(He),l(_l),l(Zl),l(De),l(Rl),l(qe),l(Bl),l(Vl),l(Oe),l(El),l(Gl),l(et),l(Xl),l(Al),l(lt),l(Nl),l(kl),l(Ql),l(ot),l(Wl),l(Yl),l(nt),l(Fl),l(it),l(Sl),l(xl),l(pt)),l(o),b(n,e),b(h,e),b(v,e),b(F,e),b(x,e),b(_,e),b(q,e),b(O,e),b(Z,e),b(ee,e),b(ae,e),b(ne,e),b(R,e),b(re,e),b(Me,e),b(me,e),b(Je,e),b(be,e),b(Ue,e),b(fe,e),b(Ce,e),b($e,e),b(Be,e),b(Ee,e),b(Xe,e),b(Ae,e),b(B,e),b(We,e),b(Fe,e),b(Le,e),b(Pe,e),b(Ke,e),b(tt,e),b(st,e),b(at,e),b(V,e),b(rt,e)}}}const $a='{"title":"Imitation Learning on Real-World Robots","local":"imitation-learning-on-real-world-robots","sections":[{"title":"Set up and Calibrate","local":"set-up-and-calibrate","sections":[],"depth":2},{"title":"Teleoperate","local":"teleoperate","sections":[],"depth":2},{"title":"Cameras","local":"cameras","sections":[],"depth":2},{"title":"Teleoperate with cameras","local":"teleoperate-with-cameras","sections":[],"depth":2},{"title":"Record a dataset","local":"record-a-dataset","sections":[{"title":"Dataset upload","local":"dataset-upload","sections":[],"depth":4},{"title":"Record function","local":"record-function","sections":[{"title":"1. Data Storage","local":"1-data-storage","sections":[],"depth":5},{"title":"2. Checkpointing and Resuming","local":"2-checkpointing-and-resuming","sections":[],"depth":5},{"title":"3. Recording Parameters","local":"3-recording-parameters","sections":[],"depth":5},{"title":"4. Keyboard Controls During Recording","local":"4-keyboard-controls-during-recording","sections":[],"depth":5}],"depth":4},{"title":"Tips for gathering data","local":"tips-for-gathering-data","sections":[],"depth":4},{"title":"Troubleshooting:","local":"troubleshooting","sections":[],"depth":4}],"depth":2},{"title":"Visualize a dataset","local":"visualize-a-dataset","sections":[],"depth":2},{"title":"Replay an episode","local":"replay-an-episode","sections":[],"depth":2},{"title":"Train a policy","local":"train-a-policy","sections":[{"title":"Train using Google Colab","local":"train-using-google-colab","sections":[],"depth":4},{"title":"Upload policy checkpoints","local":"upload-policy-checkpoints","sections":[],"depth":4}],"depth":2},{"title":"Run inference and evaluate your policy","local":"run-inference-and-evaluate-your-policy","sections":[],"depth":2}],"depth":1}';function va(f){return la(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Xa extends sa{constructor(o){super(),aa(this,o,va,Ia,ta,{})}}export{Xa as component};
