航线
<p>[TOC]</p>
<h4>航线管理</h4>
<h5>航线列表</h5>
<ol>
<li>服务描述
getAllPlan 服务用户获取地面站上的所有航线</li>
</ol>
<pre><code class="language-json"> {
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;method&quot;: &quot;getAllPlan&quot;,
&quot;data&quot;: {}
}</code></pre>
<h5>航线新增</h5>
<ol>
<li>服务描述
addPlan 服务用于把航线保存在地面站</li>
</ol>
<pre><code class="language-json"> {
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;method&quot;: &quot;addPlan&quot;,
&quot;data&quot;: {
&quot;custom&quot;: {
&quot;itemId&quot;: &quot;312fd684-66a0-48cc-be70-10eff1fd1589&quot;,
&quot;name&quot;: &quot;测试航线&quot;,
&quot;routeType&quot;:&quot;waypoint&quot;,
&quot;takeoffHeight&quot;: 30,
&quot;descentSpeed&quot;: 4,
&quot;ascentSpeed&quot;: 3,
&quot;horiSpeed&quot;: 3,
&quot;flightAltitude&quot;: 100,
&quot;afterFinish&quot;: &quot;ROUTE_RETURN&quot;,
&quot;rtlAlt&quot;: 15,
&quot;referAlt&quot;: &quot;RA_ALTITUDE&quot;,
&quot;type&quot;:&quot;WPT_LINE&quot;,
&quot;createName&quot;: &quot;林怡&quot;,
&quot;editTime&quot;: &quot;2024-11-27 13:56:21&quot;,
&quot;estimatedTime&quot;:&quot;&quot;,
&quot;distance&quot;:&quot;&quot;,
&quot;waypoints&quot;: [
{
&quot;index&quot;: 0,
&quot;height&quot;: 100,
&quot;latitude&quot;: 22.3822229,
&quot;longitude&quot;: 113.5364597,
&quot;type&quot;: &quot;WPT_LINE&quot;,
&quot;isFollowType&quot;:true,
&quot;isFollowHeight&quot;:true,
&quot;commands&quot;: [
{
&quot;index&quot;: 1,
&quot;actCmd&quot;: [
0,
0,
0,
0
],
&quot;type&quot;: &quot;DIGICAM_SHOT&quot;
},
{
&quot;index&quot;: 2,
&quot;actCmd&quot;: [
0,
0,
0,
0
],
&quot;type&quot;: &quot;DIGICAM_SHOT&quot;
}
]
},
{
&quot;index&quot;: 3,
&quot;height&quot;: 100,
&quot;latitude&quot;: 22.3822229,
&quot;longitude&quot;: 113.5364597,
&quot;type&quot;: &quot;WPT_LINE&quot;
}
],
&quot;standbyPoints&quot;: [
{
&quot;name&quot;: &quot;备降点1&quot;,
&quot;index&quot;: 0,
&quot;latitude&quot;: 0,
&quot;longitude&quot;: 0
}
]
}
},
&quot;timestamp&quot;: 1700000000000
}</code></pre>
<h5>航线编辑</h5>
<ol>
<li>服务描述
updatePlan 服务用于把航线保存在地面站</li>
</ol>
<pre><code class="language-json"> {
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;method&quot;: &quot;updatePlan&quot;,
&quot;data&quot;: {
&quot;custom&quot;: {
&quot;itemId&quot;: &quot;312fd684-66a0-48cc-be70-10eff1fd1589&quot;,
&quot;name&quot;: &quot;测试航线&quot;,
&quot;takeOffHeight&quot;: 30,
&quot;descentSpeed&quot;: 4,
&quot;ascentSpeed&quot;: 3,
&quot;horiSpeed&quot;: 3,
&quot;flightAltitude&quot;: 100,
&quot;afterFinish&quot;: &quot;ROUTE_RETURN&quot;,
&quot;rtlAlt&quot;: 15,
&quot;referAlt&quot;: &quot;RA_ALTITUDE&quot;,
&quot;type&quot;:&quot;WPT_LINE&quot;,
&quot;createName&quot;: &quot;林怡&quot;,
&quot;editTime&quot;: &quot;2024-11-27 13:56:21&quot;,
&quot;wayPoints&quot;: [
{
&quot;index&quot;: 0,
&quot;height&quot;: 100,
&quot;latitude&quot;: 22.3822229,
&quot;longitude&quot;: 113.5364597,
&quot;type&quot;: &quot;WPT_LINE&quot;,
&quot;isFollowType&quot;:true,
&quot;isFollowHeight&quot;:true,
&quot;commands&quot;: [
{
&quot;index&quot;: 1,
&quot;actCmd&quot;: [
0,
0,
0,
0
],
&quot;type&quot;: &quot;DIGICAM_SHOT&quot;
},
{
&quot;index&quot;: 2,
&quot;actCmd&quot;: [
0,
0,
0,
0
],
&quot;type&quot;: &quot;DIGICAM_SHOT&quot;
}
]
},
{
&quot;index&quot;: 3,
&quot;height&quot;: 100,
&quot;latitude&quot;: 22.3822229,
&quot;longitude&quot;: 113.5364597,
&quot;type&quot;: &quot;WPT_LINE&quot;
}
],
&quot;standbyPoints&quot;: [
{
&quot;name&quot;: &quot;备降点1&quot;,
&quot;index&quot;: 0,
&quot;latitude&quot;: 0,
&quot;longitude&quot;: 0
}
]
}
},
&quot;timestamp&quot;: 1700000000000
}</code></pre>
<h5>航线删除</h5>
<ol>
<li>服务描述
getAllPlan 服务用户获取地面站上的所有航线</li>
</ol>
<pre><code class="language-json">{
&quot;tid&quot;: &quot;handlePlan&quot;,
&quot;bid&quot;: &quot;handlePlan&quot;,
&quot;method&quot;: &quot;deletePlan&quot;,
&quot;data&quot;: {
&quot;custom&quot;: {
&quot;itemIds&quot;:[1,2,3,4]
}
},
&quot;timestamp&quot;: 1744794432020
}</code></pre>
<h5>航线下发</h5>
<ol>
<li>服务描述
用于云端把航线下发到无人机</li>
</ol>
<p>示例请求</p>
<pre><code class="language-json"> {
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;method&quot;: &quot;planUpload&quot;,
&quot;data&quot;: {
&quot;custom&quot;: {
&quot;itemId&quot;: &quot;312fd684-66a0-48cc-be70-10eff1fd1589&quot;,
&quot;name&quot;: &quot;测试航线&quot;,
&quot;takeoffHeight&quot;: 30,
&quot;descentSpeed&quot;: 4,
&quot;ascentSpeed&quot;: 3,
&quot;horiSpeed&quot;: 3,
&quot;flightAltitude&quot;: 100,
&quot;afterFinish&quot;: &quot;ROUTE_RETURN&quot;,
&quot;rtlAlt&quot;: 15,
&quot;referAlt&quot;: &quot;RA_ALTITUDE&quot;,
&quot;type&quot;:&quot;WPT_LINE&quot;,
&quot;createName&quot;: &quot;林怡&quot;,
&quot;editTime&quot;: &quot;2024-11-27 13:56:21&quot;,
&quot;waypoints&quot;: [
{
&quot;index&quot;: 0,
&quot;height&quot;: 100,
&quot;latitude&quot;: 22.3822229,
&quot;longitude&quot;: 113.5364597,
&quot;type&quot;: &quot;WPT_LINE&quot;,
&quot;isFollowType&quot;:true,
&quot;isFollowHeight&quot;:true,
&quot;commands&quot;: [
{
&quot;index&quot;: 1,
&quot;actCmd&quot;: [
0,
0,
0,
0
],
&quot;type&quot;: &quot;DIGICAM_SHOT&quot;
},
{
&quot;index&quot;: 2,
&quot;actCmd&quot;: [
0,
0,
0,
0
],
&quot;type&quot;: &quot;DIGICAM_SHOT&quot;
}
]
},
{
&quot;index&quot;: 3,
&quot;height&quot;: 100,
&quot;latitude&quot;: 22.3822229,
&quot;longitude&quot;: 113.5364597,
&quot;type&quot;: &quot;WPT_LINE&quot;
}
],
&quot;standbyPoints&quot;: [
{
&quot;name&quot;: &quot;备降点1&quot;,
&quot;index&quot;: 0,
&quot;latitude&quot;: 0,
&quot;longitude&quot;: 0
}
]
}
},
&quot;timestamp&quot;: 1700000000000
}</code></pre>
<p>进度反馈</p>
<pre><code class="language-json">{
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;code&quot;: 0,
&quot;data&quot;: {
&quot;current&quot;: 6,
&quot;percentage&quot;: 85,
&quot;total&quot;: 7
},
&quot;message&quot;: &quot;success&quot;,
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;timestamp&quot;: 1745553441037
}</code></pre>
<ol>
<li>响应格式
响应消息中包含服务调用的结果,包括返回码和错误信息(如果有的话)。
示例响应
<pre><code class="language-json">{
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;code&quot;: 0, // 结果返回码:0 表示成功,非 0 表示失败
&quot;message&quot;: &quot;成功&quot; // 错误信息(如果失败则返回具体原因)
&quot;data&quot;: {},
&quot;timestamp&quot;: 1700000000000
}</code></pre></li>
</ol>
<h5>取消航线下发</h5>
<ol>
<li>
<p>服务描述
getAllPlan 服务用户获取地面站上的所有航线</p>
</li>
<li>
<p>请求示例</p>
<pre><code class="language-json">{
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;method&quot;: &quot;cancelPlanUpload&quot;,
&quot;data&quot;: {}
}</code></pre>
</li>
<li>响应格式
示例响应
<pre><code class="language-json">{
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;code&quot;: 0, // 结果返回码:0 表示成功,非 0 表示失败
&quot;message&quot;: &quot;成功&quot; // 错误信息(如果失败则返回具体原因)
&quot;timestamp&quot;: 1700000000000
}</code></pre></li>
</ol>
<h1>航线格式</h1>
<table>
<thead>
<tr>
<th>参数</th>
<th>说明</th>
<th>取值范围</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>itemId</td>
<td>唯一id</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>name</td>
<td>航线名称</td>
<td></td>
<td></td>
</tr>
<tr>
<td>takeOffHeight</td>
<td>起飞高度</td>
<td>0~4000米</td>
<td></td>
</tr>
<tr>
<td>descentSpeed</td>
<td>下降高度</td>
<td>0.1~10 m/s</td>
<td></td>
</tr>
<tr>
<td>ascentSpeed</td>
<td>爬升速度</td>
<td>0.1~10 m/s</td>
<td></td>
</tr>
<tr>
<td>horiSpeed</td>
<td>水平速度</td>
<td>0.1~17 m/s</td>
<td></td>
</tr>
<tr>
<td>flightAltitude</td>
<td>航线高度</td>
<td>0~4000米</td>
<td></td>
</tr>
<tr>
<td>afterFinish</td>
<td>航线执行完毕后执行动作</td>
<td>STRAIGHT_RETURN: 直线返航, ORIGINAL_RETURN:原路返航, LAND:降落</td>
<td></td>
</tr>
<tr>
<td>rtlAlt</td>
<td>返航高度</td>
<td>0~4000米</td>
<td></td>
</tr>
<tr>
<td>referAlt</td>
<td>高度参考</td>
<td>RA_ALTITUDE:相对高度, AL_ALTITUDE:海拔高度,RA_TERRAIN 地形高度</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>新增默认航点类型</td>
<td>COMMAND_WAYPOINT:普通直线航点, COMMAND_SURVEY:测绘航点测绘航点,RA_TERRAIN 地形高度</td>
<td></td>
</tr>
<tr>
<td>createName</td>
<td>创建人</td>
<td></td>
<td></td>
</tr>
<tr>
<td>editTime</td>
<td>创建时间</td>
<td></td>
<td></td>
</tr>
<tr>
<td>wayPoints</td>
<td>航点集合</td>
<td></td>
<td></td>
</tr>
<tr>
<td>index</td>
<td>航点脚标/指令脚标</td>
<td></td>
<td>若type 非航点类型而是指令类型 则代表指令脚标 ,即该指令飞到该脚标位的航点后执行,若有多个指令即按其集合顺序执行</td>
</tr>
<tr>
<td>actCmd</td>
<td>指令参数</td>
<td>[0,0,0,0] 分别代表param1,param2,param3,param4</td>
<td></td>
</tr>
<tr>
<td>height</td>
<td>航点高度</td>
<td></td>
<td></td>
</tr>
<tr>
<td>latitude</td>
<td>纬度</td>
<td></td>
<td></td>
</tr>
<tr>
<td>longitude</td>
<td>经度</td>
<td></td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>航点类型/指令类型</td>
<td>航点类型:<br>COMMAND_WAYPOINT-普通直线航点<br>COMMAND_SURVEY-测绘航点 <br><br>指令类型:<br>COMMAND_WAYPOINT_JUMP-航点跳转 <br>- - - -param1跳转航点 param2跳转次数 <br><br>COMMAND_SPEED_CHANGE-航速改变<br>- - - -param2速度单位(m/s)<br><br>COMMAND_MOUNT_CONTROL-云台控制<br>- - - -param1 俯仰角度,param3 偏移角<br><br>COMMAND_DIGICAM_SHOT-拍照 <br><br> COMMAND_CONDITION_YAW 改变航向 <br><br> LOITER_HOVER 悬停</td>
<td></td>
</tr>
</tbody>
</table>
<pre><code class="language-json">{
&quot;itemId&quot;: &quot;312fd684-66a0-48cc-be70-10eff1fd1589&quot;,
&quot;name&quot;: &quot;测试航线&quot;,
&quot;takeoffHeight&quot;: 30,
&quot;descentSpeed&quot;: 4,
&quot;ascentSpeed&quot;: 3,
&quot;horiSpeed&quot;: 3,
&quot;flightAltitude&quot;: 100,
&quot;afterFinish&quot;: &quot;ROUTE_RETURN&quot;,
&quot;rtlAlt&quot;: 15,
&quot;referAlt&quot;: &quot;RA_ALTITUDE&quot;,
&quot;createName&quot;: &quot;林怡&quot;,
&quot;editTime&quot;: &quot;2024-11-27 13:56:21&quot;,
&quot;waypoints&quot;: [
{
&quot;index&quot;: 0,
&quot;actCmd&quot;: [0,0,0,0],
&quot;height&quot;: 100,
&quot;latitude&quot;: 22.3822229,
&quot;longitude&quot;: 113.5364597,
&quot;type&quot;: &quot;WPT_LINE&quot;
},
{
&quot;index&quot;: 0,
&quot;actCmd&quot;: [0,0,0,0],
&quot;height&quot;: 0,
&quot;latitude&quot;:0,
&quot;longitude&quot;: 0,
&quot;type&quot;: &quot;DIGICAM_SHOT&quot;
}
]
}
</code></pre>