feat: load v_shape from the profile YAML, add the dock measuring guide

Read v_shape per profile and fail loud on an unknown value. The start log now prints the loaded v_shape so it can be checked without opening the YAML on the robot. Add doc/MEASURE_AND_CONFIGURE.md with figures and link it from the README.
This commit is contained in:
2026-10-27 13:09:30 +07:00
parent cc1ea74445
commit 5bbcf37f1d
10 changed files with 844 additions and 2 deletions

42
doc/fig/arc_measure.svg Normal file
View File

@@ -0,0 +1,42 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 340" width="640" height="340">
<style>
text { font-family: "DejaVu Sans", Arial, sans-serif; font-size: 13px; fill: #1b2733; }
.m { font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 12.5px; }
.mu { fill: #5a6b74; font-size: 12px; }
.dt { fill: #0a7684; }
.halo { paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
.cradle { stroke: #d27a24; stroke-width: 10; fill: none; stroke-linecap: round; }
.dim { stroke: #0a7684; stroke-width: 1.4; fill: none; }
.chord { stroke: #0a7684; stroke-width: 1.6; stroke-dasharray: 6 4; fill: none; }
.rad { stroke: #5a6b74; stroke-width: 1.1; stroke-dasharray: 8 4; fill: none; }
.dot { fill: #0a7684; }
.lidar { fill: #42535e; }
</style>
<defs>
<marker id="a" viewBox="0 0 10 10" refX="9.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M0 1 L10 5 L0 9 z" fill="#0a7684"/>
</marker>
</defs>
<rect width="640" height="340" fill="#ffffff"/>
<text x="320" y="28" text-anchor="middle" class="mu">phía tường, sau máng</text>
<!-- máng cong, tâm đường tròn nằm phía robot -->
<path d="M 151.47 158.58 A 220 220 0 0 1 488.53 158.58" class="cradle"/>
<line x1="151.47" y1="158.58" x2="488.53" y2="158.58" class="chord" marker-start="url(#a)" marker-end="url(#a)"/>
<text x="320" y="178" text-anchor="middle" class="m dt halo">c (dây cung)</text>
<line x1="320" y1="158.58" x2="320" y2="85" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
<text x="330" y="126" class="m dt halo">s (độ võng)</text>
<circle cx="320" cy="300" r="4" class="dot"/>
<text x="330" y="318" class="mu">tâm đường tròn (phía robot)</text>
<line x1="320" y1="300" x2="484.5" y2="162" class="rad"/>
<text x="420" y="246" text-anchor="middle" transform="rotate(-40 420 246)" class="m dt halo">arc_radius</text>
<line x1="320" y1="300" x2="155.5" y2="162" class="rad"/>
<path d="M 289.36 274.29 A 40 40 0 0 1 350.64 274.29" class="dim"/>
<text x="320" y="252" text-anchor="middle" class="m dt halo">arc_span</text>
<rect x="306" y="326" width="28" height="12" rx="3" class="lidar"/>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

65
doc/fig/dock_geometry.svg Normal file
View File

@@ -0,0 +1,65 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 610" width="640" height="610">
<style>
text { font-family: "DejaVu Sans", Arial, sans-serif; font-size: 13px; fill: #1b2733; }
.m { font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 12.5px; }
.mu { fill: #5a6b74; font-size: 12px; }
.dt { fill: #0a7684; }
.halo { paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
.wing { stroke: #d27a24; stroke-linecap: round; fill: none; }
.dim { stroke: #0a7684; stroke-width: 1.4; fill: none; }
.ext { stroke: #0a7684; stroke-width: .8; stroke-dasharray: 3 3; opacity: .75; }
.axis { stroke: #5a6b74; stroke-width: 1; stroke-dasharray: 10 4 2 4; fill: none; }
.robot { fill: none; stroke: #42535e; stroke-width: 1.6; }
.rs { fill: #42535e; opacity: .07; }
.lidar { fill: #42535e; }
</style>
<defs>
<marker id="a" viewBox="0 0 10 10" refX="9.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M0 1 L10 5 L0 9 z" fill="#0a7684"/>
</marker>
</defs>
<rect width="640" height="610" fill="#ffffff"/>
<text x="320" y="32" text-anchor="middle" class="mu">phía tường, sau trạm</text>
<line x1="320" y1="128" x2="320" y2="604" class="axis"/>
<text x="328" y="600" class="mu">phân giác</text>
<line x1="320" y1="210" x2="210.4" y2="100.4" class="wing" stroke-width="8"/>
<line x1="320" y1="210" x2="429.6" y2="100.4" class="wing" stroke-width="8"/>
<path d="M 288.18 178.18 A 45 45 0 0 1 351.82 178.18" class="dim"/>
<text x="320" y="142" text-anchor="middle" class="m dt halo">vertex_angle</text>
<text x="320" y="158" text-anchor="middle" class="dt halo">θ</text>
<line x1="322.8" y1="212.8" x2="345.5" y2="235.5" class="ext"/>
<line x1="432.4" y1="103.2" x2="455.1" y2="125.9" class="ext"/>
<line x1="341.2" y1="231.2" x2="450.8" y2="121.6" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
<text x="407" y="187" text-anchor="middle" transform="rotate(-45 407 187)" class="m dt halo">wing_length</text>
<text x="530" y="66" text-anchor="middle" class="mu">ví dụ: V lồi, đỉnh chĩa về robot</text>
<rect x="147.5" y="247.5" width="345" height="325" rx="10" class="rs"/>
<rect x="147.5" y="247.5" width="345" height="325" rx="10" class="robot"/>
<text x="320" y="548" text-anchor="middle" class="mu">robot đang ở vị trí sạc (nhìn từ trên)</text>
<rect x="307" y="249" width="26" height="16" rx="3" class="lidar"/>
<text x="342" y="266" class="mu">cảm biến (frame của scan_topic)</text>
<line x1="305" y1="410" x2="335" y2="410" class="dim"/>
<line x1="320" y1="395" x2="320" y2="425" class="dim"/>
<circle cx="320" cy="410" r="5" class="dim"/>
<text x="342" y="414" class="m">base_link</text>
<line x1="330" y1="210" x2="568" y2="210" class="ext"/>
<line x1="340" y1="410" x2="568" y2="410" class="ext"/>
<line x1="560" y1="210" x2="560" y2="410" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
<text x="578" y="310" text-anchor="middle" transform="rotate(90 578 310)" class="m dt halo">offset_x</text>
<line x1="300" y1="210" x2="124" y2="210" class="ext"/>
<line x1="307" y1="257" x2="124" y2="257" class="ext"/>
<line x1="132" y1="210" x2="132" y2="257" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
<text x="124" y="248" text-anchor="end" class="m dt halo">d_sensor</text>
<text x="124" y="232" text-anchor="end" class="mu halo">đỉnh → cảm biến</text>
<line x1="305" y1="410" x2="124" y2="410" class="ext"/>
<line x1="132" y1="257" x2="132" y2="410" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
<text x="124" y="324" text-anchor="end" class="m dt halo">s_x</text>
<text x="124" y="340" text-anchor="end" class="mu halo">TF base_link</text>
<text x="124" y="354" text-anchor="end" class="mu halo">→ cảm biến</text>
</svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -0,0 +1,79 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 500" width="640" height="500">
<style>
text { font-family: "DejaVu Sans", Arial, sans-serif; font-size: 13px; fill: #1b2733; }
.m { font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 12.5px; }
.mu { fill: #5a6b74; font-size: 12px; }
.dt { fill: #0a7684; }
.halo { paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
.faceL { fill: #e9a25f; stroke: #b9611a; stroke-width: 1.2; }
.faceR { fill: #d27a24; stroke: #b9611a; stroke-width: 1.2; }
.tape { fill: url(#h); stroke: #5d6b73; stroke-width: 1.2; }
.floor { fill: #eef2f3; stroke: #c7d2d7; stroke-width: 1; }
.scanline { stroke: #0a7684; stroke-width: 1.6; stroke-dasharray: 7 4; fill: none; }
.ray { stroke: #0a7684; stroke-width: 1.1; stroke-dasharray: 4 3; opacity: .8; }
.dim { stroke: #0a7684; stroke-width: 1.4; fill: none; }
.ext { stroke: #0a7684; stroke-width: .8; stroke-dasharray: 3 3; opacity: .75; }
.leader { stroke: #5a6b74; stroke-width: .9; fill: none; }
.lidar { fill: #42535e; }
.robot { fill: #42535e; opacity: .10; stroke: #42535e; stroke-width: 1.2; }
</style>
<defs>
<pattern id="h" width="5" height="5" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
<rect width="5" height="5" fill="#f4f7f8"/>
<line x1="0" y1="0" x2="0" y2="5" stroke="#7d8b93" stroke-width="1.4"/>
</pattern>
<marker id="a" viewBox="0 0 10 10" refX="9.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M0 1 L10 5 L0 9 z" fill="#0a7684"/>
</marker>
</defs>
<rect width="640" height="500" fill="#ffffff"/>
<!-- sàn -->
<polygon points="40,330 300,410 600,380 600,300 340,240 40,280" class="floor"/>
<text x="80" y="340" class="mu">sàn</text>
<!-- hai mặt ngoài của trạm V lồi, đỉnh chĩa về phía người xem / robot -->
<polygon points="300,360 129.2,314 129.2,44 300,90" class="faceL"/>
<polygon points="300,360 392,314 392,44 300,90" class="faceR"/>
<!-- vết mặt phẳng quét trên hai mặt -->
<line x1="300" y1="210" x2="129.2" y2="164" class="scanline"/>
<line x1="300" y1="210" x2="392" y2="164" class="scanline"/>
<!-- hai dải phản quang, tâm ở giữa cánh, phủ mặt phẳng quét -->
<polygon points="247.6,225.9 181.4,208.1 181.4,148.1 247.6,165.9" class="tape"/>
<polygon points="328.2,225.9 363.8,208.1 363.8,148.1 328.2,165.9" class="tape"/>
<!-- robot (một phần) và cảm biến -->
<polygon points="360,470 470,500 640,470 640,410 520,384 380,414" class="robot"/>
<rect x="380" y="404" width="22" height="16" rx="3" class="lidar"/>
<line x1="391" y1="410" x2="214.5" y2="187" class="ray"/>
<line x1="391" y1="410" x2="346" y2="187" class="ray"/>
<text x="410" y="446" class="mu">robot, cảm biến ở độ cao h_sensor</text>
<!-- chú thích -->
<line x1="150" y1="108" x2="200" y2="160" class="leader"/>
<text x="150" y="102" text-anchor="middle">dải trái</text>
<line x1="470" y1="156" x2="358" y2="170" class="leader"/>
<text x="530" y="148" text-anchor="middle">dải phải</text>
<text x="530" y="166" text-anchor="middle" class="mu">mặt ngoài, mỗi cánh 1 dải</text>
<text x="300" y="380" text-anchor="middle" class="mu">đỉnh (cạnh đứng gần robot nhất)</text>
<line x1="129.2" y1="164" x2="62" y2="164" class="ext"/>
<line x1="129.2" y1="314" x2="62" y2="314" class="ext"/>
<line x1="70" y1="314" x2="70" y2="164" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
<text x="58" y="244" text-anchor="middle" transform="rotate(-90 58 244)" class="m dt halo">h_sensor</text>
<line x1="181.4" y1="148.1" x2="164" y2="148.1" class="ext"/>
<line x1="181.4" y1="208.1" x2="164" y2="208.1" class="ext"/>
<line x1="170" y1="148.1" x2="170" y2="208.1" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
<text x="158" y="183" text-anchor="end" class="dt halo">≥ 10 cm</text>
<line x1="300" y1="90" x2="300" y2="68" class="ext"/>
<line x1="392" y1="44" x2="392" y2="22" class="ext"/>
<line x1="300" y1="74" x2="392" y2="28" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
<text x="350" y="44" text-anchor="middle" transform="rotate(-26.6 350 44)" class="m dt halo">wing_length</text>
<text x="510" y="262" text-anchor="middle" class="mu">nét đứt trên mặt cánh:</text>
<text x="510" y="278" text-anchor="middle" class="mu">nơi mặt phẳng quét cắt qua</text>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

48
doc/fig/dock_shape.svg Normal file
View File

@@ -0,0 +1,48 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 236" width="640" height="236">
<style>
text { font-family: "DejaVu Sans", Arial, sans-serif; font-size: 13px; fill: #1b2733; }
.mu { fill: #5a6b74; font-size: 12px; }
.halo { paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
.wt { fill: #b9611a; font-weight: bold; }
.wing { stroke: #d27a24; stroke-linecap: round; fill: none; }
.tape { fill: url(#h); stroke: #7d8b93; stroke-width: 1; }
.fan { stroke: #0a7684; stroke-width: .9; opacity: .6; }
.robot { fill: none; stroke: #42535e; stroke-width: 1.6; }
.lidar { fill: #42535e; }
.divider { stroke: #c7d2d7; stroke-width: 1; }
</style>
<defs>
<pattern id="h" width="6" height="6" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
<rect width="6" height="6" fill="#dfe5e8"/>
<line x1="0" y1="0" x2="0" y2="6" stroke="#7d8b93" stroke-width="1.6"/>
</pattern>
</defs>
<rect width="640" height="236" fill="#ffffff"/>
<line x1="320" y1="36" x2="320" y2="226" class="divider"/>
<text x="160" y="24" text-anchor="middle" class="wt">V lồi — v_shape: convex</text>
<text x="480" y="24" text-anchor="middle" class="wt">V lõm — v_shape: concave</text>
<line x1="160" y1="150" x2="86" y2="76" class="wing" stroke-width="8"/>
<line x1="160" y1="150" x2="234" y2="76" class="wing" stroke-width="8"/>
<polygon points="133.13,128.79 107.67,103.33 104.14,106.86 129.6,132.32" class="tape"/>
<polygon points="186.87,128.79 212.33,103.33 215.86,106.86 190.4,132.32" class="tape"/>
<line x1="160" y1="185" x2="118" y2="119" class="fan"/>
<line x1="160" y1="185" x2="202" y2="119" class="fan"/>
<rect x="120" y="185" width="80" height="26" rx="4" class="robot"/>
<circle cx="160" cy="187" r="4" class="lidar"/>
<text x="160" y="203" text-anchor="middle" class="mu">robot</text>
<text x="160" y="172" text-anchor="middle" class="mu halo">đỉnh gần robot nhất</text>
<text x="160" y="230" text-anchor="middle">dải dán MẶT NGOÀI</text>
<line x1="480" y1="70" x2="406" y2="144" class="wing" stroke-width="8"/>
<line x1="480" y1="70" x2="554" y2="144" class="wing" stroke-width="8"/>
<polygon points="458.79,96.87 433.33,122.33 436.86,125.86 462.32,100.4" class="tape"/>
<polygon points="501.21,96.87 526.67,122.33 523.14,125.86 497.68,100.4" class="tape"/>
<line x1="480" y1="185" x2="448" y2="112" class="fan"/>
<line x1="480" y1="185" x2="512" y2="112" class="fan"/>
<rect x="440" y="185" width="80" height="26" rx="4" class="robot"/>
<circle cx="480" cy="187" r="4" class="lidar"/>
<text x="480" y="203" text-anchor="middle" class="mu">robot</text>
<text x="480" y="172" text-anchor="middle" class="mu halo">mút cánh gần robot</text>
<text x="480" y="230" text-anchor="middle">dải dán MẶT TRONG</text>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -0,0 +1,113 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 330" width="640" height="330">
<style>
text { font-family: "DejaVu Sans", Arial, sans-serif; font-size: 13px; fill: #1b2733; }
.m { font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 12.5px; }
.mu { fill: #5a6b74; font-size: 12px; }
.dt { fill: #0a7684; }
.wr { fill: #b0451a; }
.halo { paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
.grid { stroke: #e3e8ea; stroke-width: 1; }
.axis { stroke: #5a6b74; stroke-width: 1.2; }
.bar-bg { fill: #c3ccd1; }
.bar-wing { fill: #e9a25f; }
.bar-tape { fill: #7d8b93; }
.lvl { stroke: #5a6b74; stroke-width: 1.1; stroke-dasharray: 5 4; }
.thr { stroke: #0a7684; stroke-width: 2; }
.brk { stroke: #5a6b74; stroke-width: 1; fill: none; }
</style>
<rect width="640" height="330" fill="#ffffff"/>
<line x1="70" y1="250.0" x2="600" y2="250.0" class="grid"/>
<text x="64" y="254.0" text-anchor="end" class="mu">0</text>
<line x1="70" y1="197.5" x2="600" y2="197.5" class="grid"/>
<text x="64" y="201.5" text-anchor="end" class="mu">250</text>
<line x1="70" y1="145.0" x2="600" y2="145.0" class="grid"/>
<text x="64" y="149.0" text-anchor="end" class="mu">500</text>
<line x1="70" y1="92.5" x2="600" y2="92.5" class="grid"/>
<text x="64" y="96.5" text-anchor="end" class="mu">750</text>
<line x1="70" y1="40.0" x2="600" y2="40.0" class="grid"/>
<text x="64" y="44.0" text-anchor="end" class="mu">1000</text>
<rect x="71.0" y="235.3" width="6.8" height="14.7" class="bar-bg"/>
<rect x="79.8" y="232.2" width="6.8" height="17.8" class="bar-bg"/>
<rect x="88.7" y="237.4" width="6.8" height="12.6" class="bar-bg"/>
<rect x="97.5" y="230.1" width="6.8" height="19.9" class="bar-bg"/>
<rect x="106.3" y="226.9" width="6.8" height="23.1" class="bar-bg"/>
<rect x="115.2" y="233.2" width="6.8" height="16.8" class="bar-bg"/>
<rect x="124.0" y="234.2" width="6.8" height="15.8" class="bar-bg"/>
<rect x="132.8" y="231.1" width="6.8" height="18.9" class="bar-bg"/>
<rect x="141.7" y="218.5" width="6.8" height="31.5" class="bar-wing"/>
<rect x="150.5" y="215.3" width="6.8" height="34.7" class="bar-wing"/>
<rect x="159.3" y="212.2" width="6.8" height="37.8" class="bar-wing"/>
<rect x="168.2" y="210.1" width="6.8" height="39.9" class="bar-wing"/>
<rect x="177.0" y="213.2" width="6.8" height="36.8" class="bar-wing"/>
<rect x="185.8" y="206.9" width="6.8" height="43.1" class="bar-wing"/>
<rect x="194.7" y="69.4" width="6.8" height="180.6" class="bar-tape"/>
<rect x="203.5" y="58.9" width="6.8" height="191.1" class="bar-tape"/>
<rect x="212.3" y="52.6" width="6.8" height="197.4" class="bar-tape"/>
<rect x="221.2" y="49.4" width="6.8" height="200.6" class="bar-tape"/>
<rect x="230.0" y="54.7" width="6.8" height="195.3" class="bar-tape"/>
<rect x="238.8" y="50.5" width="6.8" height="199.5" class="bar-tape"/>
<rect x="247.7" y="61.0" width="6.8" height="189.0" class="bar-tape"/>
<rect x="256.5" y="67.3" width="6.8" height="182.7" class="bar-tape"/>
<rect x="265.3" y="208.0" width="6.8" height="42.0" class="bar-wing"/>
<rect x="274.2" y="211.2" width="6.8" height="38.8" class="bar-wing"/>
<rect x="283.0" y="214.3" width="6.8" height="35.7" class="bar-wing"/>
<rect x="291.8" y="216.4" width="6.8" height="33.6" class="bar-wing"/>
<rect x="300.7" y="212.2" width="6.8" height="37.8" class="bar-wing"/>
<rect x="309.5" y="218.5" width="6.8" height="31.5" class="bar-wing"/>
<rect x="318.3" y="210.1" width="6.8" height="39.9" class="bar-wing"/>
<rect x="327.2" y="205.9" width="6.8" height="44.1" class="bar-wing"/>
<rect x="336.0" y="209.1" width="6.8" height="40.9" class="bar-wing"/>
<rect x="344.8" y="211.2" width="6.8" height="38.8" class="bar-wing"/>
<rect x="353.7" y="217.4" width="6.8" height="32.6" class="bar-wing"/>
<rect x="362.5" y="213.2" width="6.8" height="36.8" class="bar-wing"/>
<rect x="371.3" y="210.1" width="6.8" height="39.9" class="bar-wing"/>
<rect x="380.2" y="208.0" width="6.8" height="42.0" class="bar-wing"/>
<rect x="389.0" y="212.2" width="6.8" height="37.8" class="bar-wing"/>
<rect x="397.8" y="214.3" width="6.8" height="35.7" class="bar-wing"/>
<rect x="406.7" y="65.2" width="6.8" height="184.8" class="bar-tape"/>
<rect x="415.5" y="55.8" width="6.8" height="194.2" class="bar-tape"/>
<rect x="424.3" y="51.6" width="6.8" height="198.4" class="bar-tape"/>
<rect x="433.2" y="48.4" width="6.8" height="201.6" class="bar-tape"/>
<rect x="442.0" y="53.7" width="6.8" height="196.3" class="bar-tape"/>
<rect x="450.8" y="57.8" width="6.8" height="192.2" class="bar-tape"/>
<rect x="459.7" y="63.1" width="6.8" height="186.9" class="bar-tape"/>
<rect x="468.5" y="69.4" width="6.8" height="180.6" class="bar-tape"/>
<rect x="477.3" y="211.2" width="6.8" height="38.8" class="bar-wing"/>
<rect x="486.2" y="214.3" width="6.8" height="35.7" class="bar-wing"/>
<rect x="495.0" y="209.1" width="6.8" height="40.9" class="bar-wing"/>
<rect x="503.8" y="216.4" width="6.8" height="33.6" class="bar-wing"/>
<rect x="512.7" y="218.5" width="6.8" height="31.5" class="bar-wing"/>
<rect x="521.5" y="220.6" width="6.8" height="29.4" class="bar-wing"/>
<rect x="530.3" y="230.1" width="6.8" height="19.9" class="bar-bg"/>
<rect x="539.2" y="233.2" width="6.8" height="16.8" class="bar-bg"/>
<rect x="548.0" y="226.9" width="6.8" height="23.1" class="bar-bg"/>
<rect x="556.8" y="235.3" width="6.8" height="14.7" class="bar-bg"/>
<rect x="565.7" y="232.2" width="6.8" height="17.8" class="bar-bg"/>
<rect x="574.5" y="237.4" width="6.8" height="12.6" class="bar-bg"/>
<rect x="583.3" y="231.1" width="6.8" height="18.9" class="bar-bg"/>
<rect x="592.2" y="234.2" width="6.8" height="15.8" class="bar-bg"/>
<line x1="70" y1="250" x2="600" y2="250" class="axis"/>
<line x1="70" y1="40" x2="70" y2="250" class="axis"/>
<text x="18" y="145.0" text-anchor="middle" transform="rotate(-90 18 145.0)" class="mu">intensity (thang của cảm biến)</text>
<text x="600" y="270" text-anchor="end" class="mu">từng tia, quét ngang qua trạm →</text>
<line x1="70" y1="205.9" x2="600" y2="205.9" class="lvl"/>
<line x1="70" y1="69.4" x2="600" y2="69.4" class="lvl"/>
<line x1="70" y1="137.65" x2="600" y2="137.65" class="thr"/>
<text x="600" y="199.9" text-anchor="end" class="mu halo">nền cao nhất ≈ 210</text>
<text x="600" y="63.400000000000006" text-anchor="end" class="mu halo">dải thấp nhất ≈ 860</text>
<text x="600" y="131.65" text-anchor="end" class="m dt halo">tape_min_intensity ≈ 535</text>
<path d="M 193.7 30 L 193.7 24 L 264.3 24 L 264.3 30" class="brk"/>
<text x="229.0" y="18" text-anchor="middle" class="mu">dải trái: 8 tia</text>
<path d="M 405.7 30 L 405.7 24 L 476.3 24 L 476.3 30" class="brk"/>
<text x="441.0" y="18" text-anchor="middle" class="mu">dải phải: 8 tia</text>
<rect x="70" y="290" width="12" height="10" class="bar-bg"/>
<text x="88" y="299" class="mu">tường, vật khác</text>
<rect x="220" y="290" width="12" height="10" class="bar-wing"/>
<text x="238" y="299" class="mu">mặt cánh</text>
<rect x="330" y="290" width="12" height="10" class="bar-tape"/>
<text x="348" y="299" class="mu">dải phản quang</text>
<text x="70" y="320" class="wr">Số minh hoạ. Đo thang thật của cảm biến, không chép số này.</text>
</svg>

After

Width:  |  Height:  |  Size: 7.3 KiB

61
doc/fig/tape_height.svg Normal file
View File

@@ -0,0 +1,61 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 300" width="640" height="300">
<style>
text { font-family: "DejaVu Sans", Arial, sans-serif; font-size: 13px; fill: #1b2733; }
.m { font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 12.5px; }
.mu { fill: #5a6b74; font-size: 12px; }
.dt { fill: #0a7684; }
.halo { paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
.tape { fill: url(#h); stroke: #7d8b93; stroke-width: 1; }
.dim { stroke: #0a7684; stroke-width: 1.4; fill: none; }
.ext { stroke: #0a7684; stroke-width: .8; stroke-dasharray: 3 3; opacity: .75; }
.robot { fill: none; stroke: #42535e; stroke-width: 1.6; }
.rs { fill: #42535e; opacity: .07; }
.lidar { fill: #42535e; }
.wheel { fill: #ffffff; stroke: #42535e; stroke-width: 1.6; }
.floor { stroke: #5a6b74; stroke-width: 1.6; }
.scan { stroke: #0a7684; stroke-width: 1.4; stroke-dasharray: 8 5; }
.fan { stroke: #0a7684; stroke-width: .9; opacity: .55; }
.leader { stroke: #5a6b74; stroke-width: .9; fill: none; }
</style>
<defs>
<pattern id="h" width="6" height="6" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
<rect width="6" height="6" fill="#dfe5e8"/>
<line x1="0" y1="0" x2="0" y2="6" stroke="#7d8b93" stroke-width="1.6"/>
</pattern>
<marker id="a" viewBox="0 0 10 10" refX="9.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M0 1 L10 5 L0 9 z" fill="#0a7684"/>
</marker>
</defs>
<rect width="640" height="300" fill="#ffffff"/>
<line x1="20" y1="260" x2="620" y2="260" class="floor"/>
<text x="24" y="282" class="mu">sàn</text>
<rect x="40" y="140" width="230" height="110" rx="8" class="rs"/>
<rect x="40" y="140" width="230" height="110" rx="8" class="robot"/>
<circle cx="80" cy="250" r="14" class="wheel"/>
<circle cx="230" cy="250" r="14" class="wheel"/>
<text x="155" y="200" text-anchor="middle" class="mu">robot (nhìn ngang)</text>
<rect x="262" y="190" width="22" height="20" rx="3" class="lidar"/>
<text x="273" y="128" text-anchor="middle" class="mu">cảm biến</text>
<line x1="273" y1="134" x2="273" y2="188" class="leader"/>
<line x1="284" y1="200" x2="423" y2="200" class="scan"/>
<line x1="284" y1="200" x2="423" y2="191" class="fan"/>
<line x1="284" y1="200" x2="423" y2="209" class="fan"/>
<text x="345" y="244" text-anchor="middle" class="mu">robot chúi ±1° (phóng đại)</text>
<rect x="430" y="70" width="14" height="190" fill="#d27a24"/>
<text x="437" y="60" text-anchor="middle" class="mu">tấm cánh (nhìn ngang)</text>
<rect x="423" y="175" width="7" height="50" class="tape"/>
<line x1="380" y1="122" x2="422" y2="178" class="leader"/>
<text x="370" y="116" text-anchor="middle" class="mu">dải phản quang</text>
<line x1="448" y1="175" x2="470" y2="175" class="ext"/>
<line x1="448" y1="225" x2="470" y2="225" class="ext"/>
<line x1="462" y1="175" x2="462" y2="225" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
<text x="470" y="198" class="dt halo">≥ 10 cm</text>
<text x="470" y="214" class="mu halo">h_sensor ± 5 cm</text>
<line x1="444" y1="200" x2="588" y2="200" class="ext"/>
<line x1="580" y1="260" x2="580" y2="200" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
<text x="596" y="224" text-anchor="middle" transform="rotate(90 596 224)" class="m dt halo">h_sensor</text>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

61
doc/fig/tape_layout.svg Normal file
View File

@@ -0,0 +1,61 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 400" width="640" height="400">
<style>
text { font-family: "DejaVu Sans", Arial, sans-serif; font-size: 13px; fill: #1b2733; }
.m { font-family: "DejaVu Sans Mono", Consolas, monospace; font-size: 12.5px; }
.mu { fill: #5a6b74; font-size: 12px; }
.dt { fill: #0a7684; }
.halo { paint-order: stroke; stroke: #ffffff; stroke-width: 4px; stroke-linejoin: round; }
.wing { stroke: #d27a24; stroke-linecap: round; fill: none; }
.tape { fill: url(#h); stroke: #7d8b93; stroke-width: 1; }
.dim { stroke: #0a7684; stroke-width: 1.4; fill: none; }
.chord { stroke: #0a7684; stroke-width: 1.6; stroke-dasharray: 6 4; fill: none; }
.ext { stroke: #0a7684; stroke-width: .8; stroke-dasharray: 3 3; opacity: .75; }
.leader { stroke: #5a6b74; stroke-width: .9; fill: none; }
.dot { fill: #0a7684; }
</style>
<defs>
<pattern id="h" width="6" height="6" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
<rect width="6" height="6" fill="#dfe5e8"/>
<line x1="0" y1="0" x2="0" y2="6" stroke="#7d8b93" stroke-width="1.6"/>
</pattern>
<marker id="a" viewBox="0 0 10 10" refX="9.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M0 1 L10 5 L0 9 z" fill="#0a7684"/>
</marker>
</defs>
<rect width="640" height="400" fill="#ffffff"/>
<line x1="320" y1="300" x2="122.7" y2="102.7" class="wing" stroke-width="10"/>
<line x1="320" y1="300" x2="517.3" y2="102.7" class="wing" stroke-width="10"/>
<text x="320" y="140" text-anchor="middle" class="mu">lòng V: khuất, thước không đi thẳng qua được</text>
<polygon points="255.99,243.08 179.64,166.72 175.40,170.96 251.76,247.32" class="tape"/>
<polygon points="384.01,243.08 460.36,166.72 464.60,170.96 388.24,247.32" class="tape"/>
<line x1="104" y1="128" x2="176" y2="166" class="leader"/>
<text x="96" y="122" text-anchor="middle" class="mu">dải trái</text>
<line x1="536" y1="128" x2="464" y2="166" class="leader"/>
<text x="544" y="122" text-anchor="middle" class="mu">dải phải</text>
<line x1="213.58" y1="209.14" x2="426.42" y2="209.14" class="chord" marker-start="url(#a)" marker-end="url(#a)"/>
<circle cx="213.58" cy="209.14" r="3.5" class="dot"/>
<circle cx="426.42" cy="209.14" r="3.5" class="dot"/>
<text x="232" y="203" class="m dt halo">C₁</text>
<text x="408" y="203" text-anchor="end" class="m dt halo">C₂</text>
<text x="320" y="200" text-anchor="middle" class="m dt halo">tape_spacing</text>
<line x1="251.76" y1="247.32" x2="238.33" y2="260.75" class="ext"/>
<line x1="175.40" y1="170.96" x2="161.97" y2="184.39" class="ext"/>
<line x1="242.57" y1="256.51" x2="166.21" y2="180.15" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
<text x="196" y="227" text-anchor="middle" transform="rotate(45 196 227)" class="m dt halo">tape_width</text>
<line x1="316.46" y1="303.54" x2="280.4" y2="339.6" class="ext"/>
<line x1="213.58" y1="209.14" x2="181.76" y2="240.96" class="ext"/>
<line x1="284.64" y1="335.36" x2="186.0" y2="236.72" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
<text x="226" y="295" text-anchor="middle" transform="rotate(45 226 295)" class="m dt halo">d₁</text>
<line x1="323.54" y1="303.54" x2="359.6" y2="339.6" class="ext"/>
<line x1="426.42" y1="209.14" x2="458.24" y2="240.96" class="ext"/>
<line x1="355.36" y1="335.36" x2="454.0" y2="236.72" class="dim" marker-start="url(#a)" marker-end="url(#a)"/>
<text x="414" y="295" text-anchor="middle" transform="rotate(-45 414 295)" class="m dt halo">d₂</text>
<text x="320" y="370" text-anchor="middle" class="mu">đỉnh ngoài</text>
<text x="320" y="392" text-anchor="middle" class="mu">↓ phía robot</text>
</svg>

After

Width:  |  Height:  |  Size: 3.7 KiB