import{s as we,o as $e,n as fe}from"../chunks/scheduler.eb244325.js";import{S as je,i as be,e as d,s as i,c as w,h as Je,a as y,d as l,b as p,f as de,g as $,j as U,k as ne,l as Ce,m as s,n as j,t as b,o as J,p as C}from"../chunks/index.3fe63ad3.js";import{C as Ue}from"../chunks/CopyLLMTxtMenu.08242e11.js";import{C as L}from"../chunks/CodeBlock.91baa5b4.js";import{H as he,E as Te}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.234c3f85.js";import{H as ye,a as Me}from"../chunks/HfOption.0914e9f3.js";function ge(V){let a,M;return a=new L({props:{code:"ZnJvbSUyMGxlcm9ib3QuY2FtZXJhcy5vcGVuY3YuY29uZmlndXJhdGlvbl9vcGVuY3YlMjBpbXBvcnQlMjBPcGVuQ1ZDYW1lcmFDb25maWclMEFmcm9tJTIwbGVyb2JvdC5jYW1lcmFzLm9wZW5jdi5jYW1lcmFfb3BlbmN2JTIwaW1wb3J0JTIwT3BlbkNWQ2FtZXJhJTBBZnJvbSUyMGxlcm9ib3QuY2FtZXJhcy5jb25maWdzJTIwaW1wb3J0JTIwQ29sb3JNb2RlJTJDJTIwQ3YyUm90YXRpb24lMEElMEElMjMlMjBDb25zdHJ1Y3QlMjBhbiUyMCU2ME9wZW5DVkNhbWVyYUNvbmZpZyU2MCUyMHdpdGglMjB5b3VyJTIwZGVzaXJlZCUyMEZQUyUyQyUyMHJlc29sdXRpb24lMkMlMjBjb2xvciUyMG1vZGUlMkMlMjBhbmQlMjByb3RhdGlvbi4lMEFjb25maWclMjAlM0QlMjBPcGVuQ1ZDYW1lcmFDb25maWcoJTBBJTIwJTIwJTIwJTIwaW5kZXhfb3JfcGF0aCUzRDAlMkMlMEElMjAlMjAlMjAlMjBmcHMlM0QxNSUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNEMTkyMCUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDEwODAlMkMlMEElMjAlMjAlMjAlMjBjb2xvcl9tb2RlJTNEQ29sb3JNb2RlLlJHQiUyQyUwQSUyMCUyMCUyMCUyMHJvdGF0aW9uJTNEQ3YyUm90YXRpb24uTk9fUk9UQVRJT04lMEEpJTBBJTBBJTIzJTIwSW5zdGFudGlhdGUlMjBhbmQlMjBjb25uZWN0JTIwYW4lMjAlNjBPcGVuQ1ZDYW1lcmElNjAlMkMlMjBwZXJmb3JtaW5nJTIwYSUyMHdhcm0tdXAlMjByZWFkJTIwKGRlZmF1bHQpLiUwQWNhbWVyYSUyMCUzRCUyME9wZW5DVkNhbWVyYShjb25maWcpJTBBY2FtZXJhLmNvbm5lY3QoKSUwQSUwQSUyMyUyMFJlYWQlMjBmcmFtZXMlMjBhc3luY2hyb25vdXNseSUyMGluJTIwYSUyMGxvb3AlMjB2aWElMjAlNjBhc3luY19yZWFkKHRpbWVvdXRfbXMpJTYwJTBBdHJ5JTNBJTBBJTIwJTIwJTIwJTIwZm9yJTIwaSUyMGluJTIwcmFuZ2UoMTApJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZnJhbWUlMjAlM0QlMjBjYW1lcmEuYXN5bmNfcmVhZCh0aW1lb3V0X21zJTNEMjAwKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHByaW50KGYlMjJBc3luYyUyMGZyYW1lJTIwJTdCaSU3RCUyMHNoYXBlJTNBJTIyJTJDJTIwZnJhbWUuc2hhcGUpJTBBZmluYWxseSUzQSUwQSUyMCUyMCUyMCUyMGNhbWVyYS5kaXNjb25uZWN0KCk=",highlighted:`<span class="hljs-keyword">from</span> lerobot.cameras.opencv.configuration_opencv <span class="hljs-keyword">import</span> OpenCVCameraConfig
<span class="hljs-keyword">from</span> lerobot.cameras.opencv.camera_opencv <span class="hljs-keyword">import</span> OpenCVCamera
<span class="hljs-keyword">from</span> lerobot.cameras.configs <span class="hljs-keyword">import</span> ColorMode, Cv2Rotation

