import{s as Pe,o as Ke,n as Oe}from"../chunks/scheduler.eb244325.js";import{S as et,i as tt,e as c,s as r,c as T,h as lt,a as p,d as t,b as i,f as ve,g as j,j as u,k as Ee,l as M,m as s,n as J,t as b,o as $,p as I,q as xe,r as Qe}from"../chunks/index.3fe63ad3.js";import{C as at}from"../chunks/CopyLLMTxtMenu.88bde5f2.js";import{C as ge}from"../chunks/CodeBlock.934d290d.js";import{H as Ge,E as st}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.341974a5.js";import{H as qe,a as Xe}from"../chunks/HfOption.0914e9f3.js";function nt(k){let a,f;return a=new ge({props:{code:"ZnJvbSUyMGxlcm9ib3QuY2FtZXJhcy5vcGVuY3YlMjBpbXBvcnQlMjBPcGVuQ1ZDYW1lcmElMkMlMjBPcGVuQ1ZDYW1lcmFDb25maWclMEFmcm9tJTIwbGVyb2JvdC5jYW1lcmFzJTIwaW1wb3J0JTIwQ29sb3JNb2RlJTJDJTIwQ3YyUm90YXRpb24lMEElMEElMjMlMjBDb25zdHJ1Y3QlMjBhbiUyMCU2ME9wZW5DVkNhbWVyYUNvbmZpZyU2MCUyMHdpdGglMjB5b3VyJTIwZGVzaXJlZCUyMEZQUyUyQyUyMHJlc29sdXRpb24lMkMlMjBjb2xvciUyMG1vZGUlMkMlMjBhbmQlMjByb3RhdGlvbi4lMEFjb25maWclMjAlM0QlMjBPcGVuQ1ZDYW1lcmFDb25maWcoJTBBJTIwJTIwJTIwJTIwaW5kZXhfb3JfcGF0aCUzRDAlMkMlMEElMjAlMjAlMjAlMjBmcHMlM0QxNSUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNEMTkyMCUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDEwODAlMkMlMEElMjAlMjAlMjAlMjBjb2xvcl9tb2RlJTNEQ29sb3JNb2RlLlJHQiUyQyUwQSUyMCUyMCUyMCUyMHJvdGF0aW9uJTNEQ3YyUm90YXRpb24uTk9fUk9UQVRJT04lMEEpJTBBJT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CUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHByaW50KGYlMjJXYXMlMjBhJTIwbmV3JTIwZnJhbWUlMjByZWNlaXZlZCUyMGJ5JTIwdGhlJTIwY2FtZXJhJTNGJTIwJTdCbm90JTIwKGluaXRpYWxfZnJhbWUlMjAlM0QlM0QlMjBmcmFtZSkuYW55KCklN0QlMjIpJTBBJTIwJTIwJTIwJTIwZXhjZXB0JTIwVGltZW91dEVycm9yJTIwYXMlMjBlJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcHJpbnQoZiUyMkZyYW1lJTIwdG9vJTIwb2xkJTNBJTIwJTdCZSU3RCUyMiklMEE=",highlighted:`<span class="hljs-keyword">from</span> lerobot.cameras.opencv <span class="hljs-keyword">import</span> OpenCVCamera, OpenCVCameraConfig
<span class="hljs-keyword">from</span> lerobot.cameras <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>
<span class="hljs-keyword">with</span> OpenCVCamera(config) <span class="hljs-keyword">as</span> camera:

    <span class="hljs-comment"># Read a frame synchronously — blocks until hardware delivers a new frame</span>
    frame = camera.read()
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;read() call returned frame with shape:&quot;</span>, frame.shape)

    <span class="hljs-comment"># Read a frame asynchronously with a timeout — returns the latest unconsumed frame or waits up to timeout_ms for a new one</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_read call returned frame <span class="hljs-subst">{i}</span> with shape:&quot;</span>, frame.shape)
    <span class="hljs-keyword">except</span> TimeoutError <span class="hljs-keyword">as</span> e:
        <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;No frame received within timeout: <span class="hljs-subst">{e}</span>&quot;</span>)

    <span class="hljs-comment"># Instantly return a frame - returns the most recent frame captured by the camera</span>
    <span class="hljs-keyword">try</span>:
        initial_frame = camera.read_latest(max_age_ms=<span class="hljs-number">1000</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.read_latest(max_age_ms=<span class="hljs-number">1000</span>)
            <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;read_latest call returned frame <span class="hljs-subst">{i}</span> with shape:&quot;</span>, frame.shape)
            <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Was a new frame received by the camera? <span class="hljs-subst">{<span class="hljs-keyword">not</span> (initial_frame == frame).<span class="hljs-built_in">any</span>()}</span>&quot;</span>)
    <span class="hljs-keyword">except</span> TimeoutError <span class="hljs-keyword">as</span> e:
        <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Frame too old: <span class="hljs-subst">{e}</span>&quot;</span>)
