> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mrdvs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# V2 视觉定位模块 HTTP 通信协议

> V2 视觉定位模块的 HTTP 接口、请求参数和响应数据参考。

本页列出 V2 视觉定位模块的 HTTP 接口。将下文地址中的 IP 占位符替换为模块 IP 地址。除非接口另有说明，响应中的 code 为 200 且 message 为 success 表示请求已成功处理。

> [!WARNING]
>
> 更新程序、部署或切换地图、重启程序和重启相机会中断定位服务。请在车辆停止且具备恢复条件时调用这些接口。

## 程序和设备信息

### 更新主程序

地址：`http://<ip>:9998/tool/rob/quiet_update`

**url** `string` *required*

主程序升级包的可访问 URL。

### 设置相机高度

地址：`http://<ip>:9998/tool/rob/setHeightRequest`

**height** `number` *required*

相机高度。

### 查询程序版本

地址：`http://<ip>:9998/tool/rob/getRobotVersion`

该接口不需要请求参数。

**code** `integer` *required*

响应状态码。

**data** `string`

程序版本，例如 version 12313。

### 查询车辆信息

地址：`http://<ip>:9998/tool/rob/getVehicle`

该接口不需要请求参数。

**data** `object` *required*

车辆信息对象。

**vehicleId** `string`

车辆 UUID。

**mapId** `string`

当前地图。

**vehicleType** `string`

车辆类型。

### 查询当前位姿

地址：`http://<ip>:9998/tool/rob/getAGVPose`

该接口不需要请求参数。

**pose** `object` *required*

当前位姿。

**x** `number`

X 坐标。

**y** `number`

Y 坐标。

**yaw** `number`

航向角。

### 重定位

地址：`http://<ip>:9998/tool/rob/relocate`

请求头：Content-Type: application/json

**x** `number` *required*

X 坐标，单位为米。

**y** `number` *required*

Y 坐标，单位为米。

**angle** `number` *required*

姿态角。

**noisyX** `number` *required*

X 方向噪声，单位为米。

**noisyY** `number` *required*

Y 方向噪声，单位为米。

**noisyAngle** `number` *required*

角度噪声。

## 地图管理

### 下载当前运行地图包

地址：`http://<ip>:9998/tool/rob/getRunMapZip`

请求头：Content-Type: application/json

**Name** `string` *required*

地图名称。

响应为 ZIP 文件，内容类型为 application/zip。

### 部署地图

地址：`http://<ip>:9998/tool/rob/deployRunMap`

**id** `string` *required*

地图名称。

### 应用地图

地址：`http://<ip>:9998/tool/rob/changeCurrentRunMap`

**name** `string` *required*

地图名称。

### 开始建图

地址：`http://<ip>:9998/tool/rob/startMapping`

**name** `string` *required*

地图名称。

### 结束建图

地址：`http://<ip>:9998/tool/rob/stopMapping`

该接口不需要请求参数。

### 开始或结束增量建图

地址：`http://<ip>:9998/tool/rob/sendCMD`

| 操作 | cmd | attach.sub\_command | attach.param |
| - | - | - | - |
| 开始增量建图 | 904 | 0 | mapname |
| 结束增量建图 | 905 | 0 | mapname |

### 获取地图列表

推荐使用本机地图列表接口：

`http://<ip>:9998/tool/rob/getRunMapLists`

该接口不需要请求参数，响应中的 run\_maps 为地图名数组。

> [!NOTE]
>
> 后台地图列表接口 `http://<ip>:9998/tool/editor/getLocalMaps` 已标注为不推荐使用。

### 上传地图包到相机

地址：`http://<ip>:9998/tool/rob/uploadMapZip2RunMaps`

**url** `string` *required*

地图包的可访问 URL。

### 下载地图

地址：`http://<ip>:9998/tool/rob/downloadVisiomWithLaserMap`

**url** `string` *required*

地图包的可访问 URL。

## 维护接口

### 重启相机程序

地址：`http://<ip>:9998/tool/rob/restart`

该接口不需要请求参数。

### 重启相机

地址：`http://<ip>:9998/tool/rob/Reboot`

该接口不需要请求参数。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.