<span class="hljs-comment"># Construct an \`OpenCVCameraConfig\` with your desired FPS, resolution, color mode, and rotation.</span>
config = OpenCVCameraConfig(
    index_or_path=<span class="hljs-number">0</span>,
    fps=<span class="hljs-number">15</span>,
    width=<span class="hljs-number">1920</span>,
    height=<span class="hljs-number">1080</span>,
    color_mode=ColorMode.RGB,
    rotation=Cv2Rotation.NO_ROTATION
)

<span class="hljs-comment"># Instantiate and connect an \`OpenCVCamera\`, performing a warm-up read (default).</span>
camera = OpenCVCamera(config)
camera.connect()

<span class="hljs-comment"># Read frames asynchronously in a loop via \`async_read(timeout_ms)\`</span>
<span class="hljs-keyword">try</span>:
    <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">10</span>):
        frame = camera.async_read(timeout_ms=<span class="hljs-number">200</span>)
        <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Async frame <span class="hljs-subst">{i}</span> shape:&quot;</span>, frame.shape)
<span class="hljs-keyword">finally</span>:
    camera.disconnect()`,wrap:!1}}),{c(){w(a.$$.fragment)},l(o){$(a.$$.fragment,o)},m(o,c){j(a,o,c),M=!0},p:fe,i(o){M||(b(a.$$.fragment,o),M=!0)},o(o){J(a.$$.fragment,o),M=!1},d(o){C(a,o)}}}function ve(V){let a,M;return a=new L({props:{code:"ZnJvbSUyMGxlcm9ib3QuY2FtZXJhcy5yZWFsc2Vuc2UuY29uZmlndXJhdGlvbl9yZWFsc2Vuc2UlMjBpbXBvcnQlMjBSZWFsU2Vuc2VDYW1lcmFDb25maWclMEFmcm9tJTIwbGVyb2JvdC5jYW1lcmFzLnJlYWxzZW5zZS5jYW1lcmFfcmVhbHNlbnNlJTIwaW1wb3J0JTIwUmVhbFNlbnNlQ2FtZXJhJTBBZnJvbSUyMGxlcm9ib3QuY2FtZXJhcy5jb25maWdzJTIwaW1wb3J0JTIwQ29sb3JNb2RlJTJDJTIwQ3YyUm90YXRpb24lMEElMEElMjMlMjBDcmVhdGUlMjBhJTIwJTYwUmVhbFNlbnNlQ2FtZXJhQ29uZmlnJTYwJTIwc3BlY2lmeWluZyUyMHlvdXIlMjBjYW1lcmElRTIlODAlOTlzJTIwc2VyaWFsJTIwbnVtYmVyJTIwYW5kJTIwZW5hYmxpbmclMjBkZXB0aC4lMEFjb25maWclMjAlM0QlMjBSZWFsU2Vuc2VDYW1lcmFDb25maWcoJTBBJTIwJTIwJTIwJTIwc2VyaWFsX251bWJlcl9vcl9uYW1lJTNEJTIyMjMzNTIyMDc0NjA2JTIyJTJDJTBBJTIwJTIwJTIwJTIwZnBzJTNEMTUlMkMlMEElMjAlMjAlMjAlMjB3aWR0aCUzRDY0MCUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDQ4MCUyQyUwQSUyMCUyMCUyMCUyMGNvbG9yX21vZGUlM0RDb2xvck1vZGUuUkdCJTJDJTBBJTIwJTIwJTIwJTIwdXNlX2RlcHRoJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMHJvdGF0aW9uJTNEQ3YyUm90YXRpb24uTk9fUk9UQVRJT04lMEEpJTBBJTBBJTIzJTIwSW5zdGFudGlhdGUlMjBhbmQlMjBjb25uZWN0JTIwYSUyMCU2MFJlYWxTZW5zZUNhbWVyYSU2MCUyMHdpdGglMjB3YXJtLXVwJTIwcmVhZCUyMChkZWZhdWx0KS4lMEFjYW1lcmElMjAlM0QlMjBSZWFsU2Vuc2VDYW1lcmEoY29uZmlnKSUwQWNhbWVyYS5jb25uZWN0KCklMEElMEElMjMlMjBDYXB0dXJlJTIwYSUyMGNvbG9yJTIwZnJhbWUlMjB2aWElMjAlNjByZWFkKCklNjAlMjBhbmQlMjBhJTIwZGVwdGglMjBtYXAlMjB2aWElMjAlNjByZWFkX2RlcHRoKCklNjAuJTBBdHJ5JTNBJTBBJTIwJTIwJTIwJTIwY29sb3JfZnJhbWUlMjAlM0QlMjBjYW1lcmEucmVhZCgpJTBBJTIwJTIwJTIwJTIwZGVwdGhfbWFwJTIwJTNEJTIwY2FtZXJhLnJlYWRfZGVwdGgoKSUwQSUyMCUyMCUyMCUyMHByaW50KCUyMkNvbG9yJTIwZnJhbWUlMjBzaGFwZSUzQSUyMiUyQyUyMGNvbG9yX2ZyYW1lLnNoYXBlKSUwQSUyMCUyMCUyMCUyMHByaW50KCUyMkRlcHRoJTIwbWFwJTIwc2hhcGUlM0ElMjIlMkMlMjBkZXB0aF9tYXAuc2hhcGUpJTBBZmluYWxseSUzQSUwQSUyMCUyMCUyMCUyMGNhbWVyYS5kaXNjb25uZWN0KCk=",highlighted:`<span class="hljs-keyword">from</span> lerobot.cameras.realsense.configuration_realsense <span class="hljs-keyword">import</span> RealSenseCameraConfig