`,wrap:!1}}),{c(){T(a.$$.fragment)},l(o){j(a.$$.fragment,o)},m(o,y){J(a,o,y),f=!0},p:Oe,i(o){f||(b(a.$$.fragment,o),f=!0)},o(o){$(a.$$.fragment,o),f=!1},d(o){I(a,o)}}}function ot(k){let a,f;return a=new ge({props:{code:"ZnJvbSUyMGxlcm9ib3QuY2FtZXJhcy5yZWFsc2Vuc2UlMjBpbXBvcnQlMjBSZWFsU2Vuc2VDYW1lcmElMkMlMjBSZWFsU2Vuc2VDYW1lcmFDb25maWclMEFmcm9tJTIwbGVyb2JvdC5jY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wJTIwY29sb3JfZnJhbWUlMjAlM0QlMjBjYW1lcmEucmVhZCgpJTBBJTIwJTIwJTIwJTIwZGVwdGhfbWFwJTIwJTNEJTIwY2FtZXJhLnJlYWRfZGVwdGgoKSUwQSUyMCUyMCUyMCUyMHByaW50KCUyMkNvbG9yJTIwZnJhbWUlMjBzaGFwZSUzQSUyMiUyQyUyMGNvbG9yX2ZyYW1lLnNoYXBlKSUwQSUyMCUyMCUyMCUyMHByaW50KCUyMkRlcHRoJTIwbWFwJTIwc2hhcGUlM0ElMjIlMkMlMjBkZXB0aF9tYXAuc2hhcGUpJTBBZmluYWxseSUzQSUwQSUyMCUyMCUyMCUyMGNhbWVyYS5kaXNjb25uZWN0KCk=",highlighted:`<span class="hljs-keyword">from</span> lerobot.cameras.realsense <span class="hljs-keyword">import</span> RealSenseCamera, RealSenseCameraConfig
<span class="hljs-keyword">from</span> lerobot.cameras <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(){T(a.$$.fragment)},l(o){j(a.$$.fragment,o)},m(o,y){J(a,o,y),f=!0},p:Oe,i(o){f||(b(a.$$.fragment,o),f=!0)},o(o){$(a.$$.fragment,o),f=!1},d(o){I(a,o)}}}function rt(k){let a,f,o,y;return a=new Xe({props:{id:"shell_restart",option:"Open CV Camera",$$slots:{default:[nt]},$$scope:{ctx:k}}}),o=new Xe({props:{id:"shell_restart",option:"Intel Realsense Camera",$$slots:{default:[ot]},$$scope:{ctx:k}}}),{c(){T(a.$$.fragment),f=r(),T(o.$$.fragment)},l(n){j(a.$$.fragment,n),f=i(n),j(o.$$.fragment,n)},m(n,h){J(a,n,h),s(n,f,h),J(o,n,h),y=!0},p(n,h){const C={};h&2&&(C.$$scope={dirty:h,ctx:n}),a.$set(C);const v={};h&2&&(v.$$scope={dirty:h,ctx:n}),o.$set(v)},i(n){y||(b(a.$$.fragment,n),b(o.$$.fragment,n),y=!0)},o(n){$(a.$$.fragment,n),$(o.$$.fragment,n),y=!1},d(n){n&&t(f),I(a,n),I(o,n)}}}function it(k){let a,f="To use your iPhone as a camera on macOS, enable the Continuity Camera feature:",o,y,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,C,v='For more details, visit <a href="https://support.apple.com/en-gb/guide/mac-help/mchl77879b8a/mac" rel="nofollow">Apple support</a>.';return{c(){a=c("p"),a.textContent=f,o=r(),y=c("ul"),y.innerHTML=n,h=r(),C=c("p"),C.innerHTML=v},l(m){a=p(m,"P",{"data-svelte-h":!0}),u(a)!=="svelte-gsxth1"&&(a.textContent=f),o=i(m),y=p(m,"UL",{"data-svelte-h":!0}),u(y)!=="svelte-gszkk3"&&(y.innerHTML=n),h=i(m),C=p(m,"P",{"data-svelte-h":!0}),u(C)!=="svelte-13ngf2h"&&(C.innerHTML=v)},m(m,Z){s(m,a,Z),s(m,o,Z),s(m,y,Z),s(m,h,Z),s(m,C,Z)},p:Oe,d(m){m&&(t(a),t(o),t(y),t(h),t(C))}}}function mt(k){let a,f="If you want to use your phone as a camera using OBS, follow these steps to set up a virtual camera.",o,y,n="<li><em>(Linux only) Install <code>v4l2loopback-dkms</code> and <code>v4l-utils</code></em>. These packages create virtual camera devices and verify their settings. Install with:</li>",h,C,v,m,Z,we='<p><em>Install the <a href="https://droidcam.app" rel="nofollow">DroidCam app</a> on your phone</em>. This app is available for both iOS and Android.</p>',Y,se,Ce='<p><em>Download and install <a href="https://obsproject.com" rel="nofollow">OBS Studio</a></em>.</p>',V,ne,Ue='<p><em>Download and install the <a href="https://droidcam.app/obs" rel="nofollow">DroidCam OBS plugin</a></em>.</p>',x,Q,P="<p><em>Start OBS Studio</em>.</p>",Be,A,K='<p><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> to avoid the watermarks.</p>',Ze,R,ee="<p><em>Adjust resolution settings</em>. In OBS Studio, go to <code>File &gt; Settings &gt; Video</code> or <code>OBS &gt; Preferences... &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.</p>",pe,G,_e='<p><em>Start virtual camera</em>. In OBS Studio, follow the instructions <a href="https://obsproject.com/kb/virtual-camera-guide" rel="nofollow">here</a>.</p>',Me,S,H,L="<em>Verify the virtual camera setup and resolution</em>.",Se,E,U,oe,Te="Linux",F,N,te="v4l2-ctl",de,W,We,X,le="VirtualCam",ke,O,ae="640x480",ue,z,re,je="<strong>macOS</strong>: Open Photo Booth or FaceTime and select “OBS Virtual Camera” as the input.",D,ie,Je="<strong>Windows</strong>: The native Camera app doesn’t support virtual cameras. Use a video conferencing app (Zoom, Teams) or run <code>lerobot-find-cameras opencv</code> directly to verify.",g,_,Ve="<summary><strong>Troubleshooting</strong></summary> <blockquote><p>The virtual camera resolution is incorrect.</p></blockquote> <p>Delete the virtual camera source and recreate it. The resolution cannot be changed after creation.</p> <blockquote><p>Error reading frame in background thread for OpenCVCamera(X): OpenCVCamera(X) frame width=640 or height=480 do not match configured width=1920 or height=1080.</p></blockquote> <p>This error is caused by OBS Virtual Camera advertising a <code>1920x1080</code> resolution despite rescaling. The only fix for now is to comment out the width and height check in <code>_postprocess_image()</code>.</p>",ye;return C=new ge({props:{code:"c3VkbyUyMGFwdCUyMGluc3RhbGwlMjB2NGwybG9vcGJhY2stZGttcyUyMHY0bC11dGlscw==",highlighted:"sudo apt install v4l2loopback-dkms v4l-utils",wrap:!1}}),W=new ge({props:{code:"djRsMi1jdGwlMjAtLWxpc3QtZGV2aWNlcyUyMCUyMCUyMyUyMGZpbmQlMjBWaXJ0dWFsQ2FtJTIwYW5kJTIwbm90ZSUyMGl0cyUyMCUyRmRldiUyRnZpZGVvWCUyMHBhdGglMEF2NGwyLWN0bCUyMC1kJTIwJTJGZGV2JTJGdmlkZW9YJTIwLS1nZXQtZm10LXZpZGVvJTIwJTIwJTIzJTIwcmVwbGFjZSUyMHdpdGglMjB5b3VyJTIwVmlydHVhbENhbSUyMHBhdGg=",highlighted:`v4l2-ctl --list-devices  <span class="hljs-comment"># find VirtualCam and note its /dev/videoX path</span>
v4l2-ctl -d /dev/videoX --get-fmt-video  <span class="hljs-comment"># replace with your VirtualCam path</span>`,wrap:!1}}),{c(){a=c("p"),a.textContent=f,o=r(),y=c("ol"),y.innerHTML=n,h=r(),T(C.$$.fragment),v=r(),m=c("ol"),Z=c("li"),Z.innerHTML=we,Y=r(),se=c("li"),se.innerHTML=Ce,V=r(),ne=c("li"),ne.innerHTML=Ue,x=r(),Q=c("li"),Q.innerHTML=P,Be=r(),A=c("li"),A.innerHTML=K,Ze=r(),R=c("li"),R.innerHTML=ee,pe=r(),G=c("li"),G.innerHTML=_e,Me=r(),S=c("li"),H=c("p"),H.innerHTML=L,Se=r(),E=c("ul"),U=c("li"),oe=c("strong"),oe.textContent=Te,F=xe(": Use "),N=c("code"),N.textContent=te,de=xe(` to list devices and check resolution:

	`),T(W.$$.fragment),We=xe(`
You should see `),X=c("code"),X.textContent=le,ke=xe(" listed and resolution "),O=c("code"),O.textContent=ae,ue=xe("."),z=r(),re=c("li"),re.innerHTML=je,D=r(),ie=c("li"),ie.innerHTML=Je,g=r(),_=c("details"),_.innerHTML=Ve,this.h()},l(d){a=p(d,"P",{"data-svelte-h":!0}),u(a)!=="svelte-7e77mj"&&(a.textContent=f),o=i(d),y=p(d,"OL",{"data-svelte-h":!0}),u(y)!=="svelte-lgfuvb"&&(y.innerHTML=n),h=i(d),j(C.$$.fragment,d),v=i(d),m=p(d,"OL",{start:!0});var w=ve(m);Z=p(w,"LI",{"data-svelte-h":!0}),u(Z)!=="svelte-1gbzqbz"&&(Z.innerHTML=we),Y=i(w),se=p(w,"LI",{"data-svelte-h":!0}),u(se)!=="svelte-193ps2y"&&(se.innerHTML=Ce),V=i(w),ne=p(w,"LI",{"data-svelte-h":!0}),u(ne)!=="svelte-1c8cwy4"&&(ne.innerHTML=Ue),x=i(w),Q=p(w,"LI",{"data-svelte-h":!0}),u(Q)!=="svelte-67jno"&&(Q.innerHTML=P),Be=i(w),A=p(w,"LI",{"data-svelte-h":!0}),u(A)!=="svelte-6ywpes"&&(A.innerHTML=K),Ze=i(w),R=p(w,"LI",{"data-svelte-h":!0}),u(R)!=="svelte-to8npv"&&(R.innerHTML=ee),pe=i(w),G=p(w,"LI",{"data-svelte-h":!0}),u(G)!=="svelte-a328cd"&&(G.innerHTML=_e),Me=i(w),S=p(w,"LI",{});var q=ve(S);H=p(q,"P",{"data-svelte-h":!0}),u(H)!=="svelte-13qywlv"&&(H.innerHTML=L),Se=i(q),E=p(q,"UL",{});var me=ve(E);U=p(me,"LI",{});var B=ve(U);oe=p(B,"STRONG",{"data-svelte-h":!0}),u(oe)!=="svelte-ikj55w"&&(oe.textContent=Te),F=Qe(B,": Use "),N=p(B,"CODE",{"data-svelte-h":!0}),u(N)!=="svelte-13xslqg"&&(N.textContent=te),de=Qe(B,` to list devices and check resolution:

	`),j(W.$$.fragment,B),We=Qe(B,`
You should see `),X=p(B,"CODE",{"data-svelte-h":!0}),u(X)!=="svelte-csr01y"&&(X.textContent=le),ke=Qe(B," listed and resolution "),O=p(B,"CODE",{"data-svelte-h":!0}),u(O)!=="svelte-irm8zw"&&(O.textContent=ae),ue=Qe(B,"."),B.forEach(t),z=i(me),re=p(me,"LI",{"data-svelte-h":!0}),u(re)!=="svelte-3mx2n8"&&(re.innerHTML=je),D=i(me),ie=p(me,"LI",{"data-svelte-h":!0}),u(ie)!=="svelte-1sagwz"&&(ie.innerHTML=Je),me.forEach(t),q.forEach(t),w.forEach(t),g=i(d),_=p(d,"DETAILS",{"data-svelte-h":!0}),u(_)!=="svelte-1hjyn9e"&&(_.innerHTML=Ve),this.h()},h(){Ee(m,"start","2")},m(d,w){s(d,a,w),s(d,o,w),s(d,y,w),s(d,h,w),J(C,d,w),s(d,v,w),s(d,m,w),M(m,Z),M(m,Y),M(m,se),M(m,V),M(m,ne),M(m,x),M(m,Q),M(m,Be),M(m,A),M(m,Ze),M(m,R),M(m,pe),M(m,G),M(m,Me),M(m,S),M(S,H),M(S,Se),M(S,E),M(E,U),M(U,oe),M(U,F),M(U,N),M(U,de),J(W,U,null),M(U,We),M(U,X),M(U,ke),M(U,O),M(U,ue),M(E,z),M(E,re),M(E,D),M(E,ie),s(d,g,w),s(d,_,w),ye=!0},p:Oe,i(d){ye||(b(C.$$.fragment,d),b(W.$$.fragment,d),ye=!0)},o(d){$(C.$$.fragment,d),$(W.$$.fragment,d),ye=!1},d(d){d&&(t(a),t(o),t(y),t(h),t(v),t(m),t(g),t(_)),I(C,d),I(W)}}}function ct(k){let a,f,o,y;return a=new Xe({props:{id:"use phone",option:"iPhone & macOS",$$slots:{default:[it]},$$scope:{ctx:k}}}),o=new Xe({props:{id:"use phone",option:"OBS virtual camera",$$slots:{default:[mt]},$$scope:{ctx:k}}}),{c(){T(a.$$.fragment),f=r(),T(o.$$.fragment)},l(n){j(a.$$.fragment,n),f=i(n),j(o.$$.fragment,n)},m(n,h){J(a,n,h),s(n,f,h),J(o,n,h),y=!0},p(n,h){const C={};h&2&&(C.$$scope={dirty:h,ctx:n}),a.$set(C);const v={};h&2&&(v.$$scope={dirty:h,ctx:n}),o.$set(v)},i(n){y||(b(a.$$.fragment,n),b(o.$$.fragment,n),y=!0)},o(n){$(a.$$.fragment,n),$(o.$$.fragment,n),y=!1},d(n){n&&t(f),I(a,n),I(o,n)}}}function pt(k){let a,f,o,y,n,h,C,v,m,Z="LeRobot offers multiple options for video capture:",we,Y,se="<thead><tr><th>Class</th> <th>Supported Cameras</th></tr></thead> <tbody><tr><td><code>OpenCVCamera</code></td> <td>Phone, built-in laptop, USB webcams</td></tr> <tr><td><code>ZMQCamera</code></td> <td>Network-connected cameras</td></tr> <tr><td><code>RealSenseCamera</code></td> <td>Intel RealSense (with depth)</td></tr> <tr><td><code>Reachy2Camera</code></td> <td>Reachy 2 robot cameras</td></tr></tbody>",Ce,V,ne='<p>For <code>OpenCVCamera</code> compatibility details, see the <a href="https://docs.opencv.org/4.x/d0/da7/videoio_overview.html" rel="nofollow">Video I/O with OpenCV Overview</a>.</p>',Ue,x,Q,P,Be="Every camera requires a unique identifier to be instantiated, allowing you to distinguish between multiple connected devices.",A,K,Ze="<code>OpenCVCamera</code> and <code>RealSenseCamera</code> support auto-discovery. Run the command below to list available devices and their identifiers. Note that these identifiers may change after rebooting your computer or re-plugging the camera, depending on your operating system.",R,ee,pe,G,_e="The output will look something like this if you have two cameras connected:",Me,S,H,L,Se='<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>',E,U,oe="<code>ZMQCamera</code> and <code>Reachy2Camera</code> do not support auto-discovery. They must be configured manually by providing their network address and port or robot SDK settings.",Te,F,N,te,de,W,We="All camera classes implement three access modes for capturing frames:",X,le,ke="<thead><tr><th>Method</th> <th>Behavior</th> <th>Blocks?</th> <th>Best For</th></tr></thead> <tbody><tr><td><code>read()</code></td> <td>Waits for the camera hardware to return a frame. May block for a long time depending on the camera and SDK.</td> <td>Yes</td> <td>Simple scripts, sequential capture</td></tr> <tr><td><code>async_read(timeout_ms)</code></td> <td>Returns the latest unconsumed frame from background thread. Blocks only if buffer is empty, up to <code>timeout_ms</code>. Raises <code>TimeoutError</code> if no frame arrives.</td> <td>With a timeout</td> <td>Control loops synchronized to camera FPS</td></tr> <tr><td><code>read_latest(max_age_ms)</code></td> <td>Peeks at the most recent frame in buffer (may be stale). Raises <code>TimeoutError</code> if frame is older than <code>max_age_ms</code>.</td> <td>No</td> <td>UI visualization, logging, monitoring</td></tr></tbody>",O,ae,ue,z,re="The following examples show how to use the camera API to configure and capture frames from different camera types.",je,D,ie="<li><strong>Blocking and non-blocking frame capture</strong> using an OpenCV-based camera</li> <li><strong>Color and depth capture</strong> using an Intel RealSense camera</li>",Je,g,_,Ve="Failing to cleanly disconnect cameras can cause resource leaks. Use the context manager protocol to ensure automatic cleanup:",ye,d,w,q,me="You can also call <code>connect()</code> and <code>disconnect()</code> manually, but always use a <code>finally</code> block for the latter.",B,he,Ae,be,Re,fe,He,$e,ze="If everything is set up correctly, your phone will appear as a standard OpenCV camera and can be used with <code>OpenCVCamera</code>.",Le,Ie,Fe,Ye,Ne;return n=new at({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),C=new Ge({props:{title:"Cameras",local:"cameras",headingTag:"h1"}}),x=new Ge({props:{title:"Find your camera",local:"find-your-camera",headingTag:"h3"}}),ee=new ge({props:{code:"bGVyb2JvdC1maW5kLWNhbWVyYXMlMjBvcGVuY3YlMjAlMjMlMjBvciUyMHJlYWxzZW5zZSUyMGZvciUyMEludGVsJTIwUmVhbHNlbnNlJTIwY2FtZXJhcw==",highlighted:'lerobot-find-cameras opencv <span class="hljs-comment"># or realsense for Intel Realsense cameras</span>',wrap:!1}}),S=new ge({props:{code:"LS0tJTIwRGV0ZWN0ZWQlMjBDYW1lcmFzJTIwLS0tJTBBQ2FtZXJhJTIwJTIzMCUzQSUwQSUyMCUyME5hbWUlM0ElMjBPcGVuQ1YlMjBDYW1lcmElMjAlNDAlMjAwJTBBJTIwJTIwVHlwZSUzQSUyME9wZW5DViUwQSUyMCUyMElkJTNBJTIwMCUwQSUyMCUyMEJhY2tlbmQlMjBhcGklM0ElMjBBVkZPVU5EQVRJT04lMEElMjAlMjBEZWZhdWx0JTIwc3RyZWFtJTIwcHJvZmlsZSUzQSUwQSUyMCUyMCUyMCUyMEZvcm1hdCUzQSUyMDE2LjAlMEElMjAlMjAlMjAlMjBXaWR0aCUzQSUyMDE5MjAlMEElMjAlMjAlMjAlMjBIZWlnaHQlM0ElMjAxMDgwJTBBJTIwJTIwJTIwJTIwRnBzJTNBJTIwMTUuMCUwQS0tLS0tLS0tLS0tLS0tLS0tLS0tJTBBKG1vcmUlMjBjYW1lcmFzJTIwLi4uKQ==",highlighted:`--- Detected Cameras ---
Camera <span class="hljs-comment">#0:</span>
  Name: OpenCV Camera @ 0
  Type: OpenCV
  Id: 0
  Backend api: AVFOUNDATION
  Default stream profile:
    Format: 16.0
    Width: 1920
    Height: 1080
    Fps: 15.0
--------------------
(more cameras ...)`,wrap:!1}}),F=new Ge({props:{title:"Use cameras",local:"use-cameras",headingTag:"h2"}}),te=new Ge({props:{title:"Frame access modes",local:"frame-access-modes",headingTag:"h3"}}),ae=new Ge({props:{title:"Usage examples",local:"usage-examples",headingTag:"h3"}}),d=new ge({props:{code:"d2l0aCUyME9wZW5DVkNhbWVyYShjb25maWcpJTIwYXMlMjBjYW1lcmElM0ElMEElMjAlMjAlMjAlMjAuLi4=",highlighted:`<span class="hljs-keyword">with</span> OpenCVCamera(config) <span class="hljs-keyword">as</span> camera:
    ...`,wrap:!1}}),he=new qe({props:{id:"shell_restart",options:["Open CV Camera","Intel Realsense Camera"],$$slots:{default:[rt]},$$scope:{ctx:k}}}),be=new Ge({props:{title:"Use your phone’s camera",local:"use-your-phones-camera",headingTag:"h2"}}),fe=new qe({props:{id:"use phone",options:["iPhone & macOS","OBS virtual camera"],$$slots:{default:[ct]},$$scope:{ctx:k}}}),Ie=new st({props:{source:"https://github.com/huggingface/lerobot/blob/main/docs/source/cameras.mdx"}}),{c(){a=c("meta"),f=r(),o=c("p"),y=r(),T(n.$$.fragment),h=r(),T(C.$$.fragment),v=r(),m=c("p"),m.textContent=Z,we=r(),Y=c("table"),Y.innerHTML=se,Ce=r(),V=c("blockquote"),V.innerHTML=ne,Ue=r(),T(x.$$.fragment),Q=r(),P=c("p"),P.textContent=Be,A=r(),K=c("p"),K.innerHTML=Ze,R=r(),T(ee.$$.fragment),pe=r(),G=c("p"),G.textContent=_e,Me=r(),T(S.$$.fragment),H=r(),L=c("blockquote"),L.innerHTML=Se,E=r(),U=c("p"),U.innerHTML=oe,Te=r(),T(F.$$.fragment),N=r(),T(te.$$.fragment),de=r(),W=c("p"),W.textContent=We,X=r(),le=c("table"),le.innerHTML=ke,O=r(),T(ae.$$.fragment),ue=r(),z=c("p"),z.textContent=re,je=r(),D=c("ul"),D.innerHTML=ie,Je=r(),g=c("blockquote"),_=c("p"),_.textContent=Ve,ye=r(),T(d.$$.fragment),w=r(),q=c("p"),q.innerHTML=me,B=r(),T(he.$$.fragment),Ae=r(),T(be.$$.fragment),Re=r(),T(fe.$$.fragment),He=r(),$e=c("p"),$e.innerHTML=ze,Le=r(),T(Ie.$$.fragment),Fe=r(),Ye=c("p"),this.h()},l(e){const l=lt("svelte-u9bgzb",document.head);a=p(l,"META",{name:!0,content:!0}),l.forEach(t),f=i(e),o=p(e,"P",{}),ve(o).forEach(t),y=i(e),j(n.$$.fragment,e),h=i(e),j(C.$$.fragment,e),v=i(e),m=p(e,"P",{"data-svelte-h":!0}),u(m)!=="svelte-khwfeu"&&(m.textContent=Z),we=i(e),Y=p(e,"TABLE",{"data-svelte-h":!0}),u(Y)!=="svelte-1w9g3e6"&&(Y.innerHTML=se),Ce=i(e),V=p(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),u(V)!=="svelte-1qx2dx"&&(V.innerHTML=ne),Ue=i(e),j(x.$$.fragment,e),Q=i(e),P=p(e,"P",{"data-svelte-h":!0}),u(P)!=="svelte-7o0iob"&&(P.textContent=Be),A=i(e),K=p(e,"P",{"data-svelte-h":!0}),u(K)!=="svelte-uv8iej"&&(K.innerHTML=Ze),R=i(e),j(ee.$$.fragment,e),pe=i(e),G=p(e,"P",{"data-svelte-h":!0}),u(G)!=="svelte-kt1u1d"&&(G.textContent=_e),Me=i(e),j(S.$$.fragment,e),H=i(e),L=p(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),u(L)!=="svelte-4n7uvr"&&(L.innerHTML=Se),E=i(e),U=p(e,"P",{"data-svelte-h":!0}),u(U)!=="svelte-1iwe0wi"&&(U.innerHTML=oe),Te=i(e),j(F.$$.fragment,e),N=i(e),j(te.$$.fragment,e),de=i(e),W=p(e,"P",{"data-svelte-h":!0}),u(W)!=="svelte-8ms7ed"&&(W.textContent=We),X=i(e),le=p(e,"TABLE",{"data-svelte-h":!0}),u(le)!=="svelte-1fwyhml"&&(le.innerHTML=ke),O=i(e),j(ae.$$.fragment,e),ue=i(e),z=p(e,"P",{"data-svelte-h":!0}),u(z)!=="svelte-u2wp35"&&(z.textContent=re),je=i(e),D=p(e,"UL",{"data-svelte-h":!0}),u(D)!=="svelte-1qfbamo"&&(D.innerHTML=ie),Je=i(e),g=p(e,"BLOCKQUOTE",{class:!0});var ce=ve(g);_=p(ce,"P",{"data-svelte-h":!0}),u(_)!=="svelte-f697lg"&&(_.textContent=Ve),ye=i(ce),j(d.$$.fragment,ce),w=i(ce),q=p(ce,"P",{"data-svelte-h":!0}),u(q)!=="svelte-1ne9a7f"&&(q.innerHTML=me),ce.forEach(t),B=i(e),j(he.$$.fragment,e),Ae=i(e),j(be.$$.fragment,e),Re=i(e),j(fe.$$.fragment,e),He=i(e),$e=p(e,"P",{"data-svelte-h":!0}),u($e)!=="svelte-86xsbg"&&($e.innerHTML=ze),Le=i(e),j(Ie.$$.fragment,e),Fe=i(e),Ye=p(e,"P",{}),ve(Ye).forEach(t),this.h()},h(){Ee(a,"name","hf:doc:metadata"),Ee(a,"content",Mt),Ee(V,"class","tip"),Ee(L,"class","warning"),Ee(g,"class","warning")},m(e,l){M(document.head,a),s(e,f,l),s(e,o,l),s(e,y,l),J(n,e,l),s(e,h,l),J(C,e,l),s(e,v,l),s(e,m,l),s(e,we,l),s(e,Y,l),s(e,Ce,l),s(e,V,l),s(e,Ue,l),J(x,e,l),s(e,Q,l),s(e,P,l),s(e,A,l),s(e,K,l),s(e,R,l),J(ee,e,l),s(e,pe,l),s(e,G,l),s(e,Me,l),J(S,e,l),s(e,H,l),s(e,L,l),s(e,E,l),s(e,U,l),s(e,Te,l),J(F,e,l),s(e,N,l),J(te,e,l),s(e,de,l),s(e,W,l),s(e,X,l),s(e,le,l),s(e,O,l),J(ae,e,l),s(e,ue,l),s(e,z,l),s(e,je,l),s(e,D,l),s(e,Je,l),s(e,g,l),M(g,_),M(g,ye),J(d,g,null),M(g,w),M(g,q),s(e,B,l),J(he,e,l),s(e,Ae,l),J(be,e,l),s(e,Re,l),J(fe,e,l),s(e,He,l),s(e,$e,l),s(e,Le,l),J(Ie,e,l),s(e,Fe,l),s(e,Ye,l),Ne=!0},p(e,[l]){const ce={};l&2&&(ce.$$scope={dirty:l,ctx:e}),he.$set(ce);const De={};l&2&&(De.$$scope={dirty:l,ctx:e}),fe.$set(De)},i(e){Ne||(b(n.$$.fragment,e),b(C.$$.fragment,e),b(x.$$.fragment,e),b(ee.$$.fragment,e),b(S.$$.fragment,e),b(F.$$.fragment,e),b(te.$$.fragment,e),b(ae.$$.fragment,e),b(d.$$.fragment,e),b(he.$$.fragment,e),b(be.$$.fragment,e),b(fe.$$.fragment,e),b(Ie.$$.fragment,e),Ne=!0)},o(e){$(n.$$.fragment,e),$(C.$$.fragment,e),$(x.$$.fragment,e),$(ee.$$.fragment,e),$(S.$$.fragment,e),$(F.$$.fragment,e),$(te.$$.fragment,e),$(ae.$$.fragment,e),$(d.$$.fragment,e),$(he.$$.fragment,e),$(be.$$.fragment,e),$(fe.$$.fragment,e),$(Ie.$$.fragment,e),Ne=!1},d(e){e&&(t(f),t(o),t(y),t(h),t(v),t(m),t(we),t(Y),t(Ce),t(V),t(Ue),t(Q),t(P),t(A),t(K),t(R),t(pe),t(G),t(Me),t(H),t(L),t(E),t(U),t(Te),t(N),t(de),t(W),t(X),t(le),t(O),t(ue),t(z),t(je),t(D),t(Je),t(g),t(B),t(Ae),t(Re),t(He),t($e),t(Le),t(Fe),t(Ye)),t(a),I(n,e),I(C,e),I(x,e),I(ee,e),I(S,e),I(F,e),I(te,e),I(ae,e),I(d),I(he,e),I(be,e),I(fe,e),I(Ie,e)}}}const Mt='{"title":"Cameras","local":"cameras","sections":[{"title":"Find your camera","local":"find-your-camera","sections":[],"depth":3},{"title":"Use cameras","local":"use-cameras","sections":[{"title":"Frame access modes","local":"frame-access-modes","sections":[],"depth":3},{"title":"Usage examples","local":"usage-examples","sections":[],"depth":3}],"depth":2},{"title":"Use your phone’s camera","local":"use-your-phones-camera","sections":[],"depth":2}],"depth":1}';function dt(k){return Ke(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ut extends et{constructor(a){super(),tt(this,a,dt,pt,Pe,{})}}export{Ut as component};
