| <html devsite><head> |
| <title>传感器融合盒快速入门指南</title> |
| <meta name="project_path" value="/_project.yaml"/> |
| <meta name="book_path" value="/_book.yaml"/> |
| </head> |
| <body> |
| <!-- |
| Copyright 2018 The Android Open Source Project |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| http://www.apache.org/licenses/LICENSE-2.0 |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <p> |
| 传感器融合测试旨在衡量 Android 手机上的摄像头和其他传感器的时间戳准确度。本页逐步介绍了首次设置传感器融合测试和传感器融合盒时如何操作。 |
| </p> |
| <h2 id="required-tools">所需工具</h2> |
| <p> |
| 在开始之前,请确保您已准备好以下线缆和电线:</p> |
| <figure id="sensor-fusion-test-component"> |
| <img src="/compatibility/cts/images/sensor_fusion_test_components.png" width="700" alt="传感器融合测试组件"/> |
| <figcaption><b>图 1.</b> 进行传感器融合测试所需的组件</figcaption> |
| </figure> |
| <ul> |
| <li>USB A 转 B 线缆</li> |
| <li>USB A 转 C 线缆(用于连接测试手机)</li> |
| <li>12V 电源线(用于连接伺服器控制箱)</li> |
| <li>12V 电源线(用于连接灯具,带开关)</li> |
| <li>互连线缆(用于连接灯具)</li> |
| <li>转换线缆(用于连接灯具)</li> |
| </ul> |
| <h2 id="step-1-connect-lights">第 1 步:连接灯具</h2> |
| <p> |
| 要连接灯具,请执行以下操作: |
| </p> |
| <ol> |
| <li>用互连线缆将两盏灯连起来。</li> |
| <li>将一盏灯连接到转换线缆。 |
| <figure id="sensor-fusion-connect-lights"> |
| <img src="/compatibility/cts/images/sensor_fusion_connect_lights.png" width="300" alt="连接灯具"/> |
| <figcaption><b>图 2.</b> 将两盏灯连接在一起,并将一盏灯连接到转换线缆</figcaption> |
| </figure> |
| </li> |
| <li>将转换线缆未连接灯具的一端从通往盒外的圆孔中穿出,然后连接到灯具的电源线缆。 |
| <table class="columns"> |
| <tbody><tr> |
| <td><img src="/compatibility/cts/images/sensor_fusion_conversion_cable1.png" width alt="转换线缆和电源线"/></td> |
| <td><img src="/compatibility/cts/images/sensor_fusion_conversion_cable2.png" width alt="灯具电源线"/></td> |
| </tr> |
| </tbody></table> |
| <b>图 3.</b> 灯具转换线缆伸出盒子并连接到电源线缆</li> |
| </ol> |
| <h2 id="step-2-attach-servo">第 2 步:固定伺服器</h2> |
| <p> |
| 要固定伺服器,请执行以下操作: |
| </p> |
| <ol> |
| <li>将伺服器接头插入伺服器控制箱。插入接头时,请务必确保电线的颜色要与标示的颜色一一对应(Y = 黄色,R = 红色,B = 黑色),颜色顺序颠倒可能会损坏电机。 |
| <figure id="sensor-fusion-servo-connector"> |
| <img src="/compatibility/cts/images/sensor_fusion_servo_connector.png" width="300" alt="伺服器连接到伺服器控制箱"/> |
| <figcaption><b>图 4.</b> 伺服器连接到伺服器控制箱</figcaption> |
| </figure> |
| </li><li>将伺服器控制箱连接到电源线(灯具和伺服器控制箱具有单独的专用电源)。 |
| <table class="columns"> |
| <tbody><tr> |
| <td><img src="/compatibility/cts/images/sensor_fusion_servo_control1.png" width alt="伺服器控制箱"/></td> |
| <td><img src="/compatibility/cts/images/sensor_fusion_servo_control2.png" width alt="伺服器控制箱电源"/></td> |
| </tr> |
| </tbody></table> |
| <b>图 5.</b> 将伺服器控制箱连接到专用电源 |
| </li><li>使用 USB A 转 B 线缆将伺服器控制箱连接到主机(即运行测试的机器)。 |
| <table class="columns"> |
| <tbody><tr> |
| <td><img src="/compatibility/cts/images/sensor_fusion_servo_control_box1.png" width alt="连接伺服器控制箱"/></td> |
| <td><img src="/compatibility/cts/images/sensor_fusion_servo_control_box2.png" width alt="将伺服器控制箱连接到主机"/></td> |
| </tr> |
| </tbody></table> |
| <b>图 6.</b> 将伺服器控制箱连接到主机</li> |
| </ol> |
| <h2 id="step-3-attach-phone">第 3 步:固定手机</h2> |
| <ol> |
| <li>将手机放在手机夹上并夹紧。<br /> |
| <table class="columns"> |
| <tbody><tr> |
| <td><img src="/compatibility/cts/images/sensor_fusion_fixture1.png" width alt="手机在手机夹上"/></td> |
| <td><img src="/compatibility/cts/images/sensor_fusion_fixture2.png" width alt="将手机夹在手机夹上"/></td> |
| </tr> |
| </tbody></table> |
| <b>图 7.</b> 将手机放在手机夹上并夹紧 |
| <p>倒置的手拧螺钉可提供背部支撑,而另一个螺钉可通过向右旋转来拧紧手柄。如需更多帮助,请参阅有关装载手机的视频(包含在<a href="/compatibility/cts/sensor_fusion_1.5.zip">传感器融合盒 zip 文件</a>中)。</p> |
| </li> |
| <li>使用束线带将手机 USB 线固定在手机夹板上,并穿过出口孔引出盒外。将这条线的另一端插入到运行测试的主机。 |
| <figure id="sensor-fusion-zip-ties"> |
| <img src="/compatibility/cts/images/sensor_fusion_zip_ties.png" width="300" alt="带束线带的手机 USB 线"/> |
| <figcaption><b>图 8.</b> 使用束线带将手机 USB 线固定在手机夹上</figcaption> |
| </figure> |
| </li> |
| </ol> |
| <h2 id="step-4-run-test-script">第 4 步:运行测试脚本</h2> |
| <p> |
| 测试脚本的主要 Python 可执行代码是: |
| </p> |
| <pre class="prettyprint">python tools/run_all_tests.py device=ID camera=0 scenes=sensor_fusion rot_rig=default</pre> |
| <p>您也可以使用以下命令在命令行中输入实际旋转器地址:</p> |
| <pre class="prettyprint">rot_rig=VID:PID:CH</pre> |
| <ul> |
| <li>要确定供应商 ID (VID) 和产品 ID (PID),请使用 Linux 命令 <code>lsusb</code>。</li> <li>默认情况下,VID 和 PID 会设为 <code>04d8</code> 和 <code>fc73</code>,并使用频道“1”。</li> |
| </ul> |
| <h3 id="multiple-runs-different-formats">多次运行,不同格式</h3> |
| <p>要使用不同格式执行多次运行,您可以使用不同的脚本(不过,结果不会上传到 <code>CtsVerifier.apk</code>)。测试脚本示例:</p> |
| <pre class="prettyprint">python tools/run_sensor_fusion_box.py device=FA7831A00278 camera=0 rotator=default img_size=640,360 fps=30 test_length=7</pre> |
| <h3 id="permission-issues">权限问题</h3> |
| <p>要解决与通过 USB 端口控制电机相关的权限问题,请执行以下操作:</p> |
| <ol> |
| <li>使用以下命令将运营商用户名添加到 <code>dialout</code> 组: |
| <pre class="prettyprint">sudo adduser $username dialout</pre></li> |
| <li>退出运营商帐号。</li> |
| <li>登录运营商帐号。</li> |
| </ol> |
| <h2>调整电机</h2> |
| <p> |
| 您可以使用控制箱侧面的电阻端口(标记为 <strong>A</strong>、<strong>B</strong> 和 <strong>T</strong>)来调整电机转速和手机行程。 |
| </p> |
| <ol> |
| <li>确保手机夹每次旋转的行程都满 90 度(目视手机时,从 12 点方向移到 9 点方向)。 |
| <ul> |
| <li>要调整行程,请使用 <strong>A</strong> 螺钉和 <strong>B</strong> 螺钉(其中 <strong>A</strong> 为起始位置,<strong>B</strong> 为最终位置)。</li> |
| <li>在第一次收到传感器融合盒时,为盒子接通电源并确定起始位置的难度最小。如果接通电源后的起始位置偏离了 12 点方向,则拧下手机夹的螺钉(安装孔中的单个十字螺钉),然后将手机夹旋转到 12 点方向。</li> |
| </ul> |
| </li> |
| <li>将旋转速度调整为 1.5 秒完成一次全程旋转。顺时针旋转可变电阻可减慢旋转速度。 |
| <table class="columns"> |
| <tbody><tr> |
| <td> |
| <img src="/compatibility/cts/images/sensor_fusion_adjust.png" width alt="调整伺服器的位置和速度"/> |
| </td> |
| <td> |
| <ul> |
| <li>A 是手机夹的起始位置。</li> |
| <li>B 是手机夹的结束位置。</li> |
| <li>T 是电机旋转速度。</li> |
| </ul> |
| </td> |
| </tr> |
| </tbody></table> |
| <b>图 9.</b> 如何调整伺服器和手机夹的位置和速度 |
| </li> |
| </ol> |
| <p> |
| 如需更多帮助,请参阅有关传感器融合盒运行的视频(包含在<a href="/compatibility/cts/sensor_fusion_1.5.zip">传感器融合盒 zip 文件</a>中)。 |
| </p> |
| |
| </body></html> |