<span class="hljs-keyword">from</span> lerobot.cameras.realsense.camera_realsense <span class="hljs-keyword">import</span> RealSenseCamera
<span class="hljs-keyword">from</span> lerobot.cameras.configs <span class="hljs-keyword">import</span> ColorMode, Cv2Rotation

<span class="hljs-comment"># Create a \`RealSenseCameraConfig\` specifying your camera’s serial number and enabling depth.</span>
config = RealSenseCameraConfig(
    serial_number_or_name=<span class="hljs-string">&quot;233522074606&quot;</span>,
    fps=<span class="hljs-number">15</span>,
    width=<span class="hljs-number">640</span>,
    height=<span class="hljs-number">480</span>,
    color_mode=ColorMode.RGB,
    use_depth=<span class="hljs-literal">True</span>,
    rotation=Cv2Rotation.NO_ROTATION
)

<span class="hljs-comment"># Instantiate and connect a \`RealSenseCamera\` with warm-up read (default).</span>
camera = RealSenseCamera(config)
camera.connect()

<span class="hljs-comment"># Capture a color frame via \`read()\` and a depth map via \`read_depth()\`.</span>
<span class="hljs-keyword">try</span>:
    color_frame = camera.read()
    depth_map = camera.read_depth()
    <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Color frame shape:&quot;</span>, color_frame.shape)
    <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Depth map shape:&quot;</span>, depth_map.shape)
<span class="hljs-keyword">finally</span>:
    camera.disconnect()`,wrap:!1}}),{c(){w(a.$$.fragment)},l(o){$(a.$$.fragment,o)},m(o,c){j(a,o,c),M=!0},p:fe,i(o){M||(b(a.$$.fragment,o),M=!0)},o(o){J(a.$$.fragment,o),M=!1},d(o){C(a,o)}}}function Be(V){let a,M,o,c;return a=new Me({props:{id:"shell_restart",option:"Open CV Camera",$$slots:{default:[ge]},$$scope:{ctx:V}}}),o=new Me({props:{id:"shell_restart",option:"Intel Realsense Camera",$$slots:{default:[ve]},$$scope:{ctx:V}}}),{c(){w(a.$$.fragment),M=i(),w(o.$$.fragment)},l(n){$(a.$$.fragment,n),M=p(n),$(o.$$.fragment,n)},m(n,h){j(a,n,h),s(n,M,h),j(o,n,h),c=!0},p(n,h){const f={};h&2&&(f.$$scope={dirty:h,ctx:n}),a.$set(f);const g={};h&2&&(g.$$scope={dirty:h,ctx:n}),o.$set(g)},i(n){c||(b(a.$$.fragment,n),b(o.$$.fragment,n),c=!0)},o(n){J(a.$$.fragment,n),J(o.$$.fragment,n),c=!1},d(n){n&&l(M),C(a,n),C(o,n)}}}function Ie(V){let a,M="To use your iPhone as a camera on macOS, enable the Continuity Camera feature:",o,c,n="<li>Ensure your Mac is running macOS 13 or later, and your iPhone is on iOS 16 or later.</li> <li>Sign in both devices with the same Apple ID.</li> <li>Connect your devices with a USB cable or turn on Wi-Fi and Bluetooth for a wireless connection.</li>",h,f,g='For more details, visit <a href="https://support.apple.com/en-gb/guide/mac-help/mchl77879b8a/mac" rel="nofollow">Apple support</a>.',T,G,E="Your iPhone should be detected automatically when running the camera setup script in the next section.";return{c(){a=d("p"),a.textContent=M,o=i(),c=d("ul"),c.innerHTML=n,h=i(),f=d("p"),f.innerHTML=g,T=i(),G=d("p"),G.textContent=E},l(u){a=y(u,"P",{"data-svelte-h":!0}),U(a)!=="svelte-gsxth1"&&(a.textContent=M),o=p(u),c=y(u,"UL",{"data-svelte-h":!0}),U(c)!=="svelte-gszkk3"&&(c.innerHTML=n),h=p(u),f=y(u,"P",{"data-svelte-h":!0}),U(f)!=="svelte-13ngf2h"&&(f.innerHTML=g),T=p(u),G=y(u,"P",{"data-svelte-h":!0}),U(G)!=="svelte-4lfiao"&&(G.textContent=E)},m(u,v){s(u,a,v),s(u,o,v),s(u,c,v),s(u,h,v),s(u,f,v),s(u,T,v),s(u,G,v)},p:fe,d(u){u&&(l(a),l(o),l(c),l(h),l(f),l(T),l(G))}}}function We(V){let a,M="If you want to use your phone as a camera on Linux, follow these steps to set up a virtual camera",o,c,n="<li><em>Install <code>v4l2loopback-dkms</code> and <code>v4l-utils</code></em>. Those packages are required to create virtual camera devices (<code>v4l2loopback</code>) and verify their settings with the <code>v4l2-ctl</code> utility from <code>v4l-utils</code>. Install them using:</li>",h,f,g,T,G='<li><em>Install <a href="https://droidcam.app" rel="nofollow">DroidCam</a> on your phone</em>. This app is available for both iOS and Android.</li> <li><em>Install <a href="https://obsproject.com" rel="nofollow">OBS Studio</a></em>. This software will help you manage the camera feed. Install it using <a href="https://flatpak.org" rel="nofollow">Flatpak</a>:</li>',E,u,v,B,ue="<li><em>Install the DroidCam OBS plugin</em>. This plugin integrates DroidCam with OBS Studio. Install it with:</li>",q,S,oe,_,X="<li><em>Start OBS Studio</em>. Launch with:</li>",ee,Z,re,Q,O='<li><em>Add your phone as a source</em>. Follow the instructions <a href="https://droidcam.app/obs/usage" rel="nofollow">here</a>. Be sure to set the resolution to <code>640x480</code>.</li> <li><em>Adjust resolution settings</em>. In OBS Studio, go to <code>File &gt; Settings &gt; Video</code>. Change the <code>Base(Canvas) Resolution</code> and the <code>Output(Scaled) Resolution</code> to <code>640x480</code> by manually typing it in.</li> <li><em>Start virtual camera</em>. In OBS Studio, follow the instructions <a href="https://obsproject.com/kb/virtual-camera-guide" rel="nofollow">here</a>.</li> <li><em>Verify the virtual camera setup</em>. Use <code>v4l2-ctl</code> to list the devices:</li>',te,I,ie,R,D="You should see an entry like:",le,k,pe,x,z="<li><em>Check the camera resolution</em>. Use <code>v4l2-ctl</code> to ensure that the virtual camera output resolution is <code>640x480</code>. Change <code>/dev/video1</code> to the port of your virtual camera from the output of <code>v4l2-ctl --list-devices</code>.</li>",me,F,N,A,P="You should see an entry like:",se,W,ae,Y,ce="Troubleshooting: If the resolution is not correct you will have to delete the Virtual Camera port and try again as it cannot be changed.",K,H,e="If everything is set up correctly, you can proceed with the rest of the tutorial.",r;return f=new L({props:{code:"c3VkbyUyMGFwdCUyMGluc3RhbGwlMjB2NGwybG9vcGJhY2stZGttcyUyMHY0bC11dGlscw==",highlighted:"sudo apt install v4l2loopback-dkms v4l-utils",wrap:!1}}),u=new L({props:{code:"ZmxhdHBhayUyMGluc3RhbGwlMjBmbGF0aHViJTIwY29tLm9ic3Byb2plY3QuU3R1ZGlv",highlighted:"flatpak install flathub com.obsproject.Studio",wrap:!1}}),S=new L({props:{code:"ZmxhdHBhayUyMGluc3RhbGwlMjBmbGF0aHViJTIwY29tLm9ic3Byb2plY3QuU3R1ZGlvLlBsdWdpbi5Ecm9pZENhbQ==",highlighted:"flatpak install flathub com.obsproject.Studio.Plugin.DroidCam",wrap:!1}}),Z=new L({props:{code:"ZmxhdHBhayUyMHJ1biUyMGNvbS5vYnNwcm9qZWN0LlN0dWRpbw==",highlighted:"flatpak run com.obsproject.Studio",wrap:!1}}),I=new L({props:{code:"djRsMi1jdGwlMjAtLWxpc3QtZGV2aWNlcw==",highlighted:'v4l2-ctl --<span class="hljs-built_in">list</span>-devices',wrap:!1}}),k=new L({props:{code:"VmlydHVhbENhbSUyMChwbGF0Zm9ybSUzQXY0bDJsb29wYmFjay0wMDApJTNBJTBBJTJGZGV2JTJGdmlkZW8x",highlighted:`VirtualCam (platform:v4l2loopback<span class="hljs-number">-000</span>):
<span class="hljs-regexp">/dev/</span>video1`,wrap:!1}}),F=new L({props:{code:"djRsMi1jdGwlMjAtZCUyMCUyRmRldiUyRnZpZGVvMSUyMC0tZ2V0LWZtdC12aWRlbw==",highlighted:"v4l2-ctl -d /dev/video1 --get-fmt-video",wrap:!1}}),W=new L({props:{code:"Rm9ybWF0JTIwVmlkZW8lMjBDYXB0dXJlJTNBJTBBV2lkdGglMkZIZWlnaHQlMjAlMjAlMjAlMjAlMjAlMjAlM0ElMjA2NDAlMkY0ODAlMEFQaXhlbCUyMEZvcm1hdCUyMCUyMCUyMCUyMCUyMCUyMCUzQSUyMCdZVVlWJyUyMChZVVlWJTIwNCUzQTIlM0EyKQ==",highlighted:`<span class="hljs-meta prompt_">&gt;</span><span class="language-bash">&gt;&gt; Format Video Capture:</span>
<span class="hljs-meta prompt_">&gt;</span><span class="language-bash">&gt;&gt;	Width/Height      : 640/480</span>
<span class="hljs-meta prompt_">&gt;</span><span class="language-bash">&gt;&gt;	Pixel Format      : <span class="hljs-string">&#x27;YUYV&#x27;</span> (YUYV 4:2:2)</span>`,wrap:!1}}),{c(){a=d("p"),a.textContent=M,o=i(),c=d("ol"),c.innerHTML=n,h=i(),w(f.$$.fragment),g=i(),T=d("ol"),T.innerHTML=G,E=i(),w(u.$$.fragment),v=i(),B=d("ol"),B.innerHTML=ue,q=i(),w(S.$$.fragment),oe=i(),_=d("ol"),_.innerHTML=X,ee=i(),w(Z.$$.fragment),re=i(),Q=d("ol"),Q.innerHTML=O,te=i(),w(I.$$.fragment),ie=i(),R=d("p"),R.textContent=D,le=i(),w(k.$$.fragment),pe=i(),x=d("ol"),x.innerHTML=z,me=i(),w(F.$$.fragment),N=i(),A=d("p"),A.textContent=P,se=i(),w(W.$$.fragment),ae=i(),Y=d("p"),Y.textContent=ce,K=i(),H=d("p"),H.textContent=e,this.h()},l(t){a=y(t,"P",{"data-svelte-h":!0}),U(a)!=="svelte-1rmvii2"&&(a.textContent=M),o=p(t),c=y(t,"OL",{"data-svelte-h":!0}),U(c)!=="svelte-1n7jliq"&&(c.innerHTML=n),h=p(t),$(f.$$.fragment,t),g=p(t),T=y(t,"OL",{start:!0,"data-svelte-h":!0}),U(T)!=="svelte-viptof"&&(T.innerHTML=G),E=p(t),$(u.$$.fragment,t),v=p(t),B=y(t,"OL",{start:!0,"data-svelte-h":!0}),U(B)!=="svelte-1arqhj1"&&(B.innerHTML=ue),q=p(t),$(S.$$.fragment,t),oe=p(t),_=y(t,"OL",{start:!0,"data-svelte-h":!0}),U(_)!=="svelte-k5rjep"&&(_.innerHTML=X),ee=p(t),$(Z.$$.fragment,t),re=p(t),Q=y(t,"OL",{start:!0,"data-svelte-h":!0}),U(Q)!=="svelte-1qxc58j"&&(Q.innerHTML=O),te=p(t),$(I.$$.fragment,t),ie=p(t),R=y(t,"P",{"data-svelte-h":!0}),U(R)!=="svelte-mpsag7"&&(R.textContent=D),le=p(t),$(k.$$.fragment,t),pe=p(t),x=y(t,"OL",{start:!0,"data-svelte-h":!0}),U(x)!=="svelte-nkhkr6"&&(x.innerHTML=z),me=p(t),$(F.$$.fragment,t),N=p(t),A=y(t,"P",{"data-svelte-h":!0}),U(A)!=="svelte-mpsag7"&&(A.textContent=P),se=p(t),$(W.$$.fragment,t),ae=p(t),Y=y(t,"P",{"data-svelte-h":!0}),U(Y)!=="svelte-1srbmw1"&&(Y.textContent=ce),K=p(t),H=y(t,"P",{"data-svelte-h":!0}),U(H)!=="svelte-16oy65i"&&(H.textContent=e),this.h()},h(){ne(T,"start","2"),ne(B,"start","4"),ne(_,"start","5"),ne(Q,"start","6"),ne(x,"start","10")},m(t,m){s(t,a,m),s(t,o,m),s(t,c,m),s(t,h,m),j(f,t,m),s(t,g,m),s(t,T,m),s(t,E,m),j(u,t,m),s(t,v,m),s(t,B,m),s(t,q,m),j(S,t,m),s(t,oe,m),s(t,_,m),s(t,ee,m),j(Z,t,m),s(t,re,m),s(t,Q,m),s(t,te,m),j(I,t,m),s(t,ie,m),s(t,R,m),s(t,le,m),j(k,t,m),s(t,pe,m),s(t,x,m),s(t,me,m),j(F,t,m),s(t,N,m),s(t,A,m),s(t,se,m),j(W,t,m),s(t,ae,m),s(t,Y,m),s(t,K,m),s(t,H,m),r=!0},p:fe,i(t){r||(b(f.$$.fragment,t),b(u.$$.fragment,t),b(S.$$.fragment,t),b(Z.$$.fragment,t),b(I.$$.fragment,t),b(k.$$.fragment,t),b(F.$$.fragment,t),b(W.$$.fragment,t),r=!0)},o(t){J(f.$$.fragment,t),J(u.$$.fragment,t),J(S.$$.fragment,t),J(Z.$$.fragment,t),J(I.$$.fragment,t),J(k.$$.fragment,t),J(F.$$.fragment,t),J(W.$$.fragment,t),r=!1},d(t){t&&(l(a),l(o),l(c),l(h),l(g),l(T),l(E),l(v),l(B),l(q),l(oe),l(_),l(ee),l(re),l(Q),l(te),l(ie),l(R),l(le),l(pe),l(x),l(me),l(N),l(A),l(se),l(ae),l(Y),l(K),l(H)),C(f,t),C(u,t),C(S,t),C(Z,t),C(I,t),C(k,t),C(F,t),C(W,t)}}}function Se(V){let a,M,o,c;return a=new Me({props:{id:"use phone",option:"Mac",$$slots:{default:[Ie]},$$scope:{ctx:V}}}),o=new Me({props:{id:"use phone",option:"Linux",$$slots:{default:[We]},$$scope:{ctx:V}}}),{c(){w(a.$$.fragment),M=i(),w(o.$$.fragment)},l(n){$(a.$$.fragment,n),M=p(n),$(o.$$.fragment,n)},m(n,h){j(a,n,h),s(n,M,h),j(o,n,h),c=!0},p(n,h){const f={};h&2&&(f.$$scope={dirty:h,ctx:n}),a.$set(f);const g={};h&2&&(g.$$scope={dirty:h,ctx:n}),o.$set(g)},i(n){c||(b(a.$$.fragment,n),b(o.$$.fragment,n),c=!0)},o(n){J(a.$$.fragment,n),J(o.$$.fragment,n),c=!1},d(n){n&&l(M),C(a,n),C(o,n)}}}function Ze(V){let a,M,o,c,n,h,f,g,T,G='LeRobot offers multiple options for video capture, including phone cameras, built-in laptop cameras, external webcams, and Intel RealSense cameras. To efficiently record frames from most cameras, you can use either the <code>OpenCVCamera</code> or <code>RealSenseCamera</code> class. For additional compatibility details on the <code>OpenCVCamera</code> class, refer to the <a href="https://docs.opencv.org/4.x/d0/da7/videoio_overview.html" rel="nofollow">Video I/O with OpenCV Overview</a>.',E,u,v,B,ue="To instantiate a camera, you need a camera identifier. This identifier might change if you reboot your computer or re-plug your camera, a behavior mostly dependant on your operating system.",q,S,oe="To find the camera indices of the cameras plugged into your system, run the following script:",_,X,ee,Z,re="The output will look something like this if you have two cameras connected:",Q,O,te,I,ie='<p>When using Intel RealSense cameras in <code>macOS</code>, you could get this <a href="https://github.com/IntelRealSense/librealsense/issues/12307" rel="nofollow">error</a>: <code>Error finding RealSense cameras: failed to set power state</code>, this can be solved by running the same command with <code>sudo</code> permissions. Note that using RealSense cameras in <code>macOS</code> is unstable.</p>',R,D,le,k,pe="Below are two examples, demonstrating how to work with the API.",x,z,me="<li><strong>Asynchronous frame capture</strong> using an OpenCV-based camera</li> <li><strong>Color and depth capture</strong> using an Intel RealSense camera</li>",F,N,A,P,se,W,ae,Y,ce,K,H;return n=new Ue({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),f=new he({props:{title:"Cameras",local:"cameras",headingTag:"h1"}}),u=new he({props:{title:"Finding your camera",local:"finding-your-camera",headingTag:"h3"}}),X=new L({props:{code:"bGVyb2JvdC1maW5kLWNhbWVyYXMlMjBvcGVuY3YlMjAlMjMlMjBvciUyMHJlYWxzZW5zZSUyMGZvciUyMEludGVsJTIwUmVhbHNlbnNlJTIwY2FtZXJhcw==",highlighted:'lerobot-find-cameras opencv <span class="hljs-comment"># or realsense for Intel Realsense cameras</span>',wrap:!1}}),O=new L({props:{code:"LS0tJTIwRGV0ZWN0ZWQlMjBDYW1lcmFzJTIwLS0tJTBBQ2FtZXJhJTIwJTIzMCUzQSUwQSUyMCUyME5hbWUlM0ElMjBPcGVuQ1YlMjBDYW1lcmElMjAlNDAlMjAwJTBBJTIwJTIwVHlwZSUzQSUyME9wZW5DViUwQSUyMCUyMElkJTNBJTIwMCUwQSUyMCUyMEJhY2tlbmQlMjBhcGklM0ElMjBBVkZPVU5EQVRJT04lMEElMjAlMjBEZWZhdWx0JTIwc3RyZWFtJTIwcHJvZmlsZSUzQSUwQSUyMCUyMCUyMCUyMEZvcm1hdCUzQSUyMDE2LjAlMEElMjAlMjAlMjAlMjBXaWR0aCUzQSUyMDE5MjAlMEElMjAlMjAlMjAlMjBIZWlnaHQlM0ElMjAxMDgwJTBBJTIwJTIwJTIwJTIwRnBzJTNBJTIwMTUuMCUwQS0tLS0tLS0tLS0tLS0tLS0tLS0tJTBBKG1vcmUlMjBjYW1lcmFzJTIwLi4uKQ==",highlighted:`<span class="hljs-string">---</span> <span class="hljs-string">Detected</span> <span class="hljs-string">Cameras</span> <span class="hljs-string">---</span>
<span class="hljs-string">Camera</span> <span class="hljs-comment">#0:</span>
  <span class="hljs-attr">Name:</span> <span class="hljs-string">OpenCV</span> <span class="hljs-string">Camera</span> <span class="hljs-string">@</span> <span class="hljs-number">0</span>
  <span class="hljs-attr">Type:</span> <span class="hljs-string">OpenCV</span>
  <span class="hljs-attr">Id:</span> <span class="hljs-number">0</span>
  <span class="hljs-attr">Backend api:</span> <span class="hljs-string">AVFOUNDATION</span>
  <span class="hljs-attr">Default stream profile:</span>
    <span class="hljs-attr">Format:</span> <span class="hljs-number">16.0</span>
    <span class="hljs-attr">Width:</span> <span class="hljs-number">1920</span>
    <span class="hljs-attr">Height:</span> <span class="hljs-number">1080</span>
    <span class="hljs-attr">Fps:</span> <span class="hljs-number">15.0</span>
<span class="hljs-string">--------------------</span>
<span class="hljs-string">(more</span> <span class="hljs-string">cameras</span> <span class="hljs-string">...)</span>`,wrap:!1}}),D=new he({props:{title:"Use Cameras",local:"use-cameras",headingTag:"h2"}}),N=new ye({props:{id:"shell_restart",options:["Open CV Camera","Intel Realsense Camera"],$$slots:{default:[Be]},$$scope:{ctx:V}}}),P=new he({props:{title:"Use your phone",local:"use-your-phone",headingTag:"h2"}}),W=new ye({props:{id:"use phone",options:["Mac","Linux"],$$slots:{default:[Se]},$$scope:{ctx:V}}}),Y=new Te({props:{source:"https://github.com/huggingface/lerobot/blob/main/docs/source/cameras.mdx"}}),{c(){a=d("meta"),M=i(),o=d("p"),c=i(),w(n.$$.fragment),h=i(),w(f.$$.fragment),g=i(),T=d("p"),T.innerHTML=G,E=i(),w(u.$$.fragment),v=i(),B=d("p"),B.textContent=ue,q=i(),S=d("p"),S.textContent=oe,_=i(),w(X.$$.fragment),ee=i(),Z=d("p"),Z.textContent=re,Q=i(),w(O.$$.fragment),te=i(),I=d("blockquote"),I.innerHTML=ie,R=i(),w(D.$$.fragment),le=i(),k=d("p"),k.textContent=pe,x=i(),z=d("ul"),z.innerHTML=me,F=i(),w(N.$$.fragment),A=i(),w(P.$$.fragment),se=i(),w(W.$$.fragment),ae=i(),w(Y.$$.fragment),ce=i(),K=d("p"),this.h()},l(e){const r=Je("svelte-u9bgzb",document.head);a=y(r,"META",{name:!0,content:!0}),r.forEach(l),M=p(e),o=y(e,"P",{}),de(o).forEach(l),c=p(e),$(n.$$.fragment,e),h=p(e),$(f.$$.fragment,e),g=p(e),T=y(e,"P",{"data-svelte-h":!0}),U(T)!=="svelte-ddhwmd"&&(T.innerHTML=G),E=p(e),$(u.$$.fragment,e),v=p(e),B=y(e,"P",{"data-svelte-h":!0}),U(B)!=="svelte-vsxt1z"&&(B.textContent=ue),q=p(e),S=y(e,"P",{"data-svelte-h":!0}),U(S)!=="svelte-5275bn"&&(S.textContent=oe),_=p(e),$(X.$$.fragment,e),ee=p(e),Z=y(e,"P",{"data-svelte-h":!0}),U(Z)!=="svelte-kt1u1d"&&(Z.textContent=re),Q=p(e),$(O.$$.fragment,e),te=p(e),I=y(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),U(I)!=="svelte-4n7uvr"&&(I.innerHTML=ie),R=p(e),$(D.$$.fragment,e),le=p(e),k=y(e,"P",{"data-svelte-h":!0}),U(k)!=="svelte-v0skyi"&&(k.textContent=pe),x=p(e),z=y(e,"UL",{"data-svelte-h":!0}),U(z)!=="svelte-yml12n"&&(z.innerHTML=me),F=p(e),$(N.$$.fragment,e),A=p(e),$(P.$$.fragment,e),se=p(e),$(W.$$.fragment,e),ae=p(e),$(Y.$$.fragment,e),ce=p(e),K=y(e,"P",{}),de(K).forEach(l),this.h()},h(){ne(a,"name","hf:doc:metadata"),ne(a,"content",ke),ne(I,"class","warning")},m(e,r){Ce(document.head,a),s(e,M,r),s(e,o,r),s(e,c,r),j(n,e,r),s(e,h,r),j(f,e,r),s(e,g,r),s(e,T,r),s(e,E,r),j(u,e,r),s(e,v,r),s(e,B,r),s(e,q,r),s(e,S,r),s(e,_,r),j(X,e,r),s(e,ee,r),s(e,Z,r),s(e,Q,r),j(O,e,r),s(e,te,r),s(e,I,r),s(e,R,r),j(D,e,r),s(e,le,r),s(e,k,r),s(e,x,r),s(e,z,r),s(e,F,r),j(N,e,r),s(e,A,r),j(P,e,r),s(e,se,r),j(W,e,r),s(e,ae,r),j(Y,e,r),s(e,ce,r),s(e,K,r),H=!0},p(e,[r]){const t={};r&2&&(t.$$scope={dirty:r,ctx:e}),N.$set(t);const m={};r&2&&(m.$$scope={dirty:r,ctx:e}),W.$set(m)},i(e){H||(b(n.$$.fragment,e),b(f.$$.fragment,e),b(u.$$.fragment,e),b(X.$$.fragment,e),b(O.$$.fragment,e),b(D.$$.fragment,e),b(N.$$.fragment,e),b(P.$$.fragment,e),b(W.$$.fragment,e),b(Y.$$.fragment,e),H=!0)},o(e){J(n.$$.fragment,e),J(f.$$.fragment,e),J(u.$$.fragment,e),J(X.$$.fragment,e),J(O.$$.fragment,e),J(D.$$.fragment,e),J(N.$$.fragment,e),J(P.$$.fragment,e),J(W.$$.fragment,e),J(Y.$$.fragment,e),H=!1},d(e){e&&(l(M),l(o),l(c),l(h),l(g),l(T),l(E),l(v),l(B),l(q),l(S),l(_),l(ee),l(Z),l(Q),l(te),l(I),l(R),l(le),l(k),l(x),l(z),l(F),l(A),l(se),l(ae),l(ce),l(K)),l(a),C(n,e),C(f,e),C(u,e),C(X,e),C(O,e),C(D,e),C(N,e),C(P,e),C(W,e),C(Y,e)}}}const ke='{"title":"Cameras","local":"cameras","sections":[{"title":"Finding your camera","local":"finding-your-camera","sections":[],"depth":3},{"title":"Use Cameras","local":"use-cameras","sections":[],"depth":2},{"title":"Use your phone","local":"use-your-phone","sections":[],"depth":2}],"depth":1}';function Ye(V){return $e(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ee extends je{constructor(a){super(),be(this,a,Ye,Ze,we,{})}}export{Ee as component};
