Compare commits
3 Commits
e62f445013
...
86a8e02d85
| Author | SHA1 | Date | |
|---|---|---|---|
| 86a8e02d85 | |||
| 7278d2c0f0 | |||
| c8b2c39d74 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -45,3 +45,7 @@ nbdist/
|
|||||||
!*/build/*.java
|
!*/build/*.java
|
||||||
!*/build/*.html
|
!*/build/*.html
|
||||||
!*/build/*.xml
|
!*/build/*.xml
|
||||||
|
|
||||||
|
# Local verification tests
|
||||||
|
/cmvr-iot-test/src/test/java/com/cmvr/test/flow/runtime/operator/edge/EdgeAgvOperateServiceTest.java
|
||||||
|
/cmvr-iot-test/src/test/java/com/cmvr/test/flow/runtime/operator/edge/EdgeArmOperateServiceTest.java
|
||||||
|
|||||||
19
README.md
19
README.md
@ -7,7 +7,7 @@ Java 包名、Maven 坐标统一使用 `com.cmvr`。旧项目 `cmvr-iot` 仅作
|
|||||||
## 主要功能
|
## 主要功能
|
||||||
|
|
||||||
- 系统管理:用户、角色、部门、菜单、字典、参数、日志和通知。
|
- 系统管理:用户、角色、部门、菜单、字典、参数、日志和通知。
|
||||||
- 设备管理:设备注册、终端配置、设备档案和机器人配置。
|
- 机器人设备:以边缘端上报的永久 `robotId` 作为唯一业务身份,自动同步机器人地址、在线状态和设备清单。
|
||||||
- 测试业务:任务配置、任务编排、任务实例、检测项、语音唤醒、Flowise 和 AI 评估。
|
- 测试业务:任务配置、任务编排、任务实例、检测项、语音唤醒、Flowise 和 AI 评估。
|
||||||
- 智能巡检:机器人、地图、点位、任务、执行实例、巡检结果和告警。
|
- 智能巡检:机器人、地图、点位、任务、执行实例、巡检结果和告警。
|
||||||
- 智能座舱:语音交互、触控交互、TTS、语料库和车机操作配置。
|
- 智能座舱:语音交互、触控交互、TTS、语料库和车机操作配置。
|
||||||
@ -41,7 +41,7 @@ Java 包名、Maven 坐标统一使用 `com.cmvr`。旧项目 `cmvr-iot` 仅作
|
|||||||
| `cmvr-iot-system` | 用户、角色、菜单、字典、参数和通用分组 |
|
| `cmvr-iot-system` | 用户、角色、菜单、字典、参数和通用分组 |
|
||||||
| `cmvr-iot-quartz` | Quartz 任务调度和任务日志 |
|
| `cmvr-iot-quartz` | Quartz 任务调度和任务日志 |
|
||||||
| `cmvr-iot-generator` | 代码生成 |
|
| `cmvr-iot-generator` | 代码生成 |
|
||||||
| `cmvr-iot-device` | 设备、终端和机器人配置 |
|
| `cmvr-iot-device` | 设备协议模型、机器人配置和巡检告警监听 |
|
||||||
| `cmvr-iot-test` | 测试任务、流程、检测项和执行实例 |
|
| `cmvr-iot-test` | 测试任务、流程、检测项和执行实例 |
|
||||||
| `cmvr-iot-vi` | 语音交互业务 |
|
| `cmvr-iot-vi` | 语音交互业务 |
|
||||||
| `cmvr-iot-ti` | 触控交互业务 |
|
| `cmvr-iot-ti` | 触控交互业务 |
|
||||||
@ -54,7 +54,7 @@ Java 包名、Maven 坐标统一使用 `com.cmvr`。旧项目 `cmvr-iot` 仅作
|
|||||||
| `cmvr-iot-api/cmvr-iot-edge/cmvr-iot-grpc-client` | 原有机器人 gRPC 客户端 |
|
| `cmvr-iot-api/cmvr-iot-edge/cmvr-iot-grpc-client` | 原有机器人 gRPC 客户端 |
|
||||||
| `cmvr-iot-quic-contract` | QUIC 控制、节点事件和媒体数据协议 |
|
| `cmvr-iot-quic-contract` | QUIC 控制、节点事件和媒体数据协议 |
|
||||||
| `cmvr-iot-quic` | 与主应用同进程运行的 QUIC Gateway |
|
| `cmvr-iot-quic` | 与主应用同进程运行的 QUIC Gateway |
|
||||||
| `ruoyi-ui` | Vue 3 管理控制台 |
|
| `cmvr-iot-ui-lxl-dev-worktree` | Vue 3 管理控制台(同级独立前端仓库) |
|
||||||
|
|
||||||
## 环境准备
|
## 环境准备
|
||||||
|
|
||||||
@ -79,7 +79,8 @@ Java 包名、Maven 坐标统一使用 `com.cmvr`。旧项目 `cmvr-iot` 仅作
|
|||||||
- `sql/aima_module.sql`:爱玛业务。
|
- `sql/aima_module.sql`:爱玛业务。
|
||||||
- `sql/inspection_module.sql`、`inspection_result.sql`、`inspection_detection_alert.sql`:巡检业务。
|
- `sql/inspection_module.sql`、`inspection_result.sql`、`inspection_detection_alert.sql`:巡检业务。
|
||||||
- `sql/tts_corpus_module.sql`:TTS 和语料业务。
|
- `sql/tts_corpus_module.sql`:TTS 和语料业务。
|
||||||
- `sql/quic_gateway_terminal_migration.sql`:QUIC 节点绑定及运行状态字段。
|
- `sql/robot_quic_identity_migration.sql`:机器人 QUIC 身份、运行状态和设备快照表。
|
||||||
|
- `sql/robot_id_only_migration.sql`:移除巡检机器人和任务实例中的历史终端 ID 字段。
|
||||||
|
|
||||||
补充脚本可能面向不同历史库版本。已有数据库升级前应先备份,并确认字段或索引尚未存在。
|
补充脚本可能面向不同历史库版本。已有数据库升级前应先备份,并确认字段或索引尚未存在。
|
||||||
|
|
||||||
@ -111,7 +112,7 @@ Knife4j 只展示带原有 `@ApiOperation` 注解的正式接口,并沿用中
|
|||||||
## 前端运行
|
## 前端运行
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ruoyi-ui
|
cd ../cmvr-iot-ui-lxl-dev-worktree
|
||||||
pnpm install
|
pnpm install
|
||||||
pnpm dev
|
pnpm dev
|
||||||
```
|
```
|
||||||
@ -120,7 +121,9 @@ pnpm dev
|
|||||||
|
|
||||||
## gRPC 与 QUIC
|
## gRPC 与 QUIC
|
||||||
|
|
||||||
原有机器人 gRPC 客户端与 proto 均保留。终端 gRPC 地址优先读取 `de_device_terminal_config` 的 `host` 和 `port`,没有终端配置时使用当前 profile 中的 `grpc.client.grpc-server.address`。
|
原有机器人 gRPC 客户端与 proto 均保留,但业务调用只传永久 `robotId`。平台根据 `inspection_robot.robot_id` 查找 QUIC 最近同步的 `ip_address` 和 `port`,不再使用终端 ID 或终端配置解析 gRPC 地址。
|
||||||
|
|
||||||
|
边缘端通过 QUIC 上报设备快照后,平台按 `robotId + deviceId` 写入 `inspection_robot_device`。前端选择机器人后只展示该机器人当前在线且启用的设备;单一匹配设备会自动选中并锁定。
|
||||||
|
|
||||||
QUIC 不是独立服务,`cmvr-iot-quic` 已作为 `cmvr-iot-admin` 的运行时依赖。启用时主应用同时启动:
|
QUIC 不是独立服务,`cmvr-iot-quic` 已作为 `cmvr-iot-admin` 的运行时依赖。启用时主应用同时启动:
|
||||||
|
|
||||||
@ -139,7 +142,7 @@ mvn test
|
|||||||
mvn clean package -DskipTests
|
mvn clean package -DskipTests
|
||||||
|
|
||||||
# 构建前端生产包
|
# 构建前端生产包
|
||||||
cd ruoyi-ui
|
cd ../cmvr-iot-ui-lxl-dev-worktree
|
||||||
pnpm build:prod
|
pnpm build:prod
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -148,6 +151,6 @@ Windows 下也可以使用 `bin/package.bat`、`bin/run.bat` 和 `bin/clean.bat`
|
|||||||
## 排查提示
|
## 排查提示
|
||||||
|
|
||||||
- `ApplicationContext ... has been closed already`:彻底停止旧 Java 进程后重新启动,不要使用 DevTools 热重启。
|
- `ApplicationContext ... has been closed already`:彻底停止旧 Java 进程后重新启动,不要使用 DevTools 热重启。
|
||||||
- `cannot find a NameResolver for static://...`:这是 gRPC target scheme 解析问题,不代表网络不通;检查 `GrpcServiceManager` 的通道创建方式和终端地址格式。
|
- 找不到机器人或机器人离线:确认机器人表已登记相同的永久 `robotId`,并检查 QUIC 注册日志、`inspection_robot` 的地址和连接状态。
|
||||||
- QUIC 启动失败:检查证书、私钥、ALPN、UDP 端口占用和 native library 对应的操作系统架构。
|
- QUIC 启动失败:检查证书、私钥、ALPN、UDP 端口占用和 native library 对应的操作系统架构。
|
||||||
- 数据库提示缺少字段:确认基础脚本版本及对应模块迁移脚本已经执行。
|
- 数据库提示缺少字段:确认基础脚本版本及对应模块迁移脚本已经执行。
|
||||||
|
|||||||
@ -28,9 +28,9 @@ public class DeviceListController {
|
|||||||
@PreAuthorize("@ss.hasPermi('device:profile:list')")
|
@PreAuthorize("@ss.hasPermi('device:profile:list')")
|
||||||
@GetMapping("/addList")
|
@GetMapping("/addList")
|
||||||
@ApiOperation("同步设备信息列表")
|
@ApiOperation("同步设备信息列表")
|
||||||
public int addDeviceList(@RequestParam String terminalId){
|
public int addDeviceList(@RequestParam String robotId){
|
||||||
|
|
||||||
List<DeDeviceRegistration> list = systemService.deviceList(terminalId);
|
List<DeDeviceRegistration> list = systemService.deviceList(robotId);
|
||||||
|
|
||||||
return registrationService.addDeviceList(list);
|
return registrationService.addDeviceList(list);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package com.cmvr.web.controller.api;
|
package com.cmvr.web.controller.api;
|
||||||
|
|
||||||
import cmvr.msgs.Agv;
|
import cmvr.msgs.AgvUtils;
|
||||||
import com.cmvr.common.core.domain.AjaxResult;
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
import com.cmvr.edge.client.model.EdgeCommonVO;
|
import com.cmvr.edge.client.model.EdgeCommonVO;
|
||||||
import com.cmvr.edge.client.model.agv.EdgeAgvMapNameVO;
|
import com.cmvr.edge.client.model.agv.EdgeAgvMapNameVO;
|
||||||
@ -12,12 +12,14 @@ import com.cmvr.edge.client.model.agv.EdgeAgvVelocityVO;
|
|||||||
import com.cmvr.edge.client.service.EdgeAgvService;
|
import com.cmvr.edge.client.service.EdgeAgvService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -48,8 +50,13 @@ public class EdgeAgvController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("获取AGV运行时状态")
|
@ApiOperation("获取AGV运行时状态")
|
||||||
@GetMapping("/getRuntimeState")
|
@GetMapping("/getRuntimeState")
|
||||||
public AjaxResult getRuntimeState(@Validated EdgeCommonVO vo) {
|
public AjaxResult getRuntimeState(
|
||||||
Agv.AgvRuntimeState state = edgeAgvService.getRuntimeState(vo);
|
@ApiParam(value = "机器人永久唯一ID", required = true)
|
||||||
|
@RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO vo = commonVo(robotId, deviceId);
|
||||||
|
AgvUtils.AgvRuntimeState state = edgeAgvService.getRuntimeState(vo);
|
||||||
return AjaxResult.ok(toRuntimeStateMap(state));
|
return AjaxResult.ok(toRuntimeStateMap(state));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,8 +65,13 @@ public class EdgeAgvController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("获取导航状态")
|
@ApiOperation("获取导航状态")
|
||||||
@GetMapping("/getNavigationStatus")
|
@GetMapping("/getNavigationStatus")
|
||||||
public AjaxResult getNavigationStatus(@Validated EdgeCommonVO vo) {
|
public AjaxResult getNavigationStatus(
|
||||||
Agv.AgvNavigationStatus status = edgeAgvService.getNavigationStatus(vo);
|
@ApiParam(value = "机器人永久唯一ID", required = true)
|
||||||
|
@RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO vo = commonVo(robotId, deviceId);
|
||||||
|
AgvUtils.AgvNavigationStatus status = edgeAgvService.getNavigationStatus(vo);
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
resultMap.put("state", status.getState());
|
resultMap.put("state", status.getState());
|
||||||
resultMap.put("type", status.getType());
|
resultMap.put("type", status.getType());
|
||||||
@ -94,7 +106,7 @@ public class EdgeAgvController {
|
|||||||
@ApiOperation("导航到指定位置")
|
@ApiOperation("导航到指定位置")
|
||||||
@PostMapping("/navigateToPose")
|
@PostMapping("/navigateToPose")
|
||||||
public AjaxResult navigateToPose(@RequestBody @Validated EdgeAgvNavigateToPoseVO vo) {
|
public AjaxResult navigateToPose(@RequestBody @Validated EdgeAgvNavigateToPoseVO vo) {
|
||||||
Agv.AgvPose2d pose = Agv.AgvPose2d.newBuilder()
|
AgvUtils.AgvPose2d pose = AgvUtils.AgvPose2d.newBuilder()
|
||||||
.setX(vo.getX())
|
.setX(vo.getX())
|
||||||
.setY(vo.getY())
|
.setY(vo.getY())
|
||||||
.setTheta(vo.getTheta())
|
.setTheta(vo.getTheta())
|
||||||
@ -149,7 +161,7 @@ public class EdgeAgvController {
|
|||||||
@ApiOperation("设置速度")
|
@ApiOperation("设置速度")
|
||||||
@PostMapping("/setVelocity")
|
@PostMapping("/setVelocity")
|
||||||
public AjaxResult setVelocity(@RequestBody @Validated EdgeAgvVelocityVO vo) {
|
public AjaxResult setVelocity(@RequestBody @Validated EdgeAgvVelocityVO vo) {
|
||||||
Agv.AgvVelocity velocity = Agv.AgvVelocity.newBuilder()
|
AgvUtils.AgvVelocity velocity = AgvUtils.AgvVelocity.newBuilder()
|
||||||
.setVx(vo.getVx())
|
.setVx(vo.getVx())
|
||||||
.setVy(vo.getVy())
|
.setVy(vo.getVy())
|
||||||
.setWz(vo.getWz())
|
.setWz(vo.getWz())
|
||||||
@ -173,7 +185,12 @@ public class EdgeAgvController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("列出所有地图")
|
@ApiOperation("列出所有地图")
|
||||||
@GetMapping("/listMaps")
|
@GetMapping("/listMaps")
|
||||||
public AjaxResult listMaps(@Validated EdgeCommonVO vo) {
|
public AjaxResult listMaps(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true)
|
||||||
|
@RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO vo = commonVo(robotId, deviceId);
|
||||||
List<String> maps = edgeAgvService.listMaps(vo);
|
List<String> maps = edgeAgvService.listMaps(vo);
|
||||||
return AjaxResult.ok(maps);
|
return AjaxResult.ok(maps);
|
||||||
}
|
}
|
||||||
@ -183,10 +200,15 @@ public class EdgeAgvController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("列出所有站点")
|
@ApiOperation("列出所有站点")
|
||||||
@GetMapping("/listStations")
|
@GetMapping("/listStations")
|
||||||
public AjaxResult listStations(@Validated EdgeCommonVO vo) {
|
public AjaxResult listStations(
|
||||||
List<Agv.AgvStation> stations = edgeAgvService.listStations(vo);
|
@ApiParam(value = "机器人永久ID", required = true)
|
||||||
|
@RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO vo = commonVo(robotId, deviceId);
|
||||||
|
List<AgvUtils.AgvStation> stations = edgeAgvService.listStations(vo);
|
||||||
List<Map<String, Object>> stationList = new ArrayList<>();
|
List<Map<String, Object>> stationList = new ArrayList<>();
|
||||||
for (Agv.AgvStation station : stations) {
|
for (AgvUtils.AgvStation station : stations) {
|
||||||
stationList.add(toStationMap(station));
|
stationList.add(toStationMap(station));
|
||||||
}
|
}
|
||||||
return AjaxResult.ok(stationList);
|
return AjaxResult.ok(stationList);
|
||||||
@ -217,7 +239,17 @@ public class EdgeAgvController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("下载地图")
|
@ApiOperation("下载地图")
|
||||||
@GetMapping("/downloadMap")
|
@GetMapping("/downloadMap")
|
||||||
public AjaxResult downloadMap(@Validated EdgeAgvMapNameVO vo) {
|
public AjaxResult downloadMap(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true)
|
||||||
|
@RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true)
|
||||||
|
@RequestParam("deviceId") String deviceId,
|
||||||
|
@ApiParam(value = "地图名称", required = true)
|
||||||
|
@RequestParam("mapName") String mapName) {
|
||||||
|
EdgeAgvMapNameVO vo = new EdgeAgvMapNameVO();
|
||||||
|
vo.setRobotId(robotId);
|
||||||
|
vo.setDeviceId(deviceId);
|
||||||
|
vo.setMapName(mapName);
|
||||||
String content = edgeAgvService.downloadMap(vo, vo.getMapName());
|
String content = edgeAgvService.downloadMap(vo, vo.getMapName());
|
||||||
return AjaxResult.ok(content);
|
return AjaxResult.ok(content);
|
||||||
}
|
}
|
||||||
@ -228,7 +260,7 @@ public class EdgeAgvController {
|
|||||||
@ApiOperation("开始建图")
|
@ApiOperation("开始建图")
|
||||||
@PostMapping("/startMapping")
|
@PostMapping("/startMapping")
|
||||||
public AjaxResult startMapping(@RequestBody @Validated EdgeAgvStartMappingVO vo) {
|
public AjaxResult startMapping(@RequestBody @Validated EdgeAgvStartMappingVO vo) {
|
||||||
Agv.AgvMapDimension mapDimension = Agv.AgvMapDimension.forNumber(vo.getDimension());
|
AgvUtils.AgvMapDimension mapDimension = AgvUtils.AgvMapDimension.forNumber(vo.getDimension());
|
||||||
if (mapDimension == null) {
|
if (mapDimension == null) {
|
||||||
return AjaxResult.error("建图维度不合法,允许值:0=未指定,1=2D,2=3D,3=2D+3D");
|
return AjaxResult.error("建图维度不合法,允许值:0=未指定,1=2D,2=3D,3=2D+3D");
|
||||||
}
|
}
|
||||||
@ -252,7 +284,14 @@ public class EdgeAgvController {
|
|||||||
/**
|
/**
|
||||||
* 将 protobuf 运行时状态转换为前端友好的 Map,避免直接暴露 protobuf 对象结构。
|
* 将 protobuf 运行时状态转换为前端友好的 Map,避免直接暴露 protobuf 对象结构。
|
||||||
*/
|
*/
|
||||||
private Map<String, Object> toRuntimeStateMap(Agv.AgvRuntimeState state) {
|
private EdgeCommonVO commonVo(String robotId, String deviceId) {
|
||||||
|
EdgeCommonVO vo = new EdgeCommonVO();
|
||||||
|
vo.setRobotId(robotId);
|
||||||
|
vo.setDeviceId(deviceId);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String, Object> toRuntimeStateMap(AgvUtils.AgvRuntimeState state) {
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
resultMap.put("timestamp", state.getTimestamp());
|
resultMap.put("timestamp", state.getTimestamp());
|
||||||
resultMap.put("mode", state.getMode());
|
resultMap.put("mode", state.getMode());
|
||||||
@ -291,7 +330,7 @@ public class EdgeAgvController {
|
|||||||
/**
|
/**
|
||||||
* 将 protobuf 站点对象转换为普通 Map。
|
* 将 protobuf 站点对象转换为普通 Map。
|
||||||
*/
|
*/
|
||||||
private Map<String, Object> toStationMap(Agv.AgvStation station) {
|
private Map<String, Object> toStationMap(AgvUtils.AgvStation station) {
|
||||||
Map<String, Object> stationMap = new HashMap<>();
|
Map<String, Object> stationMap = new HashMap<>();
|
||||||
stationMap.put("id", station.getId());
|
stationMap.put("id", station.getId());
|
||||||
stationMap.put("type", station.getType());
|
stationMap.put("type", station.getType());
|
||||||
@ -305,7 +344,7 @@ public class EdgeAgvController {
|
|||||||
/**
|
/**
|
||||||
* 将 protobuf 二维位姿转换为普通 Map。
|
* 将 protobuf 二维位姿转换为普通 Map。
|
||||||
*/
|
*/
|
||||||
private Map<String, Object> toPoseMap(Agv.AgvPose2d pose) {
|
private Map<String, Object> toPoseMap(AgvUtils.AgvPose2d pose) {
|
||||||
Map<String, Object> poseMap = new HashMap<>();
|
Map<String, Object> poseMap = new HashMap<>();
|
||||||
poseMap.put("x", pose.getX());
|
poseMap.put("x", pose.getX());
|
||||||
poseMap.put("y", pose.getY());
|
poseMap.put("y", pose.getY());
|
||||||
|
|||||||
@ -7,12 +7,13 @@ import com.cmvr.edge.client.model.arm.*;
|
|||||||
import com.cmvr.edge.client.service.EdgeArmService;
|
import com.cmvr.edge.client.service.EdgeArmService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -31,14 +32,20 @@ public class EdgeArmController {
|
|||||||
|
|
||||||
@ApiOperation("关闭力矩")
|
@ApiOperation("关闭力矩")
|
||||||
@GetMapping("/torqueOff")
|
@GetMapping("/torqueOff")
|
||||||
public AjaxResult torqueOff(EdgeCommonVO vo) {
|
public AjaxResult torqueOff(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true) @RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO vo = commonVo(robotId, deviceId);
|
||||||
edgeArmService.torqueOff(vo);
|
edgeArmService.torqueOff(vo);
|
||||||
return AjaxResult.ok();
|
return AjaxResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("开启力矩")
|
@ApiOperation("开启力矩")
|
||||||
@GetMapping("/torqueOn")
|
@GetMapping("/torqueOn")
|
||||||
public AjaxResult torqueOn(EdgeCommonVO vo) {
|
public AjaxResult torqueOn(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true) @RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO vo = commonVo(robotId, deviceId);
|
||||||
edgeArmService.torqueOn(vo);
|
edgeArmService.torqueOn(vo);
|
||||||
return AjaxResult.ok();
|
return AjaxResult.ok();
|
||||||
}
|
}
|
||||||
@ -48,7 +55,10 @@ public class EdgeArmController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("清除故障")
|
@ApiOperation("清除故障")
|
||||||
@GetMapping("/clearFault")
|
@GetMapping("/clearFault")
|
||||||
public AjaxResult clearFault(EdgeCommonVO vo) {
|
public AjaxResult clearFault(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true) @RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO vo = commonVo(robotId, deviceId);
|
||||||
edgeArmService.clearFault(vo);
|
edgeArmService.clearFault(vo);
|
||||||
return AjaxResult.ok();
|
return AjaxResult.ok();
|
||||||
}
|
}
|
||||||
@ -126,14 +136,20 @@ public class EdgeArmController {
|
|||||||
|
|
||||||
@ApiOperation("停止运动")
|
@ApiOperation("停止运动")
|
||||||
@GetMapping("/stopMotion")
|
@GetMapping("/stopMotion")
|
||||||
public AjaxResult stopMotion(EdgeCommonVO vo) {
|
public AjaxResult stopMotion(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true) @RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO vo = commonVo(robotId, deviceId);
|
||||||
edgeArmService.stopMotion(vo);
|
edgeArmService.stopMotion(vo);
|
||||||
return AjaxResult.ok();
|
return AjaxResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("获取关节状态")
|
@ApiOperation("获取关节状态")
|
||||||
@GetMapping("/getJointState")
|
@GetMapping("/getJointState")
|
||||||
public AjaxResult getJointState(EdgeCommonVO vo) {
|
public AjaxResult getJointState(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true) @RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO vo = commonVo(robotId, deviceId);
|
||||||
ArmCommand.JointResponse result = edgeArmService.getJointState(vo);
|
ArmCommand.JointResponse result = edgeArmService.getJointState(vo);
|
||||||
ArmCommand.JointState state = result.getState();
|
ArmCommand.JointState state = result.getState();
|
||||||
|
|
||||||
@ -150,7 +166,12 @@ public class EdgeArmController {
|
|||||||
|
|
||||||
@ApiOperation("获取末端位姿")
|
@ApiOperation("获取末端位姿")
|
||||||
@GetMapping("/getPose")
|
@GetMapping("/getPose")
|
||||||
public AjaxResult getPose(@Validated EdgeArmPoseQueryVO vo) {
|
public AjaxResult getPose(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true) @RequestParam("deviceId") String deviceId,
|
||||||
|
@ApiParam("基座连杆名称") @RequestParam(value = "baseLink", required = false) String baseLink,
|
||||||
|
@ApiParam("末端执行器连杆名称") @RequestParam(value = "eeLink", required = false) String eeLink) {
|
||||||
|
EdgeArmPoseQueryVO vo = poseQueryVo(robotId, deviceId, baseLink, eeLink);
|
||||||
ArmCommand.GetPose.Response result = edgeArmService.getPose(vo, vo.getBaseLink(), vo.getEeLink());
|
ArmCommand.GetPose.Response result = edgeArmService.getPose(vo, vo.getBaseLink(), vo.getEeLink());
|
||||||
ArmCommand.CartesianPose pose = result.getPose();
|
ArmCommand.CartesianPose pose = result.getPose();
|
||||||
|
|
||||||
@ -168,14 +189,26 @@ public class EdgeArmController {
|
|||||||
|
|
||||||
@ApiOperation("标定零点")
|
@ApiOperation("标定零点")
|
||||||
@GetMapping("/calibrateZeroQ")
|
@GetMapping("/calibrateZeroQ")
|
||||||
public AjaxResult calibrateZeroQ(@Validated EdgeArmCalibrateZeroQVO vo) {
|
public AjaxResult calibrateZeroQ(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true) @RequestParam("deviceId") String deviceId,
|
||||||
|
@ApiParam(value = "关节名称", required = true) @RequestParam("jointName") String jointName) {
|
||||||
|
EdgeArmCalibrateZeroQVO vo = new EdgeArmCalibrateZeroQVO();
|
||||||
|
vo.setRobotId(robotId);
|
||||||
|
vo.setDeviceId(deviceId);
|
||||||
|
vo.setJointName(jointName);
|
||||||
edgeArmService.calibrateZeroQ(vo, vo.getJointName());
|
edgeArmService.calibrateZeroQ(vo, vo.getJointName());
|
||||||
return AjaxResult.ok();
|
return AjaxResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("获取位姿矩阵")
|
@ApiOperation("获取位姿矩阵")
|
||||||
@GetMapping("/getPoseMatrix")
|
@GetMapping("/getPoseMatrix")
|
||||||
public AjaxResult getPoseMatrix(@Validated EdgeArmPoseQueryVO vo) {
|
public AjaxResult getPoseMatrix(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true) @RequestParam("deviceId") String deviceId,
|
||||||
|
@ApiParam("基座连杆名称") @RequestParam(value = "baseLink", required = false) String baseLink,
|
||||||
|
@ApiParam("末端执行器连杆名称") @RequestParam(value = "eeLink", required = false) String eeLink) {
|
||||||
|
EdgeArmPoseQueryVO vo = poseQueryVo(robotId, deviceId, baseLink, eeLink);
|
||||||
ArmCommand.GetPoseMatrix.Response result = edgeArmService.getPoseMatrix(vo, vo.getBaseLink(), vo.getEeLink());
|
ArmCommand.GetPoseMatrix.Response result = edgeArmService.getPoseMatrix(vo, vo.getBaseLink(), vo.getEeLink());
|
||||||
// 将TransformMatrix4x4转换为Map
|
// 将TransformMatrix4x4转换为Map
|
||||||
ArmCommand.TransformMatrix4x4 matrix = result.getMatrix();
|
ArmCommand.TransformMatrix4x4 matrix = result.getMatrix();
|
||||||
@ -229,4 +262,20 @@ public class EdgeArmController {
|
|||||||
matrixMap.put("m33", matrix.getM33());
|
matrixMap.put("m33", matrix.getM33());
|
||||||
return AjaxResult.ok(matrixMap);
|
return AjaxResult.ok(matrixMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private EdgeCommonVO commonVo(String robotId, String deviceId) {
|
||||||
|
EdgeCommonVO vo = new EdgeCommonVO();
|
||||||
|
vo.setRobotId(robotId);
|
||||||
|
vo.setDeviceId(deviceId);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
private EdgeArmPoseQueryVO poseQueryVo(String robotId, String deviceId, String baseLink, String eeLink) {
|
||||||
|
EdgeArmPoseQueryVO vo = new EdgeArmPoseQueryVO();
|
||||||
|
vo.setRobotId(robotId);
|
||||||
|
vo.setDeviceId(deviceId);
|
||||||
|
vo.setBaseLink(baseLink);
|
||||||
|
vo.setEeLink(eeLink);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.cmvr.web.controller.api;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.edge.client.model.armteleop.EdgeArmTeleopHeartbeatVO;
|
||||||
|
import com.cmvr.edge.client.model.armteleop.EdgeArmTeleopOpenVO;
|
||||||
|
import com.cmvr.edge.client.model.armteleop.EdgeArmTeleopSetpointVO;
|
||||||
|
import com.cmvr.edge.client.model.armteleop.EdgeArmTeleopStopVO;
|
||||||
|
import com.cmvr.edge.client.service.EdgeArmTeleopService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Api(tags = "Edge - Arm teleoperation")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/edge/armTeleop")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EdgeArmTeleopController extends BaseController {
|
||||||
|
|
||||||
|
private final EdgeArmTeleopService edgeArmTeleopService;
|
||||||
|
|
||||||
|
@ApiOperation("Open an arm teleoperation session")
|
||||||
|
@PostMapping("/open")
|
||||||
|
public AjaxResult open(@RequestBody EdgeArmTeleopOpenVO request) {
|
||||||
|
return success(edgeArmTeleopService.open(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Send an arm joint setpoint")
|
||||||
|
@PostMapping("/setpoint")
|
||||||
|
public AjaxResult setpoint(@RequestBody EdgeArmTeleopSetpointVO request) {
|
||||||
|
edgeArmTeleopService.sendSetpoint(request);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Send a teleoperation heartbeat")
|
||||||
|
@PostMapping("/heartbeat")
|
||||||
|
public AjaxResult heartbeat(@RequestBody EdgeArmTeleopHeartbeatVO request) {
|
||||||
|
edgeArmTeleopService.heartbeat(request);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Get the latest teleoperation state")
|
||||||
|
@GetMapping("/status")
|
||||||
|
public AjaxResult status(@RequestParam("sessionId") String sessionId) {
|
||||||
|
Object status = edgeArmTeleopService.getStatus(sessionId);
|
||||||
|
return success(status == null ? null : JSON.toJSONString(status));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Stop an arm teleoperation session")
|
||||||
|
@PostMapping("/stop")
|
||||||
|
public AjaxResult stop(@RequestBody EdgeArmTeleopStopVO request) {
|
||||||
|
edgeArmTeleopService.stop(request);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -4,13 +4,24 @@ import com.alibaba.fastjson2.JSON;
|
|||||||
import com.cmvr.common.core.controller.BaseController;
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
import com.cmvr.common.core.domain.AjaxResult;
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
import com.cmvr.edge.client.model.EdgeCommonVO;
|
import com.cmvr.edge.client.model.EdgeCommonVO;
|
||||||
|
import com.cmvr.edge.client.model.camera.EdgeCameraPtzVO;
|
||||||
import com.cmvr.edge.client.service.EdgeCameraService;
|
import com.cmvr.edge.client.service.EdgeCameraService;
|
||||||
|
import com.cmvr.web.service.CameraStreamTicketService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.http.CacheControl;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;
|
||||||
|
|
||||||
@Api(tags = "边缘--相机")
|
@Api(tags = "边缘--相机")
|
||||||
@RestController
|
@RestController
|
||||||
@ -19,46 +30,127 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
public class EdgeCameraController extends BaseController {
|
public class EdgeCameraController extends BaseController {
|
||||||
|
|
||||||
private final EdgeCameraService edgeCameraService;
|
private final EdgeCameraService edgeCameraService;
|
||||||
|
private final CameraStreamTicketService cameraStreamTicketService;
|
||||||
|
|
||||||
@ApiOperation("获取相机状态")
|
@ApiOperation("获取相机状态")
|
||||||
@GetMapping("/status")
|
@GetMapping("/status")
|
||||||
public AjaxResult status(EdgeCommonVO edgeCommonVO) {
|
public AjaxResult status(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true) @RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO edgeCommonVO = commonVo(robotId, deviceId);
|
||||||
return success(JSON.toJSONString(edgeCameraService.status(edgeCommonVO)));
|
return success(JSON.toJSONString(edgeCameraService.status(edgeCommonVO)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("开启相机")
|
@ApiOperation("开启相机")
|
||||||
@GetMapping("/start")
|
@GetMapping("/start")
|
||||||
public AjaxResult start(EdgeCommonVO edgeCommonVO) {
|
public AjaxResult start(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true) @RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO edgeCommonVO = commonVo(robotId, deviceId);
|
||||||
return success(edgeCameraService.start(edgeCommonVO));
|
return success(edgeCameraService.start(edgeCommonVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("关闭相机")
|
@ApiOperation("关闭相机")
|
||||||
@GetMapping("/stop")
|
@GetMapping("/stop")
|
||||||
public AjaxResult stop(EdgeCommonVO edgeCommonVO) {
|
public AjaxResult stop(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true) @RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO edgeCommonVO = commonVo(robotId, deviceId);
|
||||||
return success(edgeCameraService.stop(edgeCommonVO));
|
return success(edgeCameraService.stop(edgeCommonVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("获取图片")
|
@ApiOperation("获取图片")
|
||||||
@GetMapping("/getRGBImage")
|
@GetMapping("/getRGBImage")
|
||||||
public AjaxResult getRGBImage(EdgeCommonVO edgeCommonVO) {
|
public AjaxResult getRGBImage(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true) @RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO edgeCommonVO = commonVo(robotId, deviceId);
|
||||||
return success(edgeCameraService.getRGBImage(edgeCommonVO));
|
return success(edgeCameraService.getRGBImage(edgeCommonVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Get one depth image")
|
||||||
|
@GetMapping("/getDepthImage")
|
||||||
|
public AjaxResult getDepthImage(
|
||||||
|
@RequestParam("robotId") String robotId,
|
||||||
|
@RequestParam("deviceId") String deviceId) {
|
||||||
|
return success(edgeCameraService.getDepthImage(commonVo(robotId, deviceId)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Control camera PTZ")
|
||||||
|
@PostMapping("/controlPtz")
|
||||||
|
public AjaxResult controlPtz(@RequestBody EdgeCameraPtzVO request) {
|
||||||
|
return success(edgeCameraService.controlPtz(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Get a short-lived RGB video stream URL")
|
||||||
|
@GetMapping("/rgb-stream-url")
|
||||||
|
public AjaxResult rgbStreamUrl(
|
||||||
|
@RequestParam("robotId") String robotId,
|
||||||
|
@RequestParam("deviceId") String deviceId) {
|
||||||
|
String ticket = cameraStreamTicketService.issue(robotId, deviceId);
|
||||||
|
return success((Object) ("/api/edge/camera/rgb-stream?ticket=" + ticket));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("RGB fragmented MP4 live stream")
|
||||||
|
@GetMapping(value = "/rgb-stream", produces = "video/mp4")
|
||||||
|
public ResponseEntity<StreamingResponseBody> rgbStream(@RequestParam("ticket") String ticket) {
|
||||||
|
CameraStreamTicketService.StreamTarget target = cameraStreamTicketService.consume(ticket);
|
||||||
|
if (target == null) {
|
||||||
|
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();
|
||||||
|
}
|
||||||
|
return videoStreamResponse(target.robotId(), target.deviceId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Public RGB fragmented MP4 live stream")
|
||||||
|
@GetMapping(value = "/rgb-stream/public", produces = "video/mp4")
|
||||||
|
public ResponseEntity<StreamingResponseBody> publicRgbStream(
|
||||||
|
@RequestParam("robotId") String robotId,
|
||||||
|
@RequestParam("deviceId") String deviceId) {
|
||||||
|
return videoStreamResponse(robotId, deviceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ResponseEntity<StreamingResponseBody> videoStreamResponse(String robotId, String deviceId) {
|
||||||
|
StreamingResponseBody body = outputStream -> edgeCameraService.writeRGBVideoStream(
|
||||||
|
robotId, deviceId, outputStream);
|
||||||
|
return ResponseEntity.ok()
|
||||||
|
.contentType(MediaType.parseMediaType("video/mp4"))
|
||||||
|
.cacheControl(CacheControl.noStore())
|
||||||
|
.header("X-Accel-Buffering", "no")
|
||||||
|
.header("X-Content-Type-Options", "nosniff")
|
||||||
|
.body(body);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("开始录制视频")
|
@ApiOperation("开始录制视频")
|
||||||
@GetMapping("/startRecording")
|
@GetMapping("/startRecording")
|
||||||
public AjaxResult startRecording(EdgeCommonVO edgeCommonVO) {
|
public AjaxResult startRecording(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true) @RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO edgeCommonVO = commonVo(robotId, deviceId);
|
||||||
return success(edgeCameraService.startRecording(edgeCommonVO));
|
return success(edgeCameraService.startRecording(edgeCommonVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("停止录制视频")
|
@ApiOperation("停止录制视频")
|
||||||
@GetMapping("/stopRecording")
|
@GetMapping("/stopRecording")
|
||||||
public AjaxResult stopRecording(EdgeCommonVO edgeCommonVO) {
|
public AjaxResult stopRecording(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true) @RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO edgeCommonVO = commonVo(robotId, deviceId);
|
||||||
return success(edgeCameraService.stopRecording(edgeCommonVO));
|
return success(edgeCameraService.stopRecording(edgeCommonVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("获取图片和视频")
|
@ApiOperation("获取图片和视频")
|
||||||
@GetMapping("/getRGBDImages")
|
@GetMapping("/getRGBDImages")
|
||||||
public AjaxResult getRGBDImages(EdgeCommonVO edgeCommonVO) {
|
public AjaxResult getRGBDImages(
|
||||||
|
@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam("robotId") String robotId,
|
||||||
|
@ApiParam(value = "设备ID", required = true) @RequestParam("deviceId") String deviceId) {
|
||||||
|
EdgeCommonVO edgeCommonVO = commonVo(robotId, deviceId);
|
||||||
return success(edgeCameraService.getRGBDImages(edgeCommonVO));
|
return success(edgeCameraService.getRGBDImages(edgeCommonVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private EdgeCommonVO commonVo(String robotId, String deviceId) {
|
||||||
|
EdgeCommonVO vo = new EdgeCommonVO();
|
||||||
|
vo.setRobotId(robotId);
|
||||||
|
vo.setDeviceId(deviceId);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,9 +25,9 @@ public class EdgeDexHandController extends BaseController {
|
|||||||
@GetMapping("/status")
|
@GetMapping("/status")
|
||||||
public AjaxResult status(
|
public AjaxResult status(
|
||||||
@RequestParam("deviceId") String deviceId,
|
@RequestParam("deviceId") String deviceId,
|
||||||
@RequestParam("terminalId") String terminalId
|
@RequestParam("robotId") String robotId
|
||||||
) {
|
) {
|
||||||
return success(JSON.parseObject(JSON.toJSONString(edgeDexHandService.getStatus(terminalId, deviceId)), Map.class));
|
return success(JSON.parseObject(JSON.toJSONString(edgeDexHandService.getStatus(robotId, deviceId)), Map.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -35,11 +35,11 @@ public class EdgeDexHandController extends BaseController {
|
|||||||
@GetMapping("/angle")
|
@GetMapping("/angle")
|
||||||
public AjaxResult setAngle(
|
public AjaxResult setAngle(
|
||||||
@RequestParam("deviceId") String deviceId,
|
@RequestParam("deviceId") String deviceId,
|
||||||
@RequestParam("terminalId") String terminalId,
|
@RequestParam("robotId") String robotId,
|
||||||
@RequestParam("id") int id,
|
@RequestParam("id") int id,
|
||||||
@RequestParam("value") float value
|
@RequestParam("value") float value
|
||||||
) {
|
) {
|
||||||
edgeDexHandService.setDexHandAngle(terminalId, deviceId, id, value);
|
edgeDexHandService.setDexHandAngle(robotId, deviceId, id, value);
|
||||||
return success("ok");
|
return success("ok");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,8 +48,8 @@ public class EdgeDexHandController extends BaseController {
|
|||||||
@GetMapping("/sensor")
|
@GetMapping("/sensor")
|
||||||
public AjaxResult sensor(
|
public AjaxResult sensor(
|
||||||
@RequestParam("deviceId") String deviceId,
|
@RequestParam("deviceId") String deviceId,
|
||||||
@RequestParam("terminalId") String terminalId
|
@RequestParam("robotId") String robotId
|
||||||
) {
|
) {
|
||||||
return success(JSON.parseObject(edgeDexHandService.getSensorData(terminalId, deviceId), Map.class));
|
return success(JSON.parseObject(edgeDexHandService.getSensorData(robotId, deviceId), Map.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,9 +25,9 @@ public class EdgeMicrophoneController {
|
|||||||
@ApiOperation("获取麦克风状态")
|
@ApiOperation("获取麦克风状态")
|
||||||
@PreAuthorize("@ss.hasPermi('system:microphone:query')")
|
@PreAuthorize("@ss.hasPermi('system:microphone:query')")
|
||||||
@GetMapping("/status")
|
@GetMapping("/status")
|
||||||
public AjaxResult getStatus(@ApiParam(value = "终端设备ID", required = true) @RequestParam String terminalId, @ApiParam (value = "设备ID", required = true) @RequestParam String deviceId) {
|
public AjaxResult getStatus(@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam String robotId, @ApiParam (value = "设备ID", required = true) @RequestParam String deviceId) {
|
||||||
EdgeCommonVO edgeCommonVO = new EdgeCommonVO();
|
EdgeCommonVO edgeCommonVO = new EdgeCommonVO();
|
||||||
edgeCommonVO.setTerminalId(terminalId);
|
edgeCommonVO.setRobotId(robotId);
|
||||||
edgeCommonVO.setDeviceId(deviceId);
|
edgeCommonVO.setDeviceId(deviceId);
|
||||||
return AjaxResult.success(microphoneService.getStatus(edgeCommonVO));
|
return AjaxResult.success(microphoneService.getStatus(edgeCommonVO));
|
||||||
}
|
}
|
||||||
@ -75,9 +75,9 @@ public class EdgeMicrophoneController {
|
|||||||
@ApiOperation("获取音量")
|
@ApiOperation("获取音量")
|
||||||
@PreAuthorize("@ss.hasPermi('system:microphone:volume')")
|
@PreAuthorize("@ss.hasPermi('system:microphone:volume')")
|
||||||
@GetMapping("/volume")
|
@GetMapping("/volume")
|
||||||
public AjaxResult getVolume(@ApiParam(value = "终端设备ID", required = true) @RequestParam String terminalId, @ApiParam (value = "设备ID", required = true) @RequestParam String deviceId) {
|
public AjaxResult getVolume(@ApiParam(value = "机器人永久唯一ID", required = true) @RequestParam String robotId, @ApiParam (value = "设备ID", required = true) @RequestParam String deviceId) {
|
||||||
EdgeCommonVO edgeCommonVO = new EdgeCommonVO();
|
EdgeCommonVO edgeCommonVO = new EdgeCommonVO();
|
||||||
edgeCommonVO.setTerminalId(terminalId);
|
edgeCommonVO.setRobotId(robotId);
|
||||||
edgeCommonVO.setDeviceId(deviceId);
|
edgeCommonVO.setDeviceId(deviceId);
|
||||||
return AjaxResult.success(microphoneService.getVolume(edgeCommonVO));
|
return AjaxResult.success(microphoneService.getVolume(edgeCommonVO));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,114 @@
|
|||||||
|
package com.cmvr.web.controller.api;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.edge.client.model.motor.EdgeMotorCyclicOpenVO;
|
||||||
|
import com.cmvr.edge.client.model.motor.EdgeMotorCyclicSetpointVO;
|
||||||
|
import com.cmvr.edge.client.model.motor.EdgeMotorEnabledVO;
|
||||||
|
import com.cmvr.edge.client.model.motor.EdgeMotorMotionVO;
|
||||||
|
import com.cmvr.edge.client.model.motor.EdgeMotorTargetVO;
|
||||||
|
import com.cmvr.edge.client.service.EdgeMotorService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Api(tags = "Edge - Motor")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/edge/motor")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EdgeMotorController extends BaseController {
|
||||||
|
|
||||||
|
private final EdgeMotorService edgeMotorService;
|
||||||
|
|
||||||
|
@ApiOperation("Set the current motor position as zero")
|
||||||
|
@PostMapping("/setZero")
|
||||||
|
public AjaxResult setZero(@RequestBody EdgeMotorTargetVO request) {
|
||||||
|
return protobuf(edgeMotorService.setZero(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Move motor to zero")
|
||||||
|
@PostMapping("/moveToZero")
|
||||||
|
public AjaxResult moveToZero(@RequestBody EdgeMotorMotionVO request) {
|
||||||
|
return protobuf(edgeMotorService.moveToZero(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Execute profile position control")
|
||||||
|
@PostMapping("/profilePosition")
|
||||||
|
public AjaxResult profilePosition(@RequestBody EdgeMotorMotionVO request) {
|
||||||
|
return protobuf(edgeMotorService.profilePosition(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Execute profile velocity control")
|
||||||
|
@PostMapping("/profileVelocity")
|
||||||
|
public AjaxResult profileVelocity(@RequestBody EdgeMotorMotionVO request) {
|
||||||
|
return protobuf(edgeMotorService.profileVelocity(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Emergency stop a motor")
|
||||||
|
@PostMapping("/emergencyStop")
|
||||||
|
public AjaxResult emergencyStop(@RequestBody EdgeMotorTargetVO request) {
|
||||||
|
return protobuf(edgeMotorService.emergencyStop(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Get motor status")
|
||||||
|
@PostMapping("/status")
|
||||||
|
public AjaxResult status(@RequestBody EdgeMotorTargetVO request) {
|
||||||
|
return protobuf(edgeMotorService.getStatus(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Enable or disable a motor")
|
||||||
|
@PostMapping("/enabled")
|
||||||
|
public AjaxResult enabled(@RequestBody EdgeMotorEnabledVO request) {
|
||||||
|
return protobuf(edgeMotorService.setEnabled(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Open cyclic position stream")
|
||||||
|
@PostMapping("/cyclicPosition/open")
|
||||||
|
public AjaxResult openCyclicPosition(@RequestBody EdgeMotorCyclicOpenVO request) {
|
||||||
|
return success(edgeMotorService.openCyclicPosition(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Send cyclic position setpoint")
|
||||||
|
@PostMapping("/cyclicPosition/setpoint")
|
||||||
|
public AjaxResult cyclicPosition(@RequestBody EdgeMotorCyclicSetpointVO request) {
|
||||||
|
edgeMotorService.sendCyclicPosition(request);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Open cyclic velocity stream")
|
||||||
|
@PostMapping("/cyclicVelocity/open")
|
||||||
|
public AjaxResult openCyclicVelocity(@RequestBody EdgeMotorCyclicOpenVO request) {
|
||||||
|
return success(edgeMotorService.openCyclicVelocity(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Send cyclic velocity setpoint")
|
||||||
|
@PostMapping("/cyclicVelocity/setpoint")
|
||||||
|
public AjaxResult cyclicVelocity(@RequestBody EdgeMotorCyclicSetpointVO request) {
|
||||||
|
edgeMotorService.sendCyclicVelocity(request);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Get the latest cyclic stream response")
|
||||||
|
@GetMapping("/stream/status")
|
||||||
|
public AjaxResult streamStatus(@RequestParam("sessionId") String sessionId) {
|
||||||
|
return protobuf(edgeMotorService.getStreamStatus(sessionId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Close a cyclic stream")
|
||||||
|
@PostMapping("/stream/close")
|
||||||
|
public AjaxResult closeStream(@RequestParam("sessionId") String sessionId) {
|
||||||
|
edgeMotorService.closeStream(sessionId);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
private AjaxResult protobuf(Object value) {
|
||||||
|
return success(value == null ? null : JSON.toJSONString(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -33,13 +33,13 @@ public class EdgeSpeakerController {
|
|||||||
@PreAuthorize("@ss.hasPermi('system:speaker:query')")
|
@PreAuthorize("@ss.hasPermi('system:speaker:query')")
|
||||||
@GetMapping("/status")
|
@GetMapping("/status")
|
||||||
public AjaxResult getStatus(
|
public AjaxResult getStatus(
|
||||||
@ApiParam(value = "终端设备ID", required = true)
|
@ApiParam(value = "机器人永久唯一ID", required = true)
|
||||||
@RequestParam String terminalId,
|
@RequestParam String robotId,
|
||||||
@ApiParam(value = "设备ID", required = true)
|
@ApiParam(value = "设备ID", required = true)
|
||||||
@RequestParam String deviceId) {
|
@RequestParam String deviceId) {
|
||||||
try {
|
try {
|
||||||
// 获取扬声器状态
|
// 获取扬声器状态
|
||||||
SpeakerCommand.GetSpeakerStateCommand.Feedback feedback = speakerService.getStatus(terminalId, deviceId);
|
SpeakerCommand.GetSpeakerStateCommand.Feedback feedback = speakerService.getStatus(robotId, deviceId);
|
||||||
SpeakerCommand.SpeakerState state = feedback.getState();
|
SpeakerCommand.SpeakerState state = feedback.getState();
|
||||||
|
|
||||||
// 构建返回结果
|
// 构建返回结果
|
||||||
@ -73,7 +73,7 @@ public class EdgeSpeakerController {
|
|||||||
@PreAuthorize("@ss.hasPermi('system:speaker:play')")
|
@PreAuthorize("@ss.hasPermi('system:speaker:play')")
|
||||||
@PostMapping("/play")
|
@PostMapping("/play")
|
||||||
public AjaxResult playAudio(@RequestBody EdgeSpeakerPlayAudioVO edgeSpeakerPlayAudioVO) {
|
public AjaxResult playAudio(@RequestBody EdgeSpeakerPlayAudioVO edgeSpeakerPlayAudioVO) {
|
||||||
speakerService.playAudio(edgeSpeakerPlayAudioVO.getTerminalId(), edgeSpeakerPlayAudioVO.getDeviceId(), edgeSpeakerPlayAudioVO.getAudioPath());
|
speakerService.playAudio(edgeSpeakerPlayAudioVO.getRobotId(), edgeSpeakerPlayAudioVO.getDeviceId(), edgeSpeakerPlayAudioVO.getAudioPath());
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ public class EdgeSpeakerController {
|
|||||||
@PreAuthorize("@ss.hasPermi('system:speaker:stop')")
|
@PreAuthorize("@ss.hasPermi('system:speaker:stop')")
|
||||||
@PostMapping("/stop")
|
@PostMapping("/stop")
|
||||||
public AjaxResult stopPlayback(@RequestBody EdgeCommonVO edgeCommonVO) {
|
public AjaxResult stopPlayback(@RequestBody EdgeCommonVO edgeCommonVO) {
|
||||||
speakerService.stopPlayback(edgeCommonVO.getTerminalId(), edgeCommonVO.getDeviceId());
|
speakerService.stopPlayback(edgeCommonVO.getRobotId(), edgeCommonVO.getDeviceId());
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ public class EdgeSpeakerController {
|
|||||||
@PreAuthorize("@ss.hasPermi('system:speaker:pause')")
|
@PreAuthorize("@ss.hasPermi('system:speaker:pause')")
|
||||||
@PostMapping("/pause")
|
@PostMapping("/pause")
|
||||||
public AjaxResult pausePlayback(@RequestBody EdgeCommonVO edgeCommonVO) {
|
public AjaxResult pausePlayback(@RequestBody EdgeCommonVO edgeCommonVO) {
|
||||||
speakerService.pausePlayback(edgeCommonVO.getTerminalId(), edgeCommonVO.getDeviceId());
|
speakerService.pausePlayback(edgeCommonVO.getRobotId(), edgeCommonVO.getDeviceId());
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ public class EdgeSpeakerController {
|
|||||||
@PreAuthorize("@ss.hasPermi('system:speaker:resume')")
|
@PreAuthorize("@ss.hasPermi('system:speaker:resume')")
|
||||||
@PostMapping("/resume")
|
@PostMapping("/resume")
|
||||||
public AjaxResult resumePlayback(@RequestBody EdgeCommonVO edgeCommonVO) {
|
public AjaxResult resumePlayback(@RequestBody EdgeCommonVO edgeCommonVO) {
|
||||||
speakerService.resumePlayback(edgeCommonVO.getTerminalId(), edgeCommonVO.getDeviceId());
|
speakerService.resumePlayback(edgeCommonVO.getRobotId(), edgeCommonVO.getDeviceId());
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ public class EdgeSpeakerController {
|
|||||||
@PreAuthorize("@ss.hasPermi('system:speaker:volume')")
|
@PreAuthorize("@ss.hasPermi('system:speaker:volume')")
|
||||||
@PostMapping("/volume")
|
@PostMapping("/volume")
|
||||||
public AjaxResult setVolume(@RequestBody EdgeMicrophoneVolumeVO edgeMicrophoneVolumeVO) {
|
public AjaxResult setVolume(@RequestBody EdgeMicrophoneVolumeVO edgeMicrophoneVolumeVO) {
|
||||||
speakerService.setVolume(edgeMicrophoneVolumeVO.getTerminalId(), edgeMicrophoneVolumeVO.getDeviceId(), edgeMicrophoneVolumeVO.getVolume());
|
speakerService.setVolume(edgeMicrophoneVolumeVO.getRobotId(), edgeMicrophoneVolumeVO.getDeviceId(), edgeMicrophoneVolumeVO.getVolume());
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,11 +128,11 @@ public class EdgeSpeakerController {
|
|||||||
@PreAuthorize("@ss.hasPermi('system:speaker:volume')")
|
@PreAuthorize("@ss.hasPermi('system:speaker:volume')")
|
||||||
@GetMapping("/volume")
|
@GetMapping("/volume")
|
||||||
public AjaxResult getVolume(
|
public AjaxResult getVolume(
|
||||||
@ApiParam(value = "终端设备ID", required = true)
|
@ApiParam(value = "机器人永久唯一ID", required = true)
|
||||||
@RequestParam String terminalId,
|
@RequestParam String robotId,
|
||||||
@ApiParam(value = "设备ID", required = true)
|
@ApiParam(value = "设备ID", required = true)
|
||||||
@RequestParam String deviceId) {
|
@RequestParam String deviceId) {
|
||||||
return AjaxResult.success(speakerService.getVolume(terminalId, deviceId));
|
return AjaxResult.success(speakerService.getVolume(robotId, deviceId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("获取所有音频")
|
@ApiOperation("获取所有音频")
|
||||||
|
|||||||
@ -1,12 +1,18 @@
|
|||||||
package com.cmvr.web.controller.api;
|
package com.cmvr.web.controller.api;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.cmvr.common.core.controller.BaseController;
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
import com.cmvr.common.core.domain.AjaxResult;
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.edge.client.model.system.EdgeSystemJsonCommandVO;
|
||||||
|
import com.cmvr.edge.client.model.system.EdgeSystemUpdateParamsVO;
|
||||||
import com.cmvr.edge.client.service.EdgeSystemService;
|
import com.cmvr.edge.client.service.EdgeSystemService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@ -18,9 +24,33 @@ public class EdgeSystemController extends BaseController {
|
|||||||
|
|
||||||
private final EdgeSystemService edgeSystemService;
|
private final EdgeSystemService edgeSystemService;
|
||||||
|
|
||||||
|
@ApiOperation("Get edge system information")
|
||||||
|
@GetMapping("/info")
|
||||||
|
public AjaxResult info(@RequestParam("robotId") String robotId) {
|
||||||
|
return success(JSON.toJSONString(edgeSystemService.getSystemInfo(robotId)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Get edge system runtime status")
|
||||||
|
@GetMapping("/status")
|
||||||
|
public AjaxResult status(@RequestParam("robotId") String robotId) {
|
||||||
|
return success(JSON.toJSONString(edgeSystemService.getSystemStatus(robotId)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Update edge device parameters")
|
||||||
|
@PostMapping("/params")
|
||||||
|
public AjaxResult updateParams(@RequestBody EdgeSystemUpdateParamsVO request) {
|
||||||
|
return success(JSON.toJSONString(edgeSystemService.updateParams(request)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Execute a JSON device command")
|
||||||
|
@PostMapping("/executeJsonCommand")
|
||||||
|
public AjaxResult executeJsonCommand(@RequestBody EdgeSystemJsonCommandVO request) {
|
||||||
|
return success(JSON.toJSONString(edgeSystemService.executeJsonCommand(request)));
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("停止所有设备")
|
@ApiOperation("停止所有设备")
|
||||||
@GetMapping("/stopAll")
|
@GetMapping("/stopAll")
|
||||||
public AjaxResult stopAll(String terminalId) {
|
public AjaxResult stopAll(@RequestParam("robotId") String robotId) {
|
||||||
return AjaxResult.ok(edgeSystemService.stopAll(terminalId));
|
return AjaxResult.ok(edgeSystemService.stopAll(robotId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package com.cmvr.web.controller.inspection;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import cmvr.msgs.Agv;
|
import cmvr.msgs.AgvUtils;
|
||||||
import com.cmvr.inspection.domain.vo.InspectionRobotVo;
|
import com.cmvr.inspection.domain.vo.InspectionRobotVo;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
@ -70,6 +70,25 @@ public class InspectionRobotController extends BaseController
|
|||||||
return success(inspectionRobotService.selectInspectionRobotById(id));
|
return success(inspectionRobotService.selectInspectionRobotById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询机器人自动发现的设备")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:robot:query')")
|
||||||
|
@GetMapping("/{id}/devices")
|
||||||
|
public AjaxResult devices(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return success(inspectionRobotService.selectRobotDevices(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("按机器人ID查询自动发现的设备")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:robot:query')")
|
||||||
|
@GetMapping("/devices")
|
||||||
|
public AjaxResult devicesByRobotId(
|
||||||
|
@RequestParam @ApiParam(value = "机器人永久唯一ID", required = true) String robotId,
|
||||||
|
@RequestParam(required = false) @ApiParam("设备类型") Integer deviceKind,
|
||||||
|
@RequestParam(defaultValue = "true") @ApiParam("是否只查询在线且启用的设备") boolean onlineOnly)
|
||||||
|
{
|
||||||
|
return success(inspectionRobotService.selectRobotDevicesByRobotId(robotId, deviceKind, onlineOnly));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增巡检机器人
|
* 新增巡检机器人
|
||||||
*/
|
*/
|
||||||
@ -180,7 +199,7 @@ public class InspectionRobotController extends BaseController
|
|||||||
@GetMapping("/{robotId}/location")
|
@GetMapping("/{robotId}/location")
|
||||||
public AjaxResult getRobotRealtimeLocation(@PathVariable String robotId)
|
public AjaxResult getRobotRealtimeLocation(@PathVariable String robotId)
|
||||||
{
|
{
|
||||||
Agv.AgvPose2d location = inspectionRobotService.getRobotRealtimeLocation(robotId);
|
AgvUtils.AgvPose2d location = inspectionRobotService.getRobotRealtimeLocation(robotId);
|
||||||
return success(location);
|
return success(location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -157,7 +157,8 @@ public class TeFlowController extends BaseController {
|
|||||||
|
|
||||||
@PostMapping("/action")
|
@PostMapping("/action")
|
||||||
@ApiOperation(value = "单个节点执行",
|
@ApiOperation(value = "单个节点执行",
|
||||||
notes = "巡检仪表节点action=INSPECTION_METER_RECOGNIZE,payload使用InspectionMeterRecognizeConfigVO;"
|
notes = "设备通用指令action=DEVICE_EXECUTE_JSON_COMMAND,payload需要robotId、deviceId、requestJson;"
|
||||||
|
+ "巡检仪表节点action=INSPECTION_METER_RECOGNIZE,payload使用InspectionMeterRecognizeConfigVO;"
|
||||||
+ "人工判断节点action=INSPECTION_MANUAL_REVIEW_CREATE,payload使用InspectionManualReviewConfigVO。"
|
+ "人工判断节点action=INSPECTION_MANUAL_REVIEW_CREATE,payload使用InspectionManualReviewConfigVO。"
|
||||||
+ "该接口用于试调节点,不会生成正式巡检任务结果")
|
+ "该接口用于试调节点,不会生成正式巡检任务结果")
|
||||||
public AjaxResult actionExecute(
|
public AjaxResult actionExecute(
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class TeFlowiseController extends BaseController {
|
|||||||
runParams.put("5bb26d52e1861c6936f3c3149eaf17e8", runParams1);
|
runParams.put("5bb26d52e1861c6936f3c3149eaf17e8", runParams1);
|
||||||
TeTaskExecuteNormalVO taskExecuteNormalVO = TeTaskExecuteNormalVO.builder()
|
TeTaskExecuteNormalVO taskExecuteNormalVO = TeTaskExecuteNormalVO.builder()
|
||||||
.taskId("b6ab5ffff783d9b25d0dc34f13be222d")
|
.taskId("b6ab5ffff783d9b25d0dc34f13be222d")
|
||||||
.terminalId("4ed1246c465b97975f96c9ef8371a3bd")
|
.robotId("4ed1246c465b97975f96c9ef8371a3bd")
|
||||||
.runParams(JSONObject.from(runParams)).build();
|
.runParams(JSONObject.from(runParams)).build();
|
||||||
if (!taskInstIdList.isEmpty()) {
|
if (!taskInstIdList.isEmpty()) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -0,0 +1,38 @@
|
|||||||
|
package com.cmvr.web.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CameraStreamTicketService {
|
||||||
|
|
||||||
|
private static final long TICKET_LIFETIME_MILLIS = Duration.ofSeconds(30).toMillis();
|
||||||
|
private final Map<String, StreamTarget> tickets = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
public String issue(String robotId, String deviceId) {
|
||||||
|
long now = System.currentTimeMillis();
|
||||||
|
tickets.entrySet().removeIf(entry -> entry.getValue().expiresAt() < now);
|
||||||
|
String ticket = UUID.randomUUID().toString().replace("-", "");
|
||||||
|
tickets.put(ticket, new StreamTarget(robotId, deviceId, now + TICKET_LIFETIME_MILLIS));
|
||||||
|
return ticket;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StreamTarget consume(String ticket) {
|
||||||
|
if (ticket == null || ticket.isBlank()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
StreamTarget target = tickets.get(ticket);
|
||||||
|
if (target == null || target.expiresAt() < System.currentTimeMillis()) {
|
||||||
|
tickets.remove(ticket);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
public record StreamTarget(String robotId, String deviceId, long expiresAt) {
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -62,33 +62,33 @@ public class RobotAudioGrpcAdapter {
|
|||||||
private final GrpcServiceManager grpcServiceManager;
|
private final GrpcServiceManager grpcServiceManager;
|
||||||
private final ConcurrentMap<String, RobotAudioStream> streams = new ConcurrentHashMap<>();
|
private final ConcurrentMap<String, RobotAudioStream> streams = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public RobotAudioStream openStream(String terminalId,
|
public RobotAudioStream openStream(String robotId,
|
||||||
String deviceId,
|
String deviceId,
|
||||||
String sessionId,
|
String sessionId,
|
||||||
String operatorId,
|
String operatorId,
|
||||||
RobotAudioStreamListener listener) {
|
RobotAudioStreamListener listener) {
|
||||||
return openStream(terminalId, deviceId, deviceId, sessionId, operatorId, listener);
|
return openStream(robotId, deviceId, deviceId, sessionId, operatorId, listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RobotAudioStream openStream(String terminalId,
|
public RobotAudioStream openStream(String robotId,
|
||||||
String speakerDeviceId,
|
String speakerDeviceId,
|
||||||
String micDeviceId,
|
String micDeviceId,
|
||||||
String sessionId,
|
String sessionId,
|
||||||
String operatorId,
|
String operatorId,
|
||||||
RobotAudioStreamListener listener) {
|
RobotAudioStreamListener listener) {
|
||||||
SpeakerServiceGrpc.SpeakerServiceStub speakerStub =
|
SpeakerServiceGrpc.SpeakerServiceStub speakerStub =
|
||||||
grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceStub.class);
|
grpcServiceManager.getGrpcClient(robotId, SpeakerServiceGrpc.SpeakerServiceStub.class);
|
||||||
MicPhoneServiceGrpc.MicPhoneServiceStub micStub =
|
MicPhoneServiceGrpc.MicPhoneServiceStub micStub =
|
||||||
grpcServiceManager.getGrpcClient(terminalId, MicPhoneServiceGrpc.MicPhoneServiceStub.class);
|
grpcServiceManager.getGrpcClient(robotId, MicPhoneServiceGrpc.MicPhoneServiceStub.class);
|
||||||
SpeakerServiceGrpc.SpeakerServiceBlockingStub speakerBlockingStub =
|
SpeakerServiceGrpc.SpeakerServiceBlockingStub speakerBlockingStub =
|
||||||
grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
grpcServiceManager.getGrpcClient(robotId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
||||||
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub micBlockingStub =
|
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub micBlockingStub =
|
||||||
grpcServiceManager.getGrpcClient(terminalId, MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
grpcServiceManager.getGrpcClient(robotId, MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
||||||
|
|
||||||
preflightDeviceStatus(speakerBlockingStub, micBlockingStub, speakerDeviceId, micDeviceId, sessionId);
|
preflightDeviceStatus(speakerBlockingStub, micBlockingStub, speakerDeviceId, micDeviceId, sessionId);
|
||||||
|
|
||||||
RobotAudioStream stream = new RobotAudioStream(
|
RobotAudioStream stream = new RobotAudioStream(
|
||||||
terminalId, speakerDeviceId, micDeviceId, sessionId, operatorId, speakerStub, micStub, listener);
|
robotId, speakerDeviceId, micDeviceId, sessionId, operatorId, speakerStub, micStub, listener);
|
||||||
RobotAudioStream exists = streams.putIfAbsent(sessionId, stream);
|
RobotAudioStream exists = streams.putIfAbsent(sessionId, stream);
|
||||||
if (exists != null) {
|
if (exists != null) {
|
||||||
throw new IllegalStateException("实时语音会话已存在:" + sessionId);
|
throw new IllegalStateException("实时语音会话已存在:" + sessionId);
|
||||||
@ -96,8 +96,8 @@ public class RobotAudioGrpcAdapter {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
stream.start();
|
stream.start();
|
||||||
log.info("实时对讲 gRPC 流已创建,sessionId={},terminalId={},speakerDeviceId={},micDeviceId={},operatorId={},sampleRate={},channels={},bits={},frameMs={},frameBytes={}",
|
log.info("实时对讲 gRPC 流已创建,sessionId={},robotId={},speakerDeviceId={},micDeviceId={},operatorId={},sampleRate={},channels={},bits={},frameMs={},frameBytes={}",
|
||||||
sessionId, terminalId, speakerDeviceId, micDeviceId, operatorId, SAMPLE_RATE, CHANNELS, BITS_PER_SAMPLE, FRAME_MS, FRAME_BYTES);
|
sessionId, robotId, speakerDeviceId, micDeviceId, operatorId, SAMPLE_RATE, CHANNELS, BITS_PER_SAMPLE, FRAME_MS, FRAME_BYTES);
|
||||||
return stream;
|
return stream;
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
streams.remove(sessionId, stream);
|
streams.remove(sessionId, stream);
|
||||||
@ -163,7 +163,7 @@ public class RobotAudioGrpcAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class RobotAudioStream {
|
public class RobotAudioStream {
|
||||||
private final String terminalId;
|
private final String robotId;
|
||||||
private final String speakerDeviceId;
|
private final String speakerDeviceId;
|
||||||
private final String micDeviceId;
|
private final String micDeviceId;
|
||||||
private final String sessionId;
|
private final String sessionId;
|
||||||
@ -190,7 +190,7 @@ public class RobotAudioGrpcAdapter {
|
|||||||
private volatile long lastStatsLogAt;
|
private volatile long lastStatsLogAt;
|
||||||
private volatile byte[] pendingBrowserBytes = new byte[0];
|
private volatile byte[] pendingBrowserBytes = new byte[0];
|
||||||
|
|
||||||
private RobotAudioStream(String terminalId,
|
private RobotAudioStream(String robotId,
|
||||||
String speakerDeviceId,
|
String speakerDeviceId,
|
||||||
String micDeviceId,
|
String micDeviceId,
|
||||||
String sessionId,
|
String sessionId,
|
||||||
@ -198,7 +198,7 @@ public class RobotAudioGrpcAdapter {
|
|||||||
SpeakerServiceGrpc.SpeakerServiceStub speakerStub,
|
SpeakerServiceGrpc.SpeakerServiceStub speakerStub,
|
||||||
MicPhoneServiceGrpc.MicPhoneServiceStub micStub,
|
MicPhoneServiceGrpc.MicPhoneServiceStub micStub,
|
||||||
RobotAudioStreamListener listener) {
|
RobotAudioStreamListener listener) {
|
||||||
this.terminalId = terminalId;
|
this.robotId = robotId;
|
||||||
this.speakerDeviceId = speakerDeviceId;
|
this.speakerDeviceId = speakerDeviceId;
|
||||||
this.micDeviceId = micDeviceId;
|
this.micDeviceId = micDeviceId;
|
||||||
this.sessionId = sessionId;
|
this.sessionId = sessionId;
|
||||||
@ -365,8 +365,8 @@ public class RobotAudioGrpcAdapter {
|
|||||||
return sessionId;
|
return sessionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTerminalId() {
|
public String getRobotId() {
|
||||||
return terminalId;
|
return robotId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDeviceId() {
|
public String getDeviceId() {
|
||||||
@ -639,8 +639,8 @@ public class RobotAudioGrpcAdapter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Throwable actual = throwable == null ? new RuntimeException("audio stream failed") : throwable;
|
Throwable actual = throwable == null ? new RuntimeException("audio stream failed") : throwable;
|
||||||
log.error("实时对讲 gRPC 流异常,source={},sessionId={},terminalId={},speakerDeviceId={},micDeviceId={}",
|
log.error("实时对讲 gRPC 流异常,source={},sessionId={},robotId={},speakerDeviceId={},micDeviceId={}",
|
||||||
source, sessionId, terminalId, speakerDeviceId, micDeviceId, actual);
|
source, sessionId, robotId, speakerDeviceId, micDeviceId, actual);
|
||||||
sendExecutor.execute(new Runnable() {
|
sendExecutor.execute(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -660,7 +660,7 @@ public class RobotAudioGrpcAdapter {
|
|||||||
if (!closed.compareAndSet(false, true)) {
|
if (!closed.compareAndSet(false, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
log.info("实时对讲 gRPC 流远端结束,sessionId={},terminalId={},speakerDeviceId={},micDeviceId={}", sessionId, terminalId, speakerDeviceId, micDeviceId);
|
log.info("实时对讲 gRPC 流远端结束,sessionId={},robotId={},speakerDeviceId={},micDeviceId={}", sessionId, robotId, speakerDeviceId, micDeviceId);
|
||||||
sendExecutor.execute(new Runnable() {
|
sendExecutor.execute(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|||||||
@ -0,0 +1,102 @@
|
|||||||
|
package com.cmvr.edge.client.manage;
|
||||||
|
|
||||||
|
import com.cmvr.common.exception.GlobalException;
|
||||||
|
import io.grpc.stub.StreamObserver;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.concurrent.ConcurrentMap;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
/** Maintains independently addressable bidirectional gRPC streams for HTTP clients. */
|
||||||
|
public class GrpcBidiSessionRegistry<Req, Resp> {
|
||||||
|
|
||||||
|
private final ConcurrentMap<String, Session<Req, Resp>> sessions = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
public String open(Function<StreamObserver<Resp>, StreamObserver<Req>> opener, Req initialRequest) {
|
||||||
|
String sessionId = UUID.randomUUID().toString();
|
||||||
|
Session<Req, Resp> session = new Session<>();
|
||||||
|
StreamObserver<Resp> responseObserver = new StreamObserver<Resp>() {
|
||||||
|
@Override
|
||||||
|
public void onNext(Resp value) {
|
||||||
|
session.latest.set(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable throwable) {
|
||||||
|
session.error.set(throwable);
|
||||||
|
session.completed.set(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCompleted() {
|
||||||
|
session.completed.set(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
session.requestObserver = opener.apply(responseObserver);
|
||||||
|
sessions.put(sessionId, session);
|
||||||
|
try {
|
||||||
|
session.requestObserver.onNext(initialRequest);
|
||||||
|
} catch (RuntimeException exception) {
|
||||||
|
sessions.remove(sessionId);
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
return sessionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void send(String sessionId, Req request) {
|
||||||
|
Session<Req, Resp> session = require(sessionId);
|
||||||
|
checkAvailable(sessionId, session);
|
||||||
|
session.requestObserver.onNext(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Resp getLatest(String sessionId) {
|
||||||
|
Session<Req, Resp> session = require(sessionId);
|
||||||
|
Throwable error = session.error.get();
|
||||||
|
if (error != null) {
|
||||||
|
throw new GlobalException("gRPC stream failed: " + error.getMessage());
|
||||||
|
}
|
||||||
|
return session.latest.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void close(String sessionId) {
|
||||||
|
Session<Req, Resp> session = sessions.remove(sessionId);
|
||||||
|
if (session == null) {
|
||||||
|
throw new GlobalException("Unknown stream session: " + sessionId);
|
||||||
|
}
|
||||||
|
if (!session.completed.get()) {
|
||||||
|
session.requestObserver.onCompleted();
|
||||||
|
session.completed.set(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Session<Req, Resp> require(String sessionId) {
|
||||||
|
if (sessionId == null || sessionId.trim().isEmpty()) {
|
||||||
|
throw new GlobalException("Stream session ID cannot be empty");
|
||||||
|
}
|
||||||
|
Session<Req, Resp> session = sessions.get(sessionId);
|
||||||
|
if (session == null) {
|
||||||
|
throw new GlobalException("Unknown stream session: " + sessionId);
|
||||||
|
}
|
||||||
|
return session;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkAvailable(String sessionId, Session<Req, Resp> session) {
|
||||||
|
Throwable error = session.error.get();
|
||||||
|
if (error != null) {
|
||||||
|
throw new GlobalException("gRPC stream failed: " + error.getMessage());
|
||||||
|
}
|
||||||
|
if (session.completed.get()) {
|
||||||
|
throw new GlobalException("gRPC stream is already completed: " + sessionId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class Session<Req, Resp> {
|
||||||
|
private StreamObserver<Req> requestObserver;
|
||||||
|
private final AtomicReference<Resp> latest = new AtomicReference<>();
|
||||||
|
private final AtomicReference<Throwable> error = new AtomicReference<>();
|
||||||
|
private final AtomicBoolean completed = new AtomicBoolean();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -14,7 +14,7 @@ import java.util.function.Function;
|
|||||||
public class GrpcChannelCache {
|
public class GrpcChannelCache {
|
||||||
|
|
||||||
private final long ttlSeconds; // 通道存活时间(秒)
|
private final long ttlSeconds; // 通道存活时间(秒)
|
||||||
private final Map<String, ChannelWrapper> channelMap = new ConcurrentHashMap<>(); // 设备 ID -> 通道包装器
|
private final Map<String, ChannelWrapper> channelMap = new ConcurrentHashMap<>(); // 机器人 ID -> 通道包装器
|
||||||
|
|
||||||
public GrpcChannelCache(long ttlSeconds) {
|
public GrpcChannelCache(long ttlSeconds) {
|
||||||
this.ttlSeconds = ttlSeconds;
|
this.ttlSeconds = ttlSeconds;
|
||||||
@ -23,11 +23,11 @@ public class GrpcChannelCache {
|
|||||||
/**
|
/**
|
||||||
* 获取通道:存在则刷新时间,过期则重建,不存在则创建
|
* 获取通道:存在则刷新时间,过期则重建,不存在则创建
|
||||||
*/
|
*/
|
||||||
public ManagedChannel get(String terminalId, Function<String, ManagedChannel> supplier) {
|
public ManagedChannel get(String robotId, Function<String, ManagedChannel> supplier) {
|
||||||
return channelMap.compute(terminalId, (k, v) -> {
|
return channelMap.compute(robotId, (k, v) -> {
|
||||||
if (v == null || v.isExpired(ttlSeconds)) { // 为空或过期时重建
|
if (v == null || v.isExpired(ttlSeconds)) { // 为空或过期时重建
|
||||||
if (v != null) v.close(); // 关闭旧通道
|
if (v != null) v.close(); // 关闭旧通道
|
||||||
return new ChannelWrapper(supplier.apply(terminalId)); // 创建新通道包装器
|
return new ChannelWrapper(supplier.apply(robotId)); // 创建新通道包装器
|
||||||
} else {
|
} else {
|
||||||
v.refresh(); // 更新最后访问时间
|
v.refresh(); // 更新最后访问时间
|
||||||
return v;
|
return v;
|
||||||
@ -50,11 +50,11 @@ public class GrpcChannelCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 终端主动上报的gRPC地址发生变化时立即关闭旧通道。
|
* 机器人主动上报的gRPC地址发生变化时立即关闭旧通道。
|
||||||
* 下一次业务调用仍通过原有supplier创建ManagedChannel。
|
* 下一次业务调用仍通过原有supplier创建ManagedChannel。
|
||||||
*/
|
*/
|
||||||
public void invalidate(String terminalId) {
|
public void invalidate(String robotId) {
|
||||||
ChannelWrapper wrapper = channelMap.remove(terminalId);
|
ChannelWrapper wrapper = channelMap.remove(robotId);
|
||||||
if (wrapper != null) {
|
if (wrapper != null) {
|
||||||
wrapper.close();
|
wrapper.close();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
package com.cmvr.edge.client.manage;
|
package com.cmvr.edge.client.manage;
|
||||||
|
|
||||||
import cmvr.api.*;
|
import cmvr.api.*;
|
||||||
import cn.hutool.core.util.ObjUtil;
|
import cmvr.api.armteleop.v1.ArmTeleopServiceGrpc;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import com.cmvr.common.robot.RobotEndpoint;
|
||||||
import com.cmvr.device.domain.DeDeviceTerminalConfig;
|
import com.cmvr.common.robot.RobotEndpointResolver;
|
||||||
import com.cmvr.device.service.IDeDeviceTerminalConfigService;
|
|
||||||
import io.grpc.ManagedChannel;
|
import io.grpc.ManagedChannel;
|
||||||
import io.grpc.ManagedChannelBuilder;
|
import io.grpc.ManagedChannelBuilder;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -13,6 +12,7 @@ import org.springframework.scheduling.annotation.Scheduled;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@ -24,7 +24,7 @@ import java.util.function.Function;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class GrpcServiceManager {
|
public class GrpcServiceManager {
|
||||||
|
|
||||||
private final IDeDeviceTerminalConfigService deviceTerminalConfigService;
|
private final RobotEndpointResolver robotEndpointResolver;
|
||||||
|
|
||||||
@Value("${grpc.client.grpc-server.address}")
|
@Value("${grpc.client.grpc-server.address}")
|
||||||
private String DEFAULT_GRPC_ADDRESS;
|
private String DEFAULT_GRPC_ADDRESS;
|
||||||
@ -61,6 +61,9 @@ public class GrpcServiceManager {
|
|||||||
clientFactories.put(HlcServiceGrpc.HlcServiceBlockingStub.class, new GrpcClientFactory<>(HlcServiceGrpc::newBlockingStub));
|
clientFactories.put(HlcServiceGrpc.HlcServiceBlockingStub.class, new GrpcClientFactory<>(HlcServiceGrpc::newBlockingStub));
|
||||||
// 注册agv服务的stub
|
// 注册agv服务的stub
|
||||||
clientFactories.put(AgvServiceGrpc.AgvServiceBlockingStub.class, new GrpcClientFactory<>(AgvServiceGrpc::newBlockingStub));
|
clientFactories.put(AgvServiceGrpc.AgvServiceBlockingStub.class, new GrpcClientFactory<>(AgvServiceGrpc::newBlockingStub));
|
||||||
|
clientFactories.put(MotorServiceGrpc.MotorServiceBlockingStub.class, new GrpcClientFactory<>(MotorServiceGrpc::newBlockingStub));
|
||||||
|
clientFactories.put(MotorServiceGrpc.MotorServiceStub.class, new GrpcClientFactory<>(MotorServiceGrpc::newStub));
|
||||||
|
clientFactories.put(ArmTeleopServiceGrpc.ArmTeleopServiceStub.class, new GrpcClientFactory<>(ArmTeleopServiceGrpc::newStub));
|
||||||
// 注册机器人实时语音双向流服务的异步Stub
|
// 注册机器人实时语音双向流服务的异步Stub
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,8 +72,8 @@ public class GrpcServiceManager {
|
|||||||
* 获取 gRPC 客户端 Stub
|
* 获取 gRPC 客户端 Stub
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public <T> T getGrpcClient(String terminalId, Class<T> serviceClass) {
|
public <T> T getGrpcClient(String robotId, Class<T> serviceClass) {
|
||||||
ManagedChannel channel = grpcChannelCache.get(terminalId, this::createChannel);
|
ManagedChannel channel = grpcChannelCache.get(robotId, this::createChannel);
|
||||||
GrpcClientFactory<T> factory = (GrpcClientFactory<T>) clientFactories.get(serviceClass);
|
GrpcClientFactory<T> factory = (GrpcClientFactory<T>) clientFactories.get(serviceClass);
|
||||||
|
|
||||||
if (factory == null) {
|
if (factory == null) {
|
||||||
@ -83,9 +86,9 @@ public class GrpcServiceManager {
|
|||||||
/**
|
/**
|
||||||
* 创建gRPC通道
|
* 创建gRPC通道
|
||||||
*/
|
*/
|
||||||
private ManagedChannel createChannel(String terminalId) {
|
private ManagedChannel createChannel(String robotId) {
|
||||||
String grpcAddress = getGrpcServiceAddress(terminalId);
|
InetSocketAddress endpoint = getGrpcServiceEndpoint(robotId);
|
||||||
return ManagedChannelBuilder.forTarget(grpcAddress)
|
return ManagedChannelBuilder.forAddress(endpoint.getHostString(), endpoint.getPort())
|
||||||
.usePlaintext()
|
.usePlaintext()
|
||||||
.maxInboundMessageSize(50 * 1024 * 1024) // 50MB
|
.maxInboundMessageSize(50 * 1024 * 1024) // 50MB
|
||||||
.build();
|
.build();
|
||||||
@ -94,12 +97,66 @@ public class GrpcServiceManager {
|
|||||||
/**
|
/**
|
||||||
* 获取终端地址
|
* 获取终端地址
|
||||||
*/
|
*/
|
||||||
private String getGrpcServiceAddress(String terminalId) {
|
private InetSocketAddress getGrpcServiceEndpoint(String robotId) {
|
||||||
DeDeviceTerminalConfig terminal = deviceTerminalConfigService.selectDeDeviceTerminalConfigById(terminalId);
|
RobotEndpoint endpoint = robotEndpointResolver.resolve(robotId);
|
||||||
if (ObjUtil.isEmpty(terminal)) {
|
return createEndpoint(endpoint.host(), (long) endpoint.port(), "机器人 " + robotId);
|
||||||
return DEFAULT_GRPC_ADDRESS;
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 兼容原有 static://host:port 配置,但使用主机和端口直接创建通道。
|
||||||
|
*/
|
||||||
|
static InetSocketAddress parseGrpcAddress(String address) {
|
||||||
|
if (address == null || address.trim().isEmpty()) {
|
||||||
|
throw new IllegalArgumentException("gRPC 默认地址不能为空");
|
||||||
}
|
}
|
||||||
return StrUtil.format("static://{}:{}", terminal.getHost(), terminal.getPort());
|
|
||||||
|
String endpoint = address.trim();
|
||||||
|
int schemeIndex = endpoint.indexOf("://");
|
||||||
|
if (schemeIndex >= 0) {
|
||||||
|
endpoint = endpoint.substring(schemeIndex + 3);
|
||||||
|
}
|
||||||
|
while (endpoint.startsWith("/")) {
|
||||||
|
endpoint = endpoint.substring(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
String host;
|
||||||
|
String portText;
|
||||||
|
if (endpoint.startsWith("[")) {
|
||||||
|
int bracketEnd = endpoint.indexOf(']');
|
||||||
|
if (bracketEnd < 0 || bracketEnd + 1 >= endpoint.length() || endpoint.charAt(bracketEnd + 1) != ':') {
|
||||||
|
throw invalidGrpcAddress(address);
|
||||||
|
}
|
||||||
|
host = endpoint.substring(1, bracketEnd);
|
||||||
|
portText = endpoint.substring(bracketEnd + 2);
|
||||||
|
} else {
|
||||||
|
int portSeparator = endpoint.lastIndexOf(':');
|
||||||
|
if (portSeparator <= 0 || portSeparator == endpoint.length() - 1) {
|
||||||
|
throw invalidGrpcAddress(address);
|
||||||
|
}
|
||||||
|
host = endpoint.substring(0, portSeparator);
|
||||||
|
portText = endpoint.substring(portSeparator + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
return createEndpoint(host, Long.parseLong(portText), "默认配置");
|
||||||
|
} catch (NumberFormatException exception) {
|
||||||
|
throw invalidGrpcAddress(address);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static InetSocketAddress createEndpoint(String host, Long port, String source) {
|
||||||
|
String normalizedHost = host == null ? "" : host.trim();
|
||||||
|
if (normalizedHost.isEmpty()) {
|
||||||
|
throw new IllegalArgumentException(source + " 的 gRPC 主机不能为空");
|
||||||
|
}
|
||||||
|
if (port == null || port <= 0 || port > 65535) {
|
||||||
|
throw new IllegalArgumentException(source + " 的 gRPC 端口无效: " + port);
|
||||||
|
}
|
||||||
|
return InetSocketAddress.createUnresolved(normalizedHost, port.intValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static IllegalArgumentException invalidGrpcAddress(String address) {
|
||||||
|
return new IllegalArgumentException("gRPC 默认地址格式无效: " + address + ",应为 static://host:port 或 host:port");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -111,8 +168,8 @@ public class GrpcServiceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** QUIC发现终端地址变化后,使指定终端的旧gRPC通道立即失效。 */
|
/** QUIC发现终端地址变化后,使指定终端的旧gRPC通道立即失效。 */
|
||||||
public void invalidateTerminal(String terminalId) {
|
public void invalidateRobot(String robotId) {
|
||||||
grpcChannelCache.invalidate(terminalId);
|
grpcChannelCache.invalidate(robotId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -10,9 +10,9 @@ import jakarta.validation.constraints.NotEmpty;
|
|||||||
@ApiModel("边缘系统通用VO")
|
@ApiModel("边缘系统通用VO")
|
||||||
public class EdgeCommonVO {
|
public class EdgeCommonVO {
|
||||||
|
|
||||||
@ApiModelProperty("终端ID")
|
@ApiModelProperty("机器人ID")
|
||||||
@NotEmpty(message = "终端ID不能为空")
|
@NotEmpty(message = "机器人ID不能为空")
|
||||||
private String terminalId;
|
private String robotId;
|
||||||
|
|
||||||
@ApiModelProperty("设备ID")
|
@ApiModelProperty("设备ID")
|
||||||
@NotEmpty(message = "设备ID不能为空")
|
@NotEmpty(message = "设备ID不能为空")
|
||||||
|
|||||||
@ -0,0 +1,9 @@
|
|||||||
|
package com.cmvr.edge.client.model.armteleop;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class EdgeArmTeleopHeartbeatVO {
|
||||||
|
private String sessionId;
|
||||||
|
private long sequence;
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.cmvr.edge.client.model.armteleop;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class EdgeArmTeleopOpenVO {
|
||||||
|
private String robotId;
|
||||||
|
private Integer protocolMajor;
|
||||||
|
private Integer protocolMinor;
|
||||||
|
private String clientInstanceId;
|
||||||
|
private String modelSha256;
|
||||||
|
private String calibrationSha256;
|
||||||
|
private List<String> jointNames;
|
||||||
|
private String positionUnit;
|
||||||
|
private String velocityUnit;
|
||||||
|
private String effortUnit;
|
||||||
|
private String baseFrame;
|
||||||
|
private String toolFrame;
|
||||||
|
private Integer commandRateHz;
|
||||||
|
private Integer stateRateHz;
|
||||||
|
private Integer watchdogTimeoutMs;
|
||||||
|
private Integer leaseMs;
|
||||||
|
private boolean forceFeedback;
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.cmvr.edge.client.model.armteleop;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class EdgeArmTeleopSetpointVO {
|
||||||
|
private String sessionId;
|
||||||
|
private long sequence;
|
||||||
|
private double[] positionRad;
|
||||||
|
private double[] velocityRadS;
|
||||||
|
private Integer validForUs;
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.cmvr.edge.client.model.armteleop;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class EdgeArmTeleopStopVO {
|
||||||
|
private String sessionId;
|
||||||
|
private String reason;
|
||||||
|
private String detail;
|
||||||
|
}
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
package com.cmvr.edge.client.model.camera;
|
||||||
|
|
||||||
|
import com.cmvr.edge.client.model.EdgeCommonVO;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("Camera PTZ control parameters")
|
||||||
|
public class EdgeCameraPtzVO extends EdgeCommonVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "PTZ command, for example PAN_LEFT or ZOOM_IN", required = true)
|
||||||
|
private String command;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "Action: START or STOP", required = true)
|
||||||
|
private String action;
|
||||||
|
|
||||||
|
@ApiModelProperty("Movement speed")
|
||||||
|
private Integer speed;
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.cmvr.edge.client.model.motor;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class EdgeMotorCyclicOpenVO extends EdgeMotorTargetVO {
|
||||||
|
private Integer watchdogTimeoutMs;
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.cmvr.edge.client.model.motor;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class EdgeMotorCyclicSetpointVO {
|
||||||
|
@ApiModelProperty(value = "Session ID returned by the open endpoint", required = true)
|
||||||
|
private String sessionId;
|
||||||
|
private long sequence;
|
||||||
|
private Double targetPositionRad;
|
||||||
|
private Double targetVelocityRadS;
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.cmvr.edge.client.model.motor;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class EdgeMotorEnabledVO extends EdgeMotorTargetVO {
|
||||||
|
private boolean enabled;
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package com.cmvr.edge.client.model.motor;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class EdgeMotorMotionVO extends EdgeMotorTargetVO {
|
||||||
|
private Double targetPositionRad;
|
||||||
|
private Double targetVelocityRadS;
|
||||||
|
private Double maxVelocityRadS;
|
||||||
|
private Double accelerationRadS2;
|
||||||
|
private Integer timeoutMs;
|
||||||
|
private Integer pollPeriodMs;
|
||||||
|
private Double positionToleranceRad;
|
||||||
|
private Double velocityToleranceRadS;
|
||||||
|
private Integer settleSampleCount;
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.cmvr.edge.client.model.motor;
|
||||||
|
|
||||||
|
import com.cmvr.edge.client.model.EdgeCommonVO;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("Motor target")
|
||||||
|
public class EdgeMotorTargetVO extends EdgeCommonVO {
|
||||||
|
|
||||||
|
@ApiModelProperty("Motor numeric ID; use either motorId or jointName")
|
||||||
|
private Integer motorId;
|
||||||
|
|
||||||
|
@ApiModelProperty("Joint name; use either motorId or jointName")
|
||||||
|
private String jointName;
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.cmvr.edge.client.model.system;
|
||||||
|
|
||||||
|
import com.cmvr.edge.client.model.EdgeCommonVO;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("System JSON device command")
|
||||||
|
public class EdgeSystemJsonCommandVO extends EdgeCommonVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "JSON request passed to the target device", required = true)
|
||||||
|
private String requestJson;
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
package com.cmvr.edge.client.model.system;
|
||||||
|
|
||||||
|
import com.cmvr.edge.client.model.EdgeCommonVO;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("System configuration update")
|
||||||
|
public class EdgeSystemUpdateParamsVO extends EdgeCommonVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "Configuration parameters", required = true)
|
||||||
|
private List<Param> params;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel("Typed configuration parameter")
|
||||||
|
public static class Param {
|
||||||
|
@ApiModelProperty(value = "Parameter name", required = true)
|
||||||
|
private String name;
|
||||||
|
private Integer intValue;
|
||||||
|
private Double doubleValue;
|
||||||
|
private String stringValue;
|
||||||
|
private Boolean boolValue;
|
||||||
|
@ApiModelProperty("Base64 encoded byte value")
|
||||||
|
private String bytesBase64;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,224 +0,0 @@
|
|||||||
package com.cmvr.edge.client.quic;
|
|
||||||
|
|
||||||
import com.cmvr.device.domain.DeDeviceTerminalConfig;
|
|
||||||
import com.cmvr.device.service.IDeDeviceTerminalConfigService;
|
|
||||||
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
|
||||||
import com.cmvr.quic.contract.QuicEventBus;
|
|
||||||
import com.cmvr.quic.gateway.v1.NodeEvent;
|
|
||||||
import com.cmvr.quic.gateway.v1.NodeEventType;
|
|
||||||
import com.cmvr.quic.gateway.v1.NodeSnapshot;
|
|
||||||
import jakarta.annotation.PostConstruct;
|
|
||||||
import jakarta.annotation.PreDestroy;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.concurrent.ExecutorService;
|
|
||||||
import java.util.concurrent.Executors;
|
|
||||||
import java.util.concurrent.RejectedExecutionException;
|
|
||||||
import java.util.concurrent.ThreadFactory;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
|
||||||
|
|
||||||
/** 直接订阅进程内 QUIC 节点事件,并同步已绑定终端的运行状态和 gRPC 地址。 */
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class QuicGatewayNodeSyncService {
|
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(QuicGatewayNodeSyncService.class);
|
|
||||||
private static final long HEARTBEAT_PERSIST_INTERVAL_MS = 15000L;
|
|
||||||
|
|
||||||
private final IDeDeviceTerminalConfigService terminalConfigService;
|
|
||||||
private final GrpcServiceManager grpcServiceManager;
|
|
||||||
private final QuicEventBus quicEventBus;
|
|
||||||
|
|
||||||
@Value("${cmvr.quic.enabled:false}")
|
|
||||||
private boolean enabled;
|
|
||||||
|
|
||||||
/** observed-source 使用 QUIC 来源 IP;advertised 使用节点主动上报的 gRPC host。 */
|
|
||||||
@Value("${cmvr.quic.grpc-host-source:observed-source}")
|
|
||||||
private String grpcHostSource;
|
|
||||||
|
|
||||||
private final AtomicBoolean stopping = new AtomicBoolean(false);
|
|
||||||
private final AtomicBoolean grpcHostSourceWarningLogged = new AtomicBoolean(false);
|
|
||||||
private final Set<String> unknownNodes = ConcurrentHashMap.newKeySet();
|
|
||||||
private final Set<String> grpcAddressMismatchNodes = ConcurrentHashMap.newKeySet();
|
|
||||||
private final ConcurrentHashMap<String, Long> lastPersistedAt = new ConcurrentHashMap<String, Long>();
|
|
||||||
private final ConcurrentHashMap<String, String> synchronizedTerminals =
|
|
||||||
new ConcurrentHashMap<String, String>();
|
|
||||||
private ExecutorService eventExecutor;
|
|
||||||
private QuicEventBus.Subscription subscription;
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void start() {
|
|
||||||
if (!enabled) {
|
|
||||||
log.info("QUIC 节点状态同步未启用");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
eventExecutor = Executors.newSingleThreadExecutor(new ThreadFactory() {
|
|
||||||
@Override
|
|
||||||
public Thread newThread(Runnable runnable) {
|
|
||||||
Thread thread = new Thread(runnable, "quic-node-sync");
|
|
||||||
thread.setDaemon(true);
|
|
||||||
return thread;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
subscription = quicEventBus.watchNodes(true, this::enqueueEvent);
|
|
||||||
log.info("已通过进程内事件总线订阅 QUIC 节点事件");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void enqueueEvent(final NodeEvent event) {
|
|
||||||
ExecutorService executor = eventExecutor;
|
|
||||||
if (stopping.get() || executor == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
executor.execute(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
handleEventSafely(event);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (RejectedExecutionException ignored) {
|
|
||||||
if (!stopping.get()) {
|
|
||||||
log.warn("QUIC 节点事件线程已停止,忽略事件,nodeId={}", event.getNode().getNodeId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void handleEventSafely(NodeEvent event) {
|
|
||||||
try {
|
|
||||||
syncNode(event);
|
|
||||||
} catch (RuntimeException error) {
|
|
||||||
log.error("同步 QUIC 终端状态失败,nodeId={},eventType={}",
|
|
||||||
event.getNode().getNodeId(), event.getType(), error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void syncNode(NodeEvent event) {
|
|
||||||
NodeSnapshot node = event.getNode();
|
|
||||||
if (node.getNodeId().isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
DeDeviceTerminalConfig terminal = terminalConfigService.selectByQuicNodeId(node.getNodeId());
|
|
||||||
if (terminal == null) {
|
|
||||||
if (unknownNodes.add(node.getNodeId())) {
|
|
||||||
log.warn("QUIC 节点尚未绑定平台终端,忽略运行状态同步,nodeId={},remoteIp={}",
|
|
||||||
node.getNodeId(), node.getObservedSourceIp());
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
unknownNodes.remove(node.getNodeId());
|
|
||||||
|
|
||||||
boolean offline = event.getType() == NodeEventType.NODE_EVENT_TYPE_OFFLINE || !node.getOnline();
|
|
||||||
if (offline) {
|
|
||||||
synchronizedTerminals.remove(node.getNodeId());
|
|
||||||
} else {
|
|
||||||
synchronizedTerminals.put(node.getNodeId(), terminal.getId());
|
|
||||||
}
|
|
||||||
String grpcHost = offline ? null : resolveGrpcHost(node);
|
|
||||||
Long grpcPort = offline || node.getGrpcEndpoint().getPort() == 0
|
|
||||||
? null : Long.valueOf(node.getGrpcEndpoint().getPort());
|
|
||||||
boolean endpointChanged = !offline && grpcHost != null && grpcPort != null
|
|
||||||
&& (!grpcHost.equals(terminal.getHost()) || !grpcPort.equals(terminal.getPort()));
|
|
||||||
long now = System.currentTimeMillis();
|
|
||||||
Long previousPersisted = lastPersistedAt.get(node.getNodeId());
|
|
||||||
boolean immediate = event.getType() == NodeEventType.NODE_EVENT_TYPE_REGISTERED
|
|
||||||
|| event.getType() == NodeEventType.NODE_EVENT_TYPE_OFFLINE || endpointChanged;
|
|
||||||
if (!immediate && previousPersisted != null
|
|
||||||
&& now - previousPersisted.longValue() < HEARTBEAT_PERSIST_INTERVAL_MS) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
terminalConfigService.updateQuicRuntimeState(terminal.getId(), grpcHost, grpcPort,
|
|
||||||
node.getObservedSourceIp(), node.getSessionId(), node.getBootId(),
|
|
||||||
node.getSoftwareVersion(), offline ? "0" : "1",
|
|
||||||
new Date(event.getEventTimeUnixMs() == 0 ? now : event.getEventTimeUnixMs()));
|
|
||||||
lastPersistedAt.put(node.getNodeId(), now);
|
|
||||||
if (offline) {
|
|
||||||
lastPersistedAt.remove(node.getNodeId());
|
|
||||||
}
|
|
||||||
if (endpointChanged || offline) {
|
|
||||||
grpcServiceManager.invalidateTerminal(terminal.getId());
|
|
||||||
}
|
|
||||||
log.info("QUIC 终端状态已同步,terminalId={},nodeId={},online={},grpc={}:{}",
|
|
||||||
terminal.getId(), node.getNodeId(), !offline,
|
|
||||||
grpcHost == null ? terminal.getHost() : grpcHost,
|
|
||||||
grpcPort == null ? terminal.getPort() : grpcPort);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String resolveGrpcHost(NodeSnapshot node) {
|
|
||||||
String advertisedHost = emptyToNull(node.getGrpcEndpoint().getHost());
|
|
||||||
if ("advertised".equalsIgnoreCase(grpcHostSource)) {
|
|
||||||
return advertisedHost;
|
|
||||||
}
|
|
||||||
if (!"observed-source".equalsIgnoreCase(grpcHostSource)
|
|
||||||
&& grpcHostSourceWarningLogged.compareAndSet(false, true)) {
|
|
||||||
log.warn("未知的 QUIC gRPC 地址来源配置,按 observed-source 处理,value={}", grpcHostSource);
|
|
||||||
}
|
|
||||||
String observedHost = emptyToNull(node.getObservedSourceIp());
|
|
||||||
if (observedHost == null) {
|
|
||||||
log.warn("QUIC 节点缺少来源 IP,回退到节点上报地址,nodeId={},advertisedHost={}",
|
|
||||||
node.getNodeId(), advertisedHost);
|
|
||||||
return advertisedHost;
|
|
||||||
}
|
|
||||||
if (advertisedHost != null && !observedHost.equals(advertisedHost)
|
|
||||||
&& grpcAddressMismatchNodes.add(node.getNodeId())) {
|
|
||||||
log.info("QUIC 节点上报的 gRPC 地址与来源 IP 不同,使用来源 IP,nodeId={},"
|
|
||||||
+ "observedHost={},advertisedHost={}",
|
|
||||||
node.getNodeId(), observedHost, advertisedHost);
|
|
||||||
} else if (observedHost.equals(advertisedHost)) {
|
|
||||||
grpcAddressMismatchNodes.remove(node.getNodeId());
|
|
||||||
}
|
|
||||||
return observedHost;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void markSynchronizedTerminalsOffline() {
|
|
||||||
for (Map.Entry<String, String> entry : synchronizedTerminals.entrySet()) {
|
|
||||||
try {
|
|
||||||
terminalConfigService.updateQuicRuntimeState(entry.getValue(), null, null,
|
|
||||||
null, null, null, null, "0", new Date());
|
|
||||||
grpcServiceManager.invalidateTerminal(entry.getValue());
|
|
||||||
} catch (RuntimeException error) {
|
|
||||||
log.error("标记 QUIC 终端离线失败,nodeId={},terminalId={}",
|
|
||||||
entry.getKey(), entry.getValue(), error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
synchronizedTerminals.clear();
|
|
||||||
lastPersistedAt.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String emptyToNull(String value) {
|
|
||||||
return value == null || value.trim().isEmpty() ? null : value.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreDestroy
|
|
||||||
public void stop() {
|
|
||||||
if (!stopping.compareAndSet(false, true)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
QuicEventBus.Subscription currentSubscription = subscription;
|
|
||||||
if (currentSubscription != null) {
|
|
||||||
currentSubscription.close();
|
|
||||||
}
|
|
||||||
ExecutorService executor = eventExecutor;
|
|
||||||
if (executor != null) {
|
|
||||||
executor.shutdown();
|
|
||||||
try {
|
|
||||||
if (!executor.awaitTermination(5, TimeUnit.SECONDS)) {
|
|
||||||
executor.shutdownNow();
|
|
||||||
}
|
|
||||||
} catch (InterruptedException interrupted) {
|
|
||||||
executor.shutdownNow();
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
markSynchronizedTerminalsOffline();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -176,7 +176,7 @@ public class AudioService implements RobotAudioStreamListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleJoin(WebSocketSession webSocketSession, JsonNode jsonNode) {
|
private void handleJoin(WebSocketSession webSocketSession, JsonNode jsonNode) {
|
||||||
String terminalId = getText(jsonNode, "terminalId");
|
String robotId = getText(jsonNode, "robotId");
|
||||||
String deviceId = getText(jsonNode, "deviceId");
|
String deviceId = getText(jsonNode, "deviceId");
|
||||||
String speakerDeviceId = getText(jsonNode, "speakerDeviceId");
|
String speakerDeviceId = getText(jsonNode, "speakerDeviceId");
|
||||||
String micDeviceId = getText(jsonNode, "micDeviceId");
|
String micDeviceId = getText(jsonNode, "micDeviceId");
|
||||||
@ -190,8 +190,8 @@ public class AudioService implements RobotAudioStreamListener {
|
|||||||
micDeviceId = deviceId;
|
micDeviceId = deviceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (terminalId == null || speakerDeviceId == null || micDeviceId == null) {
|
if (robotId == null || speakerDeviceId == null || micDeviceId == null) {
|
||||||
sendError(webSocketSession, sessionId, "terminalId、speakerDeviceId、micDeviceId不能为空");
|
sendError(webSocketSession, sessionId, "robotId、speakerDeviceId、micDeviceId不能为空");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (deviceId == null) {
|
if (deviceId == null) {
|
||||||
@ -213,7 +213,7 @@ public class AudioService implements RobotAudioStreamListener {
|
|||||||
|
|
||||||
AudioSession session = new AudioSession();
|
AudioSession session = new AudioSession();
|
||||||
session.sessionId = sessionId;
|
session.sessionId = sessionId;
|
||||||
session.terminalId = terminalId;
|
session.robotId = robotId;
|
||||||
session.deviceId = deviceId;
|
session.deviceId = deviceId;
|
||||||
session.speakerDeviceId = speakerDeviceId;
|
session.speakerDeviceId = speakerDeviceId;
|
||||||
session.micDeviceId = micDeviceId;
|
session.micDeviceId = micDeviceId;
|
||||||
@ -228,7 +228,7 @@ public class AudioService implements RobotAudioStreamListener {
|
|||||||
sessionMap.put(sessionId, session);
|
sessionMap.put(sessionId, session);
|
||||||
webSocketSessionMap.put(webSocketSession.getId(), sessionId);
|
webSocketSessionMap.put(webSocketSession.getId(), sessionId);
|
||||||
try {
|
try {
|
||||||
session.robotStream = robotAudioGrpcAdapter.openStream(terminalId, speakerDeviceId, micDeviceId, sessionId, operatorId, this);
|
session.robotStream = robotAudioGrpcAdapter.openStream(robotId, speakerDeviceId, micDeviceId, sessionId, operatorId, this);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
sessionMap.remove(sessionId);
|
sessionMap.remove(sessionId);
|
||||||
webSocketSessionMap.remove(webSocketSession.getId());
|
webSocketSessionMap.remove(webSocketSession.getId());
|
||||||
@ -236,7 +236,7 @@ public class AudioService implements RobotAudioStreamListener {
|
|||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
sendState(session, "joined");
|
sendState(session, "joined");
|
||||||
log.info("实时语音会话创建成功,sessionId={},terminalId={},speakerDeviceId={},micDeviceId={}", sessionId, terminalId, speakerDeviceId, micDeviceId);
|
log.info("实时语音会话创建成功,sessionId={},robotId={},speakerDeviceId={},micDeviceId={}", sessionId, robotId, speakerDeviceId, micDeviceId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("创建实时语音会话失败,sessionId={}", sessionId, e);
|
log.error("创建实时语音会话失败,sessionId={}", sessionId, e);
|
||||||
sendError(webSocketSession, sessionId, "创建实时语音会话失败:" + e.getMessage());
|
sendError(webSocketSession, sessionId, "创建实时语音会话失败:" + e.getMessage());
|
||||||
@ -347,8 +347,8 @@ public class AudioService implements RobotAudioStreamListener {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (now - session.lastRobotHeartbeatAt > ROBOT_HEARTBEAT_TIMEOUT_MS) {
|
if (now - session.lastRobotHeartbeatAt > ROBOT_HEARTBEAT_TIMEOUT_MS) {
|
||||||
log.warn("机器人心跳超时,sessionId={},terminalId={},speakerDeviceId={},micDeviceId={}",
|
log.warn("机器人心跳超时,sessionId={},robotId={},speakerDeviceId={},micDeviceId={}",
|
||||||
session.sessionId, session.terminalId, session.speakerDeviceId, session.micDeviceId);
|
session.sessionId, session.robotId, session.speakerDeviceId, session.micDeviceId);
|
||||||
// 先从业务会话表摘除,避免 cancel/close 触发的异步回调再次进入同一个会话并重复关闭 native 对象。
|
// 先从业务会话表摘除,避免 cancel/close 触发的异步回调再次进入同一个会话并重复关闭 native 对象。
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
session.state = AudioSessionState.ROBOT_OFFLINE;
|
session.state = AudioSessionState.ROBOT_OFFLINE;
|
||||||
@ -466,7 +466,7 @@ public class AudioService implements RobotAudioStreamListener {
|
|||||||
|
|
||||||
private void sendState(AudioSession session, String type) {
|
private void sendState(AudioSession session, String type) {
|
||||||
ObjectNode event = baseMessage(type, session.sessionId);
|
ObjectNode event = baseMessage(type, session.sessionId);
|
||||||
event.put("terminalId", session.terminalId);
|
event.put("robotId", session.robotId);
|
||||||
event.put("deviceId", session.deviceId);
|
event.put("deviceId", session.deviceId);
|
||||||
event.put("speakerDeviceId", session.speakerDeviceId);
|
event.put("speakerDeviceId", session.speakerDeviceId);
|
||||||
event.put("micDeviceId", session.micDeviceId);
|
event.put("micDeviceId", session.micDeviceId);
|
||||||
@ -705,7 +705,7 @@ public class AudioService implements RobotAudioStreamListener {
|
|||||||
*/
|
*/
|
||||||
private static class AudioSession {
|
private static class AudioSession {
|
||||||
private String sessionId;
|
private String sessionId;
|
||||||
private String terminalId;
|
private String robotId;
|
||||||
private String deviceId;
|
private String deviceId;
|
||||||
private String speakerDeviceId;
|
private String speakerDeviceId;
|
||||||
private String micDeviceId;
|
private String micDeviceId;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.cmvr.edge.client.service;
|
package com.cmvr.edge.client.service;
|
||||||
|
|
||||||
import cmvr.msgs.Agv;
|
import cmvr.msgs.AgvUtils;
|
||||||
import cmvr.msgs.Agv.AgvRuntimeState;
|
import cmvr.msgs.AgvUtils.AgvRuntimeState;
|
||||||
|
|
||||||
import com.cmvr.edge.client.model.EdgeCommonVO;
|
import com.cmvr.edge.client.model.EdgeCommonVO;
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ public interface EdgeAgvService {
|
|||||||
* @param edgeCommonVO 边缘通用参数
|
* @param edgeCommonVO 边缘通用参数
|
||||||
* @return 导航状态
|
* @return 导航状态
|
||||||
*/
|
*/
|
||||||
Agv.AgvNavigationStatus getNavigationStatus(EdgeCommonVO edgeCommonVO);
|
AgvUtils.AgvNavigationStatus getNavigationStatus(EdgeCommonVO edgeCommonVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 紧急停止
|
* 紧急停止
|
||||||
@ -51,7 +51,7 @@ public interface EdgeAgvService {
|
|||||||
* @param edgeCommonVO 边缘通用参数
|
* @param edgeCommonVO 边缘通用参数
|
||||||
* @param pose 目标位姿
|
* @param pose 目标位姿
|
||||||
*/
|
*/
|
||||||
void navigateToPose(EdgeCommonVO edgeCommonVO, Agv.AgvPose2d pose);
|
void navigateToPose(EdgeCommonVO edgeCommonVO, AgvUtils.AgvPose2d pose);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导航到站点
|
* 导航到站点
|
||||||
@ -67,7 +67,7 @@ public interface EdgeAgvService {
|
|||||||
* @param edgeCommonVO 边缘通用参数
|
* @param edgeCommonVO 边缘通用参数
|
||||||
* @param pathSegments 路径段列表
|
* @param pathSegments 路径段列表
|
||||||
*/
|
*/
|
||||||
void followPath(EdgeCommonVO edgeCommonVO, List<Agv.AgvPathSegment> pathSegments);
|
void followPath(EdgeCommonVO edgeCommonVO, List<AgvUtils.AgvPathSegment> pathSegments);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 暂停导航
|
* 暂停导航
|
||||||
@ -96,7 +96,7 @@ public interface EdgeAgvService {
|
|||||||
* @param edgeCommonVO 边缘通用参数
|
* @param edgeCommonVO 边缘通用参数
|
||||||
* @param velocity 速度
|
* @param velocity 速度
|
||||||
*/
|
*/
|
||||||
void setVelocity(EdgeCommonVO edgeCommonVO, Agv.AgvVelocity velocity);
|
void setVelocity(EdgeCommonVO edgeCommonVO, AgvUtils.AgvVelocity velocity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 停止速度控制
|
* 停止速度控制
|
||||||
@ -119,7 +119,7 @@ public interface EdgeAgvService {
|
|||||||
* @param edgeCommonVO 边缘通用参数
|
* @param edgeCommonVO 边缘通用参数
|
||||||
* @return 站点列表
|
* @return 站点列表
|
||||||
*/
|
*/
|
||||||
List<Agv.AgvStation> listStations(EdgeCommonVO edgeCommonVO);
|
List<AgvUtils.AgvStation> listStations(EdgeCommonVO edgeCommonVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 切换地图
|
* 切换地图
|
||||||
@ -156,7 +156,7 @@ public interface EdgeAgvService {
|
|||||||
* @param realTime 是否实时建图
|
* @param realTime 是否实时建图
|
||||||
* @return 会话ID
|
* @return 会话ID
|
||||||
*/
|
*/
|
||||||
String startMapping(EdgeCommonVO edgeCommonVO, Agv.AgvMapDimension dimension, String mapName, boolean realTime);
|
String startMapping(EdgeCommonVO edgeCommonVO, AgvUtils.AgvMapDimension dimension, String mapName, boolean realTime);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 停止建图
|
* 停止建图
|
||||||
|
|||||||
@ -33,7 +33,7 @@ public interface EdgeArmService {
|
|||||||
/**
|
/**
|
||||||
* 清除机械臂故障状态。
|
* 清除机械臂故障状态。
|
||||||
*
|
*
|
||||||
* @param edgeCommonVO 边缘设备通用参数,包含 terminalId 和 deviceId
|
* @param edgeCommonVO 边缘设备通用参数,包含 robotId 和 deviceId
|
||||||
* @return 机器人终端返回的通用反馈
|
* @return 机器人终端返回的通用反馈
|
||||||
*/
|
*/
|
||||||
Common.CommandHeader.Feedback clearFault(EdgeCommonVO edgeCommonVO);
|
Common.CommandHeader.Feedback clearFault(EdgeCommonVO edgeCommonVO);
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.cmvr.edge.client.service;
|
||||||
|
|
||||||
|
import cmvr.api.armteleop.v1.ArmTeleopV1;
|
||||||
|
import com.cmvr.edge.client.model.armteleop.EdgeArmTeleopHeartbeatVO;
|
||||||
|
import com.cmvr.edge.client.model.armteleop.EdgeArmTeleopOpenVO;
|
||||||
|
import com.cmvr.edge.client.model.armteleop.EdgeArmTeleopSetpointVO;
|
||||||
|
import com.cmvr.edge.client.model.armteleop.EdgeArmTeleopStopVO;
|
||||||
|
|
||||||
|
public interface EdgeArmTeleopService {
|
||||||
|
String open(EdgeArmTeleopOpenVO request);
|
||||||
|
|
||||||
|
void sendSetpoint(EdgeArmTeleopSetpointVO request);
|
||||||
|
|
||||||
|
void heartbeat(EdgeArmTeleopHeartbeatVO request);
|
||||||
|
|
||||||
|
ArmTeleopV1.ServerFrame getStatus(String sessionId);
|
||||||
|
|
||||||
|
void stop(EdgeArmTeleopStopVO request);
|
||||||
|
}
|
||||||
@ -37,6 +37,6 @@ public interface EdgeBioHeadService {
|
|||||||
/**
|
/**
|
||||||
* 表情
|
* 表情
|
||||||
*/
|
*/
|
||||||
public String specialExpression(String terminalId,String deviceId,Integer expressKey);
|
public String specialExpression(String robotId,String deviceId,Integer expressKey);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,8 +2,11 @@ package com.cmvr.edge.client.service;
|
|||||||
|
|
||||||
import cmvr.api.CameraCommand;
|
import cmvr.api.CameraCommand;
|
||||||
import com.cmvr.edge.client.model.EdgeCommonVO;
|
import com.cmvr.edge.client.model.EdgeCommonVO;
|
||||||
|
import com.cmvr.edge.client.model.camera.EdgeCameraPtzVO;
|
||||||
import io.grpc.stub.StreamObserver;
|
import io.grpc.stub.StreamObserver;
|
||||||
|
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 边缘系统摄像头服务
|
* 边缘系统摄像头服务
|
||||||
*/
|
*/
|
||||||
@ -34,6 +37,8 @@ public interface EdgeCameraService {
|
|||||||
*/
|
*/
|
||||||
public String getRGBImage(EdgeCommonVO edgeCommonVO);
|
public String getRGBImage(EdgeCommonVO edgeCommonVO);
|
||||||
|
|
||||||
|
String getDepthImage(EdgeCommonVO edgeCommonVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始录制视频
|
* 开始录制视频
|
||||||
*/
|
*/
|
||||||
@ -49,8 +54,14 @@ public interface EdgeCameraService {
|
|||||||
*/
|
*/
|
||||||
public String getRGBDImages(EdgeCommonVO edgeCommonVO);
|
public String getRGBDImages(EdgeCommonVO edgeCommonVO);
|
||||||
|
|
||||||
|
String controlPtz(EdgeCameraPtzVO ptzVO);
|
||||||
|
|
||||||
StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request> getRGBImageStream(EdgeCommonVO edgeCommonVO);
|
StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request> getRGBImageStream(EdgeCommonVO edgeCommonVO);
|
||||||
|
|
||||||
|
StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request> getRGBImageStream(String robotId, String deviceId);
|
||||||
|
|
||||||
|
void writeRGBVideoStream(String robotId, String deviceId, OutputStream outputStream);
|
||||||
|
|
||||||
void getDepthImageStream(EdgeCommonVO edgeCommonVO);
|
void getDepthImageStream(EdgeCommonVO edgeCommonVO);
|
||||||
void getRGBDImagesStream(EdgeCommonVO edgeCommonVO);
|
void getRGBDImagesStream(EdgeCommonVO edgeCommonVO);
|
||||||
|
|
||||||
|
|||||||
@ -8,12 +8,12 @@ import io.grpc.stub.StreamObserver;
|
|||||||
*/
|
*/
|
||||||
public interface EdgeDexHandService {
|
public interface EdgeDexHandService {
|
||||||
// 基本控制
|
// 基本控制
|
||||||
DexhandCommand.DexHandState getStatus(String terminalId, String deviceId);
|
DexhandCommand.DexHandState getStatus(String robotId, String deviceId);
|
||||||
void setDexHandPos(String terminalId, String deviceId);
|
void setDexHandPos(String robotId, String deviceId);
|
||||||
void setDexHandAngle(String terminalId, String deviceId, int id, float value) ;
|
void setDexHandAngle(String robotId, String deviceId, int id, float value) ;
|
||||||
void setDexHandForce(String terminalId, String deviceId) ;
|
void setDexHandForce(String robotId, String deviceId) ;
|
||||||
void setDexHandSpeed(String terminalId, String deviceId) ;
|
void setDexHandSpeed(String robotId, String deviceId) ;
|
||||||
void setDexHandPresetAct(String terminalId, String deviceId);
|
void setDexHandPresetAct(String robotId, String deviceId);
|
||||||
String getSensorData(String terminalId, String deviceId) ;
|
String getSensorData(String robotId, String deviceId) ;
|
||||||
StreamObserver<DexhandCommand.GetSensorDataStreamCommand.Request> getSensorDataStream(String terminalId, String deviceId) ;
|
StreamObserver<DexhandCommand.GetSensorDataStreamCommand.Request> getSensorDataStream(String robotId, String deviceId) ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@ public interface EdgeHlcService {
|
|||||||
/**
|
/**
|
||||||
* 触控
|
* 触控
|
||||||
*/
|
*/
|
||||||
public String touch(File image, String terminalId, String deviceId, int x, int y, double maxForce);
|
public String touch(File image, String robotId, String deviceId, int x, int y, double maxForce);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片标注
|
* 图片标注
|
||||||
|
|||||||
@ -0,0 +1,36 @@
|
|||||||
|
package com.cmvr.edge.client.service;
|
||||||
|
|
||||||
|
import cmvr.api.MotorCommand;
|
||||||
|
import com.cmvr.edge.client.model.motor.EdgeMotorCyclicOpenVO;
|
||||||
|
import com.cmvr.edge.client.model.motor.EdgeMotorCyclicSetpointVO;
|
||||||
|
import com.cmvr.edge.client.model.motor.EdgeMotorEnabledVO;
|
||||||
|
import com.cmvr.edge.client.model.motor.EdgeMotorMotionVO;
|
||||||
|
import com.cmvr.edge.client.model.motor.EdgeMotorTargetVO;
|
||||||
|
|
||||||
|
public interface EdgeMotorService {
|
||||||
|
MotorCommand.MotorCommandResponse setZero(EdgeMotorTargetVO request);
|
||||||
|
|
||||||
|
MotorCommand.MotorCommandResponse moveToZero(EdgeMotorMotionVO request);
|
||||||
|
|
||||||
|
MotorCommand.MotorCommandResponse profilePosition(EdgeMotorMotionVO request);
|
||||||
|
|
||||||
|
MotorCommand.MotorCommandResponse profileVelocity(EdgeMotorMotionVO request);
|
||||||
|
|
||||||
|
MotorCommand.MotorCommandResponse emergencyStop(EdgeMotorTargetVO request);
|
||||||
|
|
||||||
|
MotorCommand.GetMotorStatusResponse getStatus(EdgeMotorTargetVO request);
|
||||||
|
|
||||||
|
MotorCommand.MotorCommandResponse setEnabled(EdgeMotorEnabledVO request);
|
||||||
|
|
||||||
|
String openCyclicPosition(EdgeMotorCyclicOpenVO request);
|
||||||
|
|
||||||
|
void sendCyclicPosition(EdgeMotorCyclicSetpointVO request);
|
||||||
|
|
||||||
|
String openCyclicVelocity(EdgeMotorCyclicOpenVO request);
|
||||||
|
|
||||||
|
void sendCyclicVelocity(EdgeMotorCyclicSetpointVO request);
|
||||||
|
|
||||||
|
MotorCommand.CyclicControlResponse getStreamStatus(String sessionId);
|
||||||
|
|
||||||
|
void closeStream(String sessionId);
|
||||||
|
}
|
||||||
@ -14,75 +14,75 @@ public interface EdgeSpeakerService {
|
|||||||
* 获取扬声器当前状态
|
* 获取扬声器当前状态
|
||||||
* 通过gRPC调用获取扬声器的运行状态,包括是否正在播放、音量等信息
|
* 通过gRPC调用获取扬声器的运行状态,包括是否正在播放、音量等信息
|
||||||
*
|
*
|
||||||
* @param terminalId 终端设备ID
|
* @param robotId 机器人永久唯一ID
|
||||||
* @param deviceId 设备ID
|
* @param deviceId 设备ID
|
||||||
* @return SpeakerState 返回扬声器的当前状态
|
* @return SpeakerState 返回扬声器的当前状态
|
||||||
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
*/
|
*/
|
||||||
SpeakerCommand.GetSpeakerStateCommand.Feedback getStatus(String terminalId, String deviceId);
|
SpeakerCommand.GetSpeakerStateCommand.Feedback getStatus(String robotId, String deviceId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 播放音频文件
|
* 播放音频文件
|
||||||
* 通过gRPC调用播放指定路径的音频文件
|
* 通过gRPC调用播放指定路径的音频文件
|
||||||
*
|
*
|
||||||
* @param terminalId 终端设备ID
|
* @param robotId 机器人永久唯一ID
|
||||||
* @param deviceId 设备ID
|
* @param deviceId 设备ID
|
||||||
* @param audioPath 音频文件的路径
|
* @param audioPath 音频文件的路径
|
||||||
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
*/
|
*/
|
||||||
String playAudio(String terminalId, String deviceId, String audioPath);
|
String playAudio(String robotId, String deviceId, String audioPath);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 停止当前播放
|
* 停止当前播放
|
||||||
* 通过gRPC调用停止扬声器的当前播放
|
* 通过gRPC调用停止扬声器的当前播放
|
||||||
*
|
*
|
||||||
* @param terminalId 终端设备ID
|
* @param robotId 机器人永久唯一ID
|
||||||
* @param deviceId 设备ID
|
* @param deviceId 设备ID
|
||||||
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
*/
|
*/
|
||||||
void stopPlayback(String terminalId, String deviceId);
|
void stopPlayback(String robotId, String deviceId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 暂停当前播放
|
* 暂停当前播放
|
||||||
* 通过gRPC调用暂停扬声器的当前播放
|
* 通过gRPC调用暂停扬声器的当前播放
|
||||||
*
|
*
|
||||||
* @param terminalId 终端设备ID
|
* @param robotId 机器人永久唯一ID
|
||||||
* @param deviceId 设备ID
|
* @param deviceId 设备ID
|
||||||
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
*/
|
*/
|
||||||
void pausePlayback(String terminalId, String deviceId);
|
void pausePlayback(String robotId, String deviceId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 恢复暂停的播放
|
* 恢复暂停的播放
|
||||||
* 通过gRPC调用恢复扬声器之前暂停的播放
|
* 通过gRPC调用恢复扬声器之前暂停的播放
|
||||||
*
|
*
|
||||||
* @param terminalId 终端设备ID
|
* @param robotId 机器人永久唯一ID
|
||||||
* @param deviceId 设备ID
|
* @param deviceId 设备ID
|
||||||
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
*/
|
*/
|
||||||
void resumePlayback(String terminalId, String deviceId);
|
void resumePlayback(String robotId, String deviceId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置扬声器音量
|
* 设置扬声器音量
|
||||||
* 通过gRPC调用设置扬声器的音量大小
|
* 通过gRPC调用设置扬声器的音量大小
|
||||||
*
|
*
|
||||||
* @param terminalId 终端设备ID
|
* @param robotId 机器人永久唯一ID
|
||||||
* @param deviceId 设备ID
|
* @param deviceId 设备ID
|
||||||
* @param volume 音量大小(0-100)
|
* @param volume 音量大小(0-100)
|
||||||
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
*/
|
*/
|
||||||
void setVolume(String terminalId, String deviceId, int volume);
|
void setVolume(String robotId, String deviceId, int volume);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前音量
|
* 获取当前音量
|
||||||
* 通过gRPC调用获取扬声器的当前音量大小
|
* 通过gRPC调用获取扬声器的当前音量大小
|
||||||
*
|
*
|
||||||
* @param terminalId 终端设备ID
|
* @param robotId 机器人永久唯一ID
|
||||||
* @param deviceId 设备ID
|
* @param deviceId 设备ID
|
||||||
* @return int 返回当前音量大小(0-100)
|
* @return int 返回当前音量大小(0-100)
|
||||||
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
*/
|
*/
|
||||||
int getVolume(String terminalId, String deviceId);
|
int getVolume(String robotId, String deviceId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有音频文件
|
* 获取所有音频文件
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
package com.cmvr.edge.client.service;
|
package com.cmvr.edge.client.service;
|
||||||
|
|
||||||
|
import cmvr.api.Common;
|
||||||
import cmvr.api.SystemCommand;
|
import cmvr.api.SystemCommand;
|
||||||
import com.cmvr.device.domain.DeDeviceRegistration;
|
import com.cmvr.device.domain.DeDeviceRegistration;
|
||||||
import com.cmvr.device.domain.vo.Device;
|
import com.cmvr.edge.client.model.system.EdgeSystemJsonCommandVO;
|
||||||
|
import com.cmvr.edge.client.model.system.EdgeSystemUpdateParamsVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -10,14 +12,20 @@ import java.util.List;
|
|||||||
* 边缘系统服务接口
|
* 边缘系统服务接口
|
||||||
*/
|
*/
|
||||||
public interface EdgeSystemService {
|
public interface EdgeSystemService {
|
||||||
|
SystemCommand.GetSystemInfoCommand.Feedback getSystemInfo(String robotId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取系统状态
|
* 获取系统状态
|
||||||
* @return 系统状态信息,包含CPU使用率、内存使用情况、磁盘使用情况和设备列表
|
* @return 系统状态信息,包含CPU使用率、内存使用情况、磁盘使用情况和设备列表
|
||||||
*/
|
*/
|
||||||
SystemCommand.GetSystemStatusCommand.Feedback getSystemStatus(String terminalId);
|
SystemCommand.GetSystemStatusCommand.Feedback getSystemStatus(String robotId);
|
||||||
|
|
||||||
|
Common.CommandHeader.Feedback updateParams(EdgeSystemUpdateParamsVO request);
|
||||||
|
|
||||||
|
Common.JsonDeviceCommand.Feedback executeJsonCommand(EdgeSystemJsonCommandVO request);
|
||||||
|
|
||||||
|
|
||||||
public List<DeDeviceRegistration> deviceList(String terminalId);
|
public List<DeDeviceRegistration> deviceList(String robotId);
|
||||||
|
|
||||||
public String stopAll(String terminalId);
|
public String stopAll(String robotId);
|
||||||
}
|
}
|
||||||
@ -3,7 +3,7 @@ package com.cmvr.edge.client.service.impl;
|
|||||||
import cmvr.api.AgvCommand;
|
import cmvr.api.AgvCommand;
|
||||||
import cmvr.api.AgvServiceGrpc;
|
import cmvr.api.AgvServiceGrpc;
|
||||||
import cmvr.api.Common;
|
import cmvr.api.Common;
|
||||||
import cmvr.msgs.Agv;
|
import cmvr.msgs.AgvUtils;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.cmvr.common.exception.GlobalException;
|
import com.cmvr.common.exception.GlobalException;
|
||||||
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
||||||
@ -30,9 +30,9 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
private final GrpcServiceManager grpcServiceManager;
|
private final GrpcServiceManager grpcServiceManager;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Agv.AgvRuntimeState getRuntimeState(EdgeCommonVO edgeCommonVO) {
|
public AgvUtils.AgvRuntimeState getRuntimeState(EdgeCommonVO edgeCommonVO) {
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
AgvCommand.AgvRuntimeStateCommand.Request request = AgvCommand.AgvRuntimeStateCommand.Request.newBuilder()
|
AgvCommand.AgvRuntimeStateCommand.Request request = AgvCommand.AgvRuntimeStateCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.build();
|
.build();
|
||||||
@ -40,9 +40,9 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Agv.AgvNavigationStatus getNavigationStatus(EdgeCommonVO edgeCommonVO) {
|
public AgvUtils.AgvNavigationStatus getNavigationStatus(EdgeCommonVO edgeCommonVO) {
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
AgvCommand.AgvNavigationStatusCommand.Request request = AgvCommand.AgvNavigationStatusCommand.Request.newBuilder()
|
AgvCommand.AgvNavigationStatusCommand.Request request = AgvCommand.AgvNavigationStatusCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.build();
|
.build();
|
||||||
@ -52,7 +52,7 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
@Override
|
@Override
|
||||||
public void emergencyStop(EdgeCommonVO edgeCommonVO) {
|
public void emergencyStop(EdgeCommonVO edgeCommonVO) {
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
||||||
executeGrpcCall(() -> stub.emergencyStop(request));
|
executeGrpcCall(() -> stub.emergencyStop(request));
|
||||||
}
|
}
|
||||||
@ -60,19 +60,19 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
@Override
|
@Override
|
||||||
public void clearFault(EdgeCommonVO edgeCommonVO) {
|
public void clearFault(EdgeCommonVO edgeCommonVO) {
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
||||||
executeGrpcCall(() -> stub.clearFault(request));
|
executeGrpcCall(() -> stub.clearFault(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void navigateToPose(EdgeCommonVO edgeCommonVO, Agv.AgvPose2d pose) {
|
public void navigateToPose(EdgeCommonVO edgeCommonVO, AgvUtils.AgvPose2d pose) {
|
||||||
if (pose == null) {
|
if (pose == null) {
|
||||||
throw new GlobalException("目标位姿不能为空");
|
throw new GlobalException("目标位姿不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
AgvCommand.AgvNavigateToPoseCommand.Request request = AgvCommand.AgvNavigateToPoseCommand.Request.newBuilder()
|
AgvCommand.AgvNavigateToPoseCommand.Request request = AgvCommand.AgvNavigateToPoseCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.setPose(pose)
|
.setPose(pose)
|
||||||
@ -87,7 +87,7 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
AgvCommand.AgvNavigateToStationCommand.Request request = AgvCommand.AgvNavigateToStationCommand.Request.newBuilder()
|
AgvCommand.AgvNavigateToStationCommand.Request request = AgvCommand.AgvNavigateToStationCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.setStationId(stationId)
|
.setStationId(stationId)
|
||||||
@ -96,13 +96,13 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void followPath(EdgeCommonVO edgeCommonVO, List<Agv.AgvPathSegment> pathSegments) {
|
public void followPath(EdgeCommonVO edgeCommonVO, List<AgvUtils.AgvPathSegment> pathSegments) {
|
||||||
if (pathSegments == null || pathSegments.isEmpty()) {
|
if (pathSegments == null || pathSegments.isEmpty()) {
|
||||||
throw new GlobalException("路径段不能为空");
|
throw new GlobalException("路径段不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
AgvCommand.AgvFollowPathCommand.Request request = AgvCommand.AgvFollowPathCommand.Request.newBuilder()
|
AgvCommand.AgvFollowPathCommand.Request request = AgvCommand.AgvFollowPathCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.addAllPath(pathSegments)
|
.addAllPath(pathSegments)
|
||||||
@ -113,7 +113,7 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
@Override
|
@Override
|
||||||
public void pauseNavigation(EdgeCommonVO edgeCommonVO) {
|
public void pauseNavigation(EdgeCommonVO edgeCommonVO) {
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
||||||
executeGrpcCall(() -> stub.pauseNavigation(request));
|
executeGrpcCall(() -> stub.pauseNavigation(request));
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
@Override
|
@Override
|
||||||
public void resumeNavigation(EdgeCommonVO edgeCommonVO) {
|
public void resumeNavigation(EdgeCommonVO edgeCommonVO) {
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
||||||
executeGrpcCall(() -> stub.resumeNavigation(request));
|
executeGrpcCall(() -> stub.resumeNavigation(request));
|
||||||
}
|
}
|
||||||
@ -129,19 +129,19 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
@Override
|
@Override
|
||||||
public void cancelNavigation(EdgeCommonVO edgeCommonVO) {
|
public void cancelNavigation(EdgeCommonVO edgeCommonVO) {
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
||||||
executeGrpcCall(() -> stub.cancelNavigation(request));
|
executeGrpcCall(() -> stub.cancelNavigation(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setVelocity(EdgeCommonVO edgeCommonVO, Agv.AgvVelocity velocity) {
|
public void setVelocity(EdgeCommonVO edgeCommonVO, AgvUtils.AgvVelocity velocity) {
|
||||||
if (velocity == null) {
|
if (velocity == null) {
|
||||||
throw new GlobalException("速度不能为空");
|
throw new GlobalException("速度不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
AgvCommand.AgvSetVelocityCommand.Request request = AgvCommand.AgvSetVelocityCommand.Request.newBuilder()
|
AgvCommand.AgvSetVelocityCommand.Request request = AgvCommand.AgvSetVelocityCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.setVelocity(velocity)
|
.setVelocity(velocity)
|
||||||
@ -152,7 +152,7 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
@Override
|
@Override
|
||||||
public void stopVelocityControl(EdgeCommonVO edgeCommonVO) {
|
public void stopVelocityControl(EdgeCommonVO edgeCommonVO) {
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
||||||
executeGrpcCall(() -> stub.stopVelocityControl(request));
|
executeGrpcCall(() -> stub.stopVelocityControl(request));
|
||||||
}
|
}
|
||||||
@ -160,7 +160,7 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
@Override
|
@Override
|
||||||
public List<String> listMaps(EdgeCommonVO edgeCommonVO) {
|
public List<String> listMaps(EdgeCommonVO edgeCommonVO) {
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
AgvCommand.AgvListMapsCommand.Request request = AgvCommand.AgvListMapsCommand.Request.newBuilder()
|
AgvCommand.AgvListMapsCommand.Request request = AgvCommand.AgvListMapsCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.build();
|
.build();
|
||||||
@ -168,9 +168,9 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Agv.AgvStation> listStations(EdgeCommonVO edgeCommonVO) {
|
public List<AgvUtils.AgvStation> listStations(EdgeCommonVO edgeCommonVO) {
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
AgvCommand.AgvListStationsCommand.Request request = AgvCommand.AgvListStationsCommand.Request.newBuilder()
|
AgvCommand.AgvListStationsCommand.Request request = AgvCommand.AgvListStationsCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.build();
|
.build();
|
||||||
@ -184,7 +184,7 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
AgvCommand.AgvMapCommand.Request request = AgvCommand.AgvMapCommand.Request.newBuilder()
|
AgvCommand.AgvMapCommand.Request request = AgvCommand.AgvMapCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.setMapName(mapName)
|
.setMapName(mapName)
|
||||||
@ -202,7 +202,7 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
AgvCommand.AgvMapCommand.Request request = AgvCommand.AgvMapCommand.Request.newBuilder()
|
AgvCommand.AgvMapCommand.Request request = AgvCommand.AgvMapCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.setMapName(mapName)
|
.setMapName(mapName)
|
||||||
@ -218,7 +218,7 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
AgvCommand.AgvMapCommand.Request request = AgvCommand.AgvMapCommand.Request.newBuilder()
|
AgvCommand.AgvMapCommand.Request request = AgvCommand.AgvMapCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.setMapName(mapName)
|
.setMapName(mapName)
|
||||||
@ -227,12 +227,12 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String startMapping(EdgeCommonVO edgeCommonVO, Agv.AgvMapDimension dimension, String mapName, boolean realTime) {
|
public String startMapping(EdgeCommonVO edgeCommonVO, AgvUtils.AgvMapDimension dimension, String mapName, boolean realTime) {
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
AgvCommand.AgvStartMappingCommand.Request.Builder requestBuilder = AgvCommand.AgvStartMappingCommand.Request.newBuilder()
|
AgvCommand.AgvStartMappingCommand.Request.Builder requestBuilder = AgvCommand.AgvStartMappingCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.setDimension(dimension != null ? dimension : Agv.AgvMapDimension.AGV_MAP_DIMENSION_UNSPECIFIED)
|
.setDimension(dimension != null ? dimension : AgvUtils.AgvMapDimension.AGV_MAP_DIMENSION_UNSPECIFIED)
|
||||||
.setRealTime(realTime);
|
.setRealTime(realTime);
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(mapName)) {
|
if (StrUtil.isNotBlank(mapName)) {
|
||||||
@ -246,7 +246,7 @@ public class EdgeAgvServiceImpl implements EdgeAgvService {
|
|||||||
@Override
|
@Override
|
||||||
public void stopMapping(EdgeCommonVO edgeCommonVO) {
|
public void stopMapping(EdgeCommonVO edgeCommonVO) {
|
||||||
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
AgvServiceGrpc.AgvServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), AgvServiceGrpc.AgvServiceBlockingStub.class);
|
||||||
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
||||||
executeGrpcCall(() -> stub.stopMapping(request));
|
executeGrpcCall(() -> stub.stopMapping(request));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@ public class EdgeArmServiceImpl implements EdgeArmService {
|
|||||||
@Override
|
@Override
|
||||||
public Common.CommandHeader.Feedback torqueOff(EdgeCommonVO edgeCommonVO) {
|
public Common.CommandHeader.Feedback torqueOff(EdgeCommonVO edgeCommonVO) {
|
||||||
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
||||||
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
||||||
return executeGrpcCall(() -> stub.torqueOff(request));
|
return executeGrpcCall(() -> stub.torqueOff(request));
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ public class EdgeArmServiceImpl implements EdgeArmService {
|
|||||||
@Override
|
@Override
|
||||||
public Common.CommandHeader.Feedback torqueOn(EdgeCommonVO edgeCommonVO) {
|
public Common.CommandHeader.Feedback torqueOn(EdgeCommonVO edgeCommonVO) {
|
||||||
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
||||||
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
||||||
return executeGrpcCall(() -> stub.torqueOn(request));
|
return executeGrpcCall(() -> stub.torqueOn(request));
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@ public class EdgeArmServiceImpl implements EdgeArmService {
|
|||||||
@Override
|
@Override
|
||||||
public Common.CommandHeader.Feedback clearFault(EdgeCommonVO edgeCommonVO) {
|
public Common.CommandHeader.Feedback clearFault(EdgeCommonVO edgeCommonVO) {
|
||||||
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
||||||
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
||||||
return executeGrpcCall(() -> stub.clearFault(request));
|
return executeGrpcCall(() -> stub.clearFault(request));
|
||||||
}
|
}
|
||||||
@ -61,7 +61,7 @@ public class EdgeArmServiceImpl implements EdgeArmService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建关节位置命令
|
// 构建关节位置命令
|
||||||
ArmCommand.JointPositionCommand targetCommand = ArmCommand.JointPositionCommand.newBuilder()
|
ArmCommand.JointPositionCommand targetCommand = ArmCommand.JointPositionCommand.newBuilder()
|
||||||
@ -104,7 +104,7 @@ public class EdgeArmServiceImpl implements EdgeArmService {
|
|||||||
double rx, double ry, double rz, String frame,
|
double rx, double ry, double rz, String frame,
|
||||||
Double velocity, Double acceleration, Double blendRadius) {
|
Double velocity, Double acceleration, Double blendRadius) {
|
||||||
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建笛卡尔位姿
|
// 构建笛卡尔位姿
|
||||||
ArmCommand.CartesianPose targetPose = ArmCommand.CartesianPose.newBuilder()
|
ArmCommand.CartesianPose targetPose = ArmCommand.CartesianPose.newBuilder()
|
||||||
@ -149,7 +149,7 @@ public class EdgeArmServiceImpl implements EdgeArmService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建关节速度命令
|
// 构建关节速度命令
|
||||||
ArmCommand.JointVelocityCommand velocityCommand = ArmCommand.JointVelocityCommand.newBuilder()
|
ArmCommand.JointVelocityCommand velocityCommand = ArmCommand.JointVelocityCommand.newBuilder()
|
||||||
@ -177,7 +177,7 @@ public class EdgeArmServiceImpl implements EdgeArmService {
|
|||||||
double wx, double wy, double wz, String frame,
|
double wx, double wy, double wz, String frame,
|
||||||
Double acceleration, Double duration) {
|
Double acceleration, Double duration) {
|
||||||
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建笛卡尔速度
|
// 构建笛卡尔速度
|
||||||
ArmCommand.CartesianVelocity velocity = ArmCommand.CartesianVelocity.newBuilder()
|
ArmCommand.CartesianVelocity velocity = ArmCommand.CartesianVelocity.newBuilder()
|
||||||
@ -214,7 +214,7 @@ public class EdgeArmServiceImpl implements EdgeArmService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建关节位置命令
|
// 构建关节位置命令
|
||||||
ArmCommand.JointPositionCommand targetCommand = ArmCommand.JointPositionCommand.newBuilder()
|
ArmCommand.JointPositionCommand targetCommand = ArmCommand.JointPositionCommand.newBuilder()
|
||||||
@ -234,7 +234,7 @@ public class EdgeArmServiceImpl implements EdgeArmService {
|
|||||||
@Override
|
@Override
|
||||||
public Common.CommandHeader.Feedback stopMotion(EdgeCommonVO edgeCommonVO) {
|
public Common.CommandHeader.Feedback stopMotion(EdgeCommonVO edgeCommonVO) {
|
||||||
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
||||||
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
Common.CommandHeader.Request request = EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId());
|
||||||
return executeGrpcCall(() -> stub.stopMotion(request));
|
return executeGrpcCall(() -> stub.stopMotion(request));
|
||||||
}
|
}
|
||||||
@ -242,7 +242,7 @@ public class EdgeArmServiceImpl implements EdgeArmService {
|
|||||||
@Override
|
@Override
|
||||||
public ArmCommand.JointResponse getJointState(EdgeCommonVO edgeCommonVO) {
|
public ArmCommand.JointResponse getJointState(EdgeCommonVO edgeCommonVO) {
|
||||||
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
||||||
ArmCommand.JointRequest request = ArmCommand.JointRequest.newBuilder()
|
ArmCommand.JointRequest request = ArmCommand.JointRequest.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.build();
|
.build();
|
||||||
@ -252,7 +252,7 @@ public class EdgeArmServiceImpl implements EdgeArmService {
|
|||||||
@Override
|
@Override
|
||||||
public ArmCommand.GetPose.Response getPose(EdgeCommonVO edgeCommonVO, String baseLink, String eeLink) {
|
public ArmCommand.GetPose.Response getPose(EdgeCommonVO edgeCommonVO, String baseLink, String eeLink) {
|
||||||
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
||||||
|
|
||||||
ArmCommand.GetPose.Request.Builder requestBuilder = ArmCommand.GetPose.Request.newBuilder()
|
ArmCommand.GetPose.Request.Builder requestBuilder = ArmCommand.GetPose.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()));
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()));
|
||||||
@ -270,7 +270,7 @@ public class EdgeArmServiceImpl implements EdgeArmService {
|
|||||||
@Override
|
@Override
|
||||||
public ArmCommand.CalibrateZeroQ.Response calibrateZeroQ(EdgeCommonVO edgeCommonVO, String jointName) {
|
public ArmCommand.CalibrateZeroQ.Response calibrateZeroQ(EdgeCommonVO edgeCommonVO, String jointName) {
|
||||||
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
||||||
|
|
||||||
ArmCommand.CalibrateZeroQ.Request.Builder requestBuilder = ArmCommand.CalibrateZeroQ.Request.newBuilder()
|
ArmCommand.CalibrateZeroQ.Request.Builder requestBuilder = ArmCommand.CalibrateZeroQ.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()));
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()));
|
||||||
@ -285,7 +285,7 @@ public class EdgeArmServiceImpl implements EdgeArmService {
|
|||||||
@Override
|
@Override
|
||||||
public ArmCommand.GetPoseMatrix.Response getPoseMatrix(EdgeCommonVO edgeCommonVO, String baseLink, String eeLink) {
|
public ArmCommand.GetPoseMatrix.Response getPoseMatrix(EdgeCommonVO edgeCommonVO, String baseLink, String eeLink) {
|
||||||
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
||||||
|
|
||||||
ArmCommand.GetPoseMatrix.Request.Builder requestBuilder = ArmCommand.GetPoseMatrix.Request.newBuilder()
|
ArmCommand.GetPoseMatrix.Request.Builder requestBuilder = ArmCommand.GetPoseMatrix.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()));
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()));
|
||||||
@ -310,7 +310,7 @@ public class EdgeArmServiceImpl implements EdgeArmService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
edgeCommonVO.getTerminalId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
edgeCommonVO.getRobotId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建关节位置命令
|
// 构建关节位置命令
|
||||||
ArmCommand.JointPositionCommand jointsCommand = ArmCommand.JointPositionCommand.newBuilder()
|
ArmCommand.JointPositionCommand jointsCommand = ArmCommand.JointPositionCommand.newBuilder()
|
||||||
|
|||||||
@ -0,0 +1,100 @@
|
|||||||
|
package com.cmvr.edge.client.service.impl;
|
||||||
|
|
||||||
|
import cmvr.api.armteleop.v1.ArmTeleopServiceGrpc;
|
||||||
|
import cmvr.api.armteleop.v1.ArmTeleopV1;
|
||||||
|
import com.cmvr.common.exception.GlobalException;
|
||||||
|
import com.cmvr.edge.client.manage.GrpcBidiSessionRegistry;
|
||||||
|
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
||||||
|
import com.cmvr.edge.client.model.armteleop.EdgeArmTeleopHeartbeatVO;
|
||||||
|
import com.cmvr.edge.client.model.armteleop.EdgeArmTeleopOpenVO;
|
||||||
|
import com.cmvr.edge.client.model.armteleop.EdgeArmTeleopSetpointVO;
|
||||||
|
import com.cmvr.edge.client.model.armteleop.EdgeArmTeleopStopVO;
|
||||||
|
import com.cmvr.edge.client.service.EdgeArmTeleopService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EdgeArmTeleopServiceImpl implements EdgeArmTeleopService {
|
||||||
|
|
||||||
|
private final GrpcServiceManager grpcServiceManager;
|
||||||
|
private final GrpcBidiSessionRegistry<ArmTeleopV1.ClientFrame,
|
||||||
|
ArmTeleopV1.ServerFrame> sessions = new GrpcBidiSessionRegistry<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String open(EdgeArmTeleopOpenVO request) {
|
||||||
|
if (request.getRobotId() == null || request.getRobotId().trim().isEmpty()) {
|
||||||
|
throw new GlobalException("robotId cannot be empty");
|
||||||
|
}
|
||||||
|
ArmTeleopV1.RobotManifest.Builder manifest = ArmTeleopV1.RobotManifest.newBuilder();
|
||||||
|
if (request.getRobotId() != null) manifest.setRobotId(request.getRobotId());
|
||||||
|
if (request.getModelSha256() != null) manifest.setModelSha256(request.getModelSha256());
|
||||||
|
if (request.getCalibrationSha256() != null) manifest.setCalibrationSha256(request.getCalibrationSha256());
|
||||||
|
if (request.getJointNames() != null) manifest.addAllJointNames(request.getJointNames());
|
||||||
|
if (request.getPositionUnit() != null) manifest.setPositionUnit(request.getPositionUnit());
|
||||||
|
if (request.getVelocityUnit() != null) manifest.setVelocityUnit(request.getVelocityUnit());
|
||||||
|
if (request.getEffortUnit() != null) manifest.setEffortUnit(request.getEffortUnit());
|
||||||
|
if (request.getBaseFrame() != null) manifest.setBaseFrame(request.getBaseFrame());
|
||||||
|
if (request.getToolFrame() != null) manifest.setToolFrame(request.getToolFrame());
|
||||||
|
|
||||||
|
ArmTeleopV1.OpenSession.Builder open = ArmTeleopV1.OpenSession.newBuilder()
|
||||||
|
.setExpectedRobot(manifest)
|
||||||
|
.setRequestForceFeedback(request.isForceFeedback());
|
||||||
|
if (request.getProtocolMajor() != null) open.setProtocolMajor(request.getProtocolMajor());
|
||||||
|
if (request.getProtocolMinor() != null) open.setProtocolMinor(request.getProtocolMinor());
|
||||||
|
if (request.getClientInstanceId() != null) open.setClientInstanceId(request.getClientInstanceId());
|
||||||
|
if (request.getCommandRateHz() != null) open.setRequestedCommandRateHz(request.getCommandRateHz());
|
||||||
|
if (request.getStateRateHz() != null) open.setRequestedStateRateHz(request.getStateRateHz());
|
||||||
|
if (request.getWatchdogTimeoutMs() != null) open.setWatchdogTimeoutMs(request.getWatchdogTimeoutMs());
|
||||||
|
if (request.getLeaseMs() != null) open.setRequestedLeaseMs(request.getLeaseMs());
|
||||||
|
|
||||||
|
ArmTeleopServiceGrpc.ArmTeleopServiceStub stub = grpcServiceManager.getGrpcClient(
|
||||||
|
request.getRobotId(), ArmTeleopServiceGrpc.ArmTeleopServiceStub.class);
|
||||||
|
return sessions.open(stub::teleoperate, ArmTeleopV1.ClientFrame.newBuilder().setOpen(open).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendSetpoint(EdgeArmTeleopSetpointVO request) {
|
||||||
|
if (request.getSequence() <= 0) throw new GlobalException("sequence must be greater than zero");
|
||||||
|
if (request.getValidForUs() == null || request.getValidForUs() <= 0) {
|
||||||
|
throw new GlobalException("validForUs must be greater than zero");
|
||||||
|
}
|
||||||
|
ArmTeleopV1.JointSetpoint.Builder setpoint = ArmTeleopV1.JointSetpoint.newBuilder()
|
||||||
|
.setSequence(request.getSequence()).setValidForUs(request.getValidForUs());
|
||||||
|
if (request.getPositionRad() != null) {
|
||||||
|
for (double value : request.getPositionRad()) setpoint.addPositionRad(value);
|
||||||
|
}
|
||||||
|
if (request.getVelocityRadS() != null) {
|
||||||
|
for (double value : request.getVelocityRadS()) setpoint.addVelocityRadS(value);
|
||||||
|
}
|
||||||
|
sessions.send(request.getSessionId(), ArmTeleopV1.ClientFrame.newBuilder().setSetpoint(setpoint).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void heartbeat(EdgeArmTeleopHeartbeatVO request) {
|
||||||
|
ArmTeleopV1.ClientHeartbeat heartbeat = ArmTeleopV1.ClientHeartbeat.newBuilder()
|
||||||
|
.setSequence(request.getSequence()).build();
|
||||||
|
sessions.send(request.getSessionId(), ArmTeleopV1.ClientFrame.newBuilder().setHeartbeat(heartbeat).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ArmTeleopV1.ServerFrame getStatus(String sessionId) {
|
||||||
|
return sessions.getLatest(sessionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stop(EdgeArmTeleopStopVO request) {
|
||||||
|
ArmTeleopV1.StopReason reason;
|
||||||
|
try {
|
||||||
|
reason = request.getReason() == null || request.getReason().trim().isEmpty()
|
||||||
|
? ArmTeleopV1.StopReason.STOP_REASON_OPERATOR_REQUEST
|
||||||
|
: ArmTeleopV1.StopReason.valueOf(request.getReason().trim().toUpperCase());
|
||||||
|
} catch (IllegalArgumentException exception) {
|
||||||
|
throw new GlobalException("Invalid teleoperation stop reason");
|
||||||
|
}
|
||||||
|
ArmTeleopV1.StopSession stop = ArmTeleopV1.StopSession.newBuilder()
|
||||||
|
.setReason(reason).setDetail(request.getDetail() == null ? "" : request.getDetail()).build();
|
||||||
|
sessions.send(request.getSessionId(), ArmTeleopV1.ClientFrame.newBuilder().setStop(stop).build());
|
||||||
|
sessions.close(request.getSessionId());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -23,9 +23,9 @@ public class EdgeBioHeadServiceImpl implements EdgeBioHeadService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String setExpression(EdgeFacialExpressionVO facialExpressionVo) {
|
public String setExpression(EdgeFacialExpressionVO facialExpressionVo) {
|
||||||
String terminalId = facialExpressionVo.getTerminalId();
|
String robotId = facialExpressionVo.getRobotId();
|
||||||
String deviceId = facialExpressionVo.getDeviceId();
|
String deviceId = facialExpressionVo.getDeviceId();
|
||||||
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
||||||
|
|
||||||
// 请求头
|
// 请求头
|
||||||
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
||||||
@ -110,9 +110,9 @@ public class EdgeBioHeadServiceImpl implements EdgeBioHeadService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSystemStatus(EdgeCommonVO edgeCommonVO) {
|
public String getSystemStatus(EdgeCommonVO edgeCommonVO) {
|
||||||
String terminalId = edgeCommonVO.getTerminalId();
|
String robotId = edgeCommonVO.getRobotId();
|
||||||
String deviceId = edgeCommonVO.getDeviceId();
|
String deviceId = edgeCommonVO.getDeviceId();
|
||||||
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
||||||
|
|
||||||
// 请求头
|
// 请求头
|
||||||
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
||||||
@ -126,9 +126,9 @@ public class EdgeBioHeadServiceImpl implements EdgeBioHeadService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String emergencyStop(EdgeCommonVO edgeCommonVO) {
|
public String emergencyStop(EdgeCommonVO edgeCommonVO) {
|
||||||
String terminalId = edgeCommonVO.getTerminalId();
|
String robotId = edgeCommonVO.getRobotId();
|
||||||
String deviceId = edgeCommonVO.getDeviceId();
|
String deviceId = edgeCommonVO.getDeviceId();
|
||||||
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
||||||
|
|
||||||
// 请求头
|
// 请求头
|
||||||
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
||||||
@ -142,9 +142,9 @@ public class EdgeBioHeadServiceImpl implements EdgeBioHeadService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String speakStart(EdgeCommonVO edgeCommonVO) {
|
public String speakStart(EdgeCommonVO edgeCommonVO) {
|
||||||
String terminalId = edgeCommonVO.getTerminalId();
|
String robotId = edgeCommonVO.getRobotId();
|
||||||
String deviceId = edgeCommonVO.getDeviceId();
|
String deviceId = edgeCommonVO.getDeviceId();
|
||||||
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
||||||
|
|
||||||
// 请求头
|
// 请求头
|
||||||
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
||||||
@ -155,9 +155,9 @@ public class EdgeBioHeadServiceImpl implements EdgeBioHeadService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String speakStop(EdgeCommonVO edgeCommonVO) {
|
public String speakStop(EdgeCommonVO edgeCommonVO) {
|
||||||
String terminalId = edgeCommonVO.getTerminalId();
|
String robotId = edgeCommonVO.getRobotId();
|
||||||
String deviceId = edgeCommonVO.getDeviceId();
|
String deviceId = edgeCommonVO.getDeviceId();
|
||||||
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
||||||
|
|
||||||
// 请求头
|
// 请求头
|
||||||
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
||||||
@ -167,8 +167,8 @@ public class EdgeBioHeadServiceImpl implements EdgeBioHeadService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String specialExpression(String terminalId, String deviceId, Integer expressKey) {
|
public String specialExpression(String robotId, String deviceId, Integer expressKey) {
|
||||||
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
||||||
|
|
||||||
// 请求头
|
// 请求头
|
||||||
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
||||||
|
|||||||
@ -10,14 +10,17 @@ import com.cmvr.common.enums.FileType;
|
|||||||
import com.cmvr.common.exception.GlobalException;
|
import com.cmvr.common.exception.GlobalException;
|
||||||
import com.cmvr.edge.client.file.ByteArrayMultipartFile;
|
import com.cmvr.edge.client.file.ByteArrayMultipartFile;
|
||||||
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
||||||
|
import com.cmvr.edge.client.manage.GrpcStreamManager;
|
||||||
import com.cmvr.edge.client.model.EdgeCommonVO;
|
import com.cmvr.edge.client.model.EdgeCommonVO;
|
||||||
|
import com.cmvr.edge.client.model.camera.EdgeCameraPtzVO;
|
||||||
import com.cmvr.edge.client.service.EdgeCameraService;
|
import com.cmvr.edge.client.service.EdgeCameraService;
|
||||||
import com.cmvr.edge.client.service.EdgeStreamService;
|
import com.cmvr.edge.client.service.EdgeStreamService;
|
||||||
import com.cmvr.edge.client.utils.EdgeCommonUtil;
|
import com.cmvr.edge.client.utils.EdgeCommonUtil;
|
||||||
import com.cmvr.edge.client.utils.H265DecoderUtil;
|
import com.cmvr.edge.client.utils.H265Fmp4Transcoder;
|
||||||
import com.cmvr.framework.websocket.service.MessagePushService;
|
import com.cmvr.framework.websocket.service.MessagePushService;
|
||||||
import com.cmvr.system.service.ISysFileService;
|
import com.cmvr.system.service.ISysFileService;
|
||||||
import com.google.protobuf.ByteString;
|
import com.google.protobuf.ByteString;
|
||||||
|
import io.grpc.Status;
|
||||||
import io.grpc.stub.StreamObserver;
|
import io.grpc.stub.StreamObserver;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -43,12 +46,17 @@ import java.io.ByteArrayOutputStream;
|
|||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.ByteOrder;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ -63,7 +71,7 @@ public class EdgeCameraServiceImpl implements EdgeCameraService, EdgeStreamServi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CameraCommand.CameraState status(EdgeCommonVO edgeCommonVO) {
|
public CameraCommand.CameraState status(EdgeCommonVO edgeCommonVO) {
|
||||||
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getTerminalId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getRobotId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
CameraCommand.GetCameraStateCommand.Request request = CameraCommand.GetCameraStateCommand.Request.newBuilder()
|
CameraCommand.GetCameraStateCommand.Request request = CameraCommand.GetCameraStateCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.build();
|
.build();
|
||||||
@ -81,7 +89,7 @@ public class EdgeCameraServiceImpl implements EdgeCameraService, EdgeStreamServi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String start(EdgeCommonVO edgeCommonVO) {
|
public String start(EdgeCommonVO edgeCommonVO) {
|
||||||
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getTerminalId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getRobotId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
CameraCommand.StartCameraCommand.Request request = CameraCommand.StartCameraCommand.Request.newBuilder()
|
CameraCommand.StartCameraCommand.Request request = CameraCommand.StartCameraCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.build();
|
.build();
|
||||||
@ -91,7 +99,7 @@ public class EdgeCameraServiceImpl implements EdgeCameraService, EdgeStreamServi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String stop(EdgeCommonVO edgeCommonVO) {
|
public String stop(EdgeCommonVO edgeCommonVO) {
|
||||||
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getTerminalId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getRobotId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
CameraCommand.StopCameraCommand.Request request = CameraCommand.StopCameraCommand.Request.newBuilder()
|
CameraCommand.StopCameraCommand.Request request = CameraCommand.StopCameraCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.build();
|
.build();
|
||||||
@ -105,7 +113,7 @@ public class EdgeCameraServiceImpl implements EdgeCameraService, EdgeStreamServi
|
|||||||
if (!checkStatus(edgeCommonVO)) {
|
if (!checkStatus(edgeCommonVO)) {
|
||||||
start(edgeCommonVO);
|
start(edgeCommonVO);
|
||||||
}
|
}
|
||||||
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getTerminalId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getRobotId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
CameraCommand.GetRGBImageCommand.Request request = CameraCommand.GetRGBImageCommand.Request.newBuilder()
|
CameraCommand.GetRGBImageCommand.Request request = CameraCommand.GetRGBImageCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.build();
|
.build();
|
||||||
@ -123,7 +131,32 @@ public class EdgeCameraServiceImpl implements EdgeCameraService, EdgeStreamServi
|
|||||||
} finally {
|
} finally {
|
||||||
deleteTempFile(filePath);
|
deleteTempFile(filePath);
|
||||||
// todo 暂时不关闭摄像头
|
// todo 暂时不关闭摄像头
|
||||||
// stop(terminalId, deviceId);
|
// stop(robotId, deviceId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDepthImage(EdgeCommonVO edgeCommonVO) {
|
||||||
|
if (!checkStatus(edgeCommonVO)) {
|
||||||
|
start(edgeCommonVO);
|
||||||
|
}
|
||||||
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
|
edgeCommonVO.getRobotId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
|
CameraCommand.GetDepthImageCommand.Request request = CameraCommand.GetDepthImageCommand.Request.newBuilder()
|
||||||
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
|
.build();
|
||||||
|
CameraCommand.GetDepthImageCommand.Feedback feedback = executeGrpcCall(() -> stub.getDepthImage(request));
|
||||||
|
CameraCommand.FrameData frame = feedback.getDepthFrame();
|
||||||
|
if (!feedback.hasDepthFrame() || frame.getWidth() <= 0 || frame.getHeight() <= 0) {
|
||||||
|
throw new GlobalException("Depth image data is invalid");
|
||||||
|
}
|
||||||
|
String filePath = saveDepthImage(frame);
|
||||||
|
try {
|
||||||
|
return sysFileService.uploadFile(convertFileToMultipartFile(filePath), FileType.IMAGE.code());
|
||||||
|
} catch (IOException exception) {
|
||||||
|
throw new GlobalException("Depth image upload failed: " + exception.getMessage());
|
||||||
|
} finally {
|
||||||
|
deleteTempFile(filePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,7 +165,7 @@ public class EdgeCameraServiceImpl implements EdgeCameraService, EdgeStreamServi
|
|||||||
if (!checkStatus(edgeCommonVO)) {
|
if (!checkStatus(edgeCommonVO)) {
|
||||||
start(edgeCommonVO);
|
start(edgeCommonVO);
|
||||||
}
|
}
|
||||||
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getTerminalId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getRobotId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
String videoPath = StrUtil.format("{}/{}_{}.mp4", "/home/share/assets/video", edgeCommonVO.getDeviceId(), System.currentTimeMillis());
|
String videoPath = StrUtil.format("{}/{}_{}.mp4", "/home/share/assets/video", edgeCommonVO.getDeviceId(), System.currentTimeMillis());
|
||||||
|
|
||||||
CameraCommand.StartCameraRecordingCommand.Request request = CameraCommand.StartCameraRecordingCommand.Request.newBuilder()
|
CameraCommand.StartCameraRecordingCommand.Request request = CameraCommand.StartCameraRecordingCommand.Request.newBuilder()
|
||||||
@ -145,7 +178,7 @@ public class EdgeCameraServiceImpl implements EdgeCameraService, EdgeStreamServi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String stopRecording(EdgeCommonVO edgeCommonVO) {
|
public String stopRecording(EdgeCommonVO edgeCommonVO) {
|
||||||
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getTerminalId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getRobotId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
CameraCommand.StopCameraRecordingCommand.Request request = CameraCommand.StopCameraRecordingCommand.Request.newBuilder()
|
CameraCommand.StopCameraRecordingCommand.Request request = CameraCommand.StopCameraRecordingCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.build();
|
.build();
|
||||||
@ -159,7 +192,7 @@ public class EdgeCameraServiceImpl implements EdgeCameraService, EdgeStreamServi
|
|||||||
start(edgeCommonVO);
|
start(edgeCommonVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getTerminalId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getRobotId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
CameraCommand.GetRGBDImagesCommand.Request request = CameraCommand.GetRGBDImagesCommand.Request.newBuilder()
|
CameraCommand.GetRGBDImagesCommand.Request request = CameraCommand.GetRGBDImagesCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.build();
|
.build();
|
||||||
@ -188,80 +221,256 @@ public class EdgeCameraServiceImpl implements EdgeCameraService, EdgeStreamServi
|
|||||||
// deleteTempFile(filePath);
|
// deleteTempFile(filePath);
|
||||||
// deleteTempFile(deepFilePath);
|
// deleteTempFile(deepFilePath);
|
||||||
// todo 暂时不关闭摄像头
|
// todo 暂时不关闭摄像头
|
||||||
// stop(terminalId, deviceId);
|
// stop(robotId, deviceId);
|
||||||
}
|
}
|
||||||
// return JSON.toJSONString(result);
|
// return JSON.toJSONString(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 缓冲区和收集状态
|
@Override
|
||||||
private final List<byte[]> framesBuffer = new ArrayList<>();
|
public String controlPtz(EdgeCameraPtzVO ptzVO) {
|
||||||
private boolean isCollectingFrames = false;
|
CameraCommand.ControlPtzCommand.Command command;
|
||||||
|
CameraCommand.ControlPtzCommand.Action action;
|
||||||
|
try {
|
||||||
|
command = CameraCommand.ControlPtzCommand.Command.valueOf(ptzVO.getCommand().trim().toUpperCase());
|
||||||
|
action = CameraCommand.ControlPtzCommand.Action.valueOf(ptzVO.getAction().trim().toUpperCase());
|
||||||
|
} catch (RuntimeException exception) {
|
||||||
|
throw new GlobalException("Invalid PTZ command or action");
|
||||||
|
}
|
||||||
|
CameraServiceGrpc.CameraServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
|
ptzVO.getRobotId(), CameraServiceGrpc.CameraServiceBlockingStub.class);
|
||||||
|
CameraCommand.ControlPtzCommand.Request request = CameraCommand.ControlPtzCommand.Request.newBuilder()
|
||||||
|
.setHeader(EdgeCommonUtil.buildRequest(ptzVO.getDeviceId()))
|
||||||
|
.setCommand(command)
|
||||||
|
.setAction(action)
|
||||||
|
.setSpeed(ptzVO.getSpeed() == null ? 0 : ptzVO.getSpeed())
|
||||||
|
.build();
|
||||||
|
return JSON.toJSONString(executeGrpcCall(() -> stub.controlPtz(request)).getHeader());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request> getRGBImageStream(EdgeCommonVO edgeCommonVO) {
|
public StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request> getRGBImageStream(EdgeCommonVO edgeCommonVO) {
|
||||||
if (!checkStatus(edgeCommonVO)) {
|
return getRGBImageStream(edgeCommonVO.getRobotId(), edgeCommonVO.getDeviceId());
|
||||||
start(edgeCommonVO);
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request> getRGBImageStream(String robotId, String deviceId) {
|
||||||
|
EdgeCommonVO edgeCommonVO = new EdgeCommonVO();
|
||||||
|
edgeCommonVO.setRobotId(robotId);
|
||||||
|
edgeCommonVO.setDeviceId(deviceId);
|
||||||
|
CameraCommand.CameraState cameraState = status(edgeCommonVO);
|
||||||
|
if (cameraState.getIsError()) {
|
||||||
|
throw new GlobalException("Camera is in error state");
|
||||||
}
|
}
|
||||||
String terminalId = edgeCommonVO.getTerminalId();
|
if (!cameraState.getIsOpened() || !cameraState.getIsStreaming()) {
|
||||||
String deviceId = edgeCommonVO.getDeviceId();
|
start(edgeCommonVO);
|
||||||
CameraServiceGrpc.CameraServiceStub stub = grpcServiceManager.getGrpcClient(terminalId, CameraServiceGrpc.CameraServiceStub.class);
|
cameraState = status(edgeCommonVO);
|
||||||
// 创建StreamObserver来处理响应
|
}
|
||||||
|
int frameRate = cameraState.getFps();
|
||||||
|
String channel = "edgeCameraServiceImpl/getRGBImageStream/" + robotId + "/" + deviceId;
|
||||||
|
String streamKey = robotId + deviceId + "edgeCameraServiceImpl" + "getRGBImageStream";
|
||||||
|
AtomicInteger sequence = new AtomicInteger();
|
||||||
|
AtomicBoolean firstMediaChunk = new AtomicBoolean(true);
|
||||||
|
AtomicReference<StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request>> requestObserverRef = new AtomicReference<>();
|
||||||
|
|
||||||
|
H265Fmp4Transcoder transcoder;
|
||||||
|
try {
|
||||||
|
transcoder = new H265Fmp4Transcoder(
|
||||||
|
robotId + "-" + deviceId,
|
||||||
|
frameRate,
|
||||||
|
chunk -> {
|
||||||
|
int currentSequence = sequence.incrementAndGet();
|
||||||
|
if (firstMediaChunk.compareAndSet(true, false)) {
|
||||||
|
log.info("摄像头流已输出首个fMP4片段, robotId: {}, deviceId: {}, bytes: {}",
|
||||||
|
robotId, deviceId, chunk.length);
|
||||||
|
}
|
||||||
|
messagePushService.pushH264Fmp4ToChannel(channel, chunk, currentSequence);
|
||||||
|
},
|
||||||
|
throwable -> {
|
||||||
|
log.error("摄像头媒体转码失败, robotId: {}, deviceId: {}", robotId, deviceId, throwable);
|
||||||
|
messagePushService.pushToChannel(channel, "500");
|
||||||
|
StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request> observer = requestObserverRef.get();
|
||||||
|
if (observer != null) {
|
||||||
|
observer.onError(Status.INTERNAL.withDescription("媒体转码失败").withCause(throwable).asRuntimeException());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
transcoder.start();
|
||||||
|
} catch (IOException exception) {
|
||||||
|
throw new GlobalException("摄像头媒体转码器初始化失败: " + exception.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
CameraServiceGrpc.CameraServiceStub stub = grpcServiceManager.getGrpcClient(robotId, CameraServiceGrpc.CameraServiceStub.class);
|
||||||
StreamObserver<CameraCommand.GetRGBImageStreamCommand.Feedback> responseObserver = new StreamObserver<CameraCommand.GetRGBImageStreamCommand.Feedback>() {
|
StreamObserver<CameraCommand.GetRGBImageStreamCommand.Feedback> responseObserver = new StreamObserver<CameraCommand.GetRGBImageStreamCommand.Feedback>() {
|
||||||
@Override
|
@Override
|
||||||
public void onNext(CameraCommand.GetRGBImageStreamCommand.Feedback value) {
|
public void onNext(CameraCommand.GetRGBImageStreamCommand.Feedback value) {
|
||||||
CameraCommand.FrameData frame = value.getColorFrame();
|
try {
|
||||||
byte[] frameData = frame.getData().toByteArray();
|
CameraCommand.FrameData frame = value.getColorFrame();
|
||||||
|
transcoder.write(frame.getData().toByteArray(), frame.getIsKeyFrame(), frame.getCodec());
|
||||||
if (frame.getIsKeyFrame()) { // I帧
|
} catch (IOException exception) {
|
||||||
if (isCollectingFrames) {
|
log.error("写入摄像头媒体流失败, robotId: {}, deviceId: {}", robotId, deviceId, exception);
|
||||||
// 处理之前的缓冲区数据
|
transcoder.close();
|
||||||
String videoBase64 = H265DecoderUtil.convertH265FramesToVideo(framesBuffer);
|
messagePushService.pushToChannel(channel, "500");
|
||||||
if (videoBase64 != null) {
|
|
||||||
messagePushService.pushToChannel(
|
|
||||||
"edgeCameraServiceImpl/getRGBImageStream/" + terminalId + "/" + deviceId,
|
|
||||||
videoBase64
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// 重置缓冲区
|
|
||||||
framesBuffer.clear();
|
|
||||||
}
|
|
||||||
// 开始新收集段
|
|
||||||
framesBuffer.add(frameData);
|
|
||||||
isCollectingFrames = true;
|
|
||||||
} else {
|
|
||||||
// 非I帧且正在收集时加入缓冲区
|
|
||||||
if (isCollectingFrames) {
|
|
||||||
framesBuffer.add(frameData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable t) {
|
public void onError(Throwable t) {
|
||||||
// 记录详细的错误信息
|
transcoder.close();
|
||||||
log.error("Error occurred in getRGBImageStream for terminalId: {}, deviceId: {}. Error: {}", terminalId, deviceId, t.getMessage(), t);
|
GrpcStreamManager.removeStream(streamKey);
|
||||||
// 推送错误信息
|
Status status = Status.fromThrowable(t);
|
||||||
messagePushService.pushToChannel("edgeCameraServiceImpl/getRGBImageStream/" + terminalId + "/" + deviceId, "500");
|
if (status.getCode() != Status.Code.CANCELLED) {
|
||||||
|
log.error("摄像头gRPC流异常, robotId: {}, deviceId: {}", robotId, deviceId, t);
|
||||||
|
messagePushService.pushToChannel(channel, "500");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCompleted() {
|
public void onCompleted() {
|
||||||
// 流结束
|
transcoder.close();
|
||||||
System.out.println("Stream completed.");
|
GrpcStreamManager.removeStream(streamKey);
|
||||||
|
log.info("摄像头gRPC流结束, robotId: {}, deviceId: {}", robotId, deviceId);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// 创建StreamObserver来发送请求
|
StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request> grpcRequestObserver;
|
||||||
StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request> requestObserver = stub.getRGBImageStream(responseObserver);
|
try {
|
||||||
|
grpcRequestObserver = stub.getRGBImageStream(responseObserver);
|
||||||
|
requestObserverRef.set(grpcRequestObserver);
|
||||||
|
} catch (RuntimeException exception) {
|
||||||
|
transcoder.close();
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
// 构建请求并发送
|
|
||||||
CameraCommand.GetRGBImageStreamCommand.Request request = CameraCommand.GetRGBImageStreamCommand.Request.newBuilder()
|
CameraCommand.GetRGBImageStreamCommand.Request request = CameraCommand.GetRGBImageStreamCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(deviceId))
|
.setHeader(EdgeCommonUtil.buildRequest(deviceId))
|
||||||
.setEof(false)
|
.setEof(false)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
requestObserver.onNext(request);
|
grpcRequestObserver.onNext(request);
|
||||||
return requestObserver;
|
return new StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request>() {
|
||||||
|
@Override
|
||||||
|
public void onNext(CameraCommand.GetRGBImageStreamCommand.Request value) {
|
||||||
|
grpcRequestObserver.onNext(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable throwable) {
|
||||||
|
transcoder.close();
|
||||||
|
grpcRequestObserver.onError(throwable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCompleted() {
|
||||||
|
transcoder.close();
|
||||||
|
grpcRequestObserver.onCompleted();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeRGBVideoStream(String robotId, String deviceId, OutputStream outputStream) {
|
||||||
|
EdgeCommonVO edgeCommonVO = new EdgeCommonVO();
|
||||||
|
edgeCommonVO.setRobotId(robotId);
|
||||||
|
edgeCommonVO.setDeviceId(deviceId);
|
||||||
|
CameraCommand.CameraState cameraState = status(edgeCommonVO);
|
||||||
|
if (cameraState.getIsError()) {
|
||||||
|
throw new GlobalException("Camera is in error state");
|
||||||
|
}
|
||||||
|
if (!cameraState.getIsOpened() || !cameraState.getIsStreaming()) {
|
||||||
|
start(edgeCommonVO);
|
||||||
|
cameraState = status(edgeCommonVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
CountDownLatch finished = new CountDownLatch(1);
|
||||||
|
AtomicBoolean streamFinished = new AtomicBoolean(false);
|
||||||
|
AtomicReference<StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request>> requestObserverRef =
|
||||||
|
new AtomicReference<>();
|
||||||
|
Runnable finishStream = () -> {
|
||||||
|
if (streamFinished.compareAndSet(false, true)) {
|
||||||
|
finished.countDown();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
H265Fmp4Transcoder transcoder;
|
||||||
|
try {
|
||||||
|
transcoder = new H265Fmp4Transcoder(
|
||||||
|
"http-" + robotId + "-" + deviceId,
|
||||||
|
cameraState.getFps(),
|
||||||
|
chunk -> {
|
||||||
|
try {
|
||||||
|
outputStream.write(chunk);
|
||||||
|
outputStream.flush();
|
||||||
|
} catch (IOException exception) {
|
||||||
|
throw new CameraStreamWriteException(exception);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
throwable -> {
|
||||||
|
if (!(throwable instanceof CameraStreamWriteException)) {
|
||||||
|
log.error("HTTP camera media transcoding failed, robotId: {}, deviceId: {}",
|
||||||
|
robotId, deviceId, throwable);
|
||||||
|
}
|
||||||
|
finishStream.run();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
transcoder.start();
|
||||||
|
} catch (IOException exception) {
|
||||||
|
throw new GlobalException("Failed to initialize camera video stream: " + exception.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
CameraServiceGrpc.CameraServiceStub stub = grpcServiceManager.getGrpcClient(
|
||||||
|
robotId, CameraServiceGrpc.CameraServiceStub.class);
|
||||||
|
StreamObserver<CameraCommand.GetRGBImageStreamCommand.Feedback> responseObserver =
|
||||||
|
new StreamObserver<CameraCommand.GetRGBImageStreamCommand.Feedback>() {
|
||||||
|
@Override
|
||||||
|
public void onNext(CameraCommand.GetRGBImageStreamCommand.Feedback value) {
|
||||||
|
CameraCommand.FrameData frame = value.getColorFrame();
|
||||||
|
try {
|
||||||
|
transcoder.write(frame.getData().toByteArray(), frame.getIsKeyFrame(), frame.getCodec());
|
||||||
|
} catch (IOException exception) {
|
||||||
|
log.error("Failed to write HTTP camera frame, robotId: {}, deviceId: {}, codec: {}",
|
||||||
|
robotId, deviceId, frame.getCodec(), exception);
|
||||||
|
finishStream.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable throwable) {
|
||||||
|
Status status = Status.fromThrowable(throwable);
|
||||||
|
if (status.getCode() != Status.Code.CANCELLED && !streamFinished.get()) {
|
||||||
|
log.warn("HTTP camera gRPC stream ended, robotId: {}, deviceId: {}, status: {}",
|
||||||
|
robotId, deviceId, status);
|
||||||
|
}
|
||||||
|
finishStream.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCompleted() {
|
||||||
|
finishStream.run();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request> requestObserver =
|
||||||
|
stub.getRGBImageStream(responseObserver);
|
||||||
|
requestObserverRef.set(requestObserver);
|
||||||
|
requestObserver.onNext(CameraCommand.GetRGBImageStreamCommand.Request.newBuilder()
|
||||||
|
.setHeader(EdgeCommonUtil.buildRequest(deviceId))
|
||||||
|
.setEof(false)
|
||||||
|
.build());
|
||||||
|
finished.await();
|
||||||
|
} catch (InterruptedException exception) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
} finally {
|
||||||
|
transcoder.close();
|
||||||
|
StreamObserver<CameraCommand.GetRGBImageStreamCommand.Request> requestObserver =
|
||||||
|
requestObserverRef.getAndSet(null);
|
||||||
|
if (requestObserver != null) {
|
||||||
|
try {
|
||||||
|
requestObserver.onCompleted();
|
||||||
|
} catch (RuntimeException ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -447,4 +656,57 @@ public class EdgeCameraServiceImpl implements EdgeCameraService, EdgeStreamServi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String saveDepthImage(CameraCommand.FrameData frame) {
|
||||||
|
int pixelCount = frame.getWidth() * frame.getHeight();
|
||||||
|
byte[] source = frame.getData().toByteArray();
|
||||||
|
if (frame.getType() == CameraCommand.FrameData.FrameType.U8C1) {
|
||||||
|
if (source.length < pixelCount) {
|
||||||
|
throw new GlobalException("Depth image byte count is invalid");
|
||||||
|
}
|
||||||
|
return saveImage(ByteString.copyFrom(source, 0, pixelCount), frame.getWidth(), frame.getHeight(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
double[] values = new double[pixelCount];
|
||||||
|
ByteBuffer buffer = ByteBuffer.wrap(source).order(ByteOrder.LITTLE_ENDIAN);
|
||||||
|
if (frame.getType() == CameraCommand.FrameData.FrameType.F32C1) {
|
||||||
|
if (source.length < pixelCount * Float.BYTES) {
|
||||||
|
throw new GlobalException("F32 depth image byte count is invalid");
|
||||||
|
}
|
||||||
|
for (int i = 0; i < pixelCount; i++) values[i] = buffer.getFloat();
|
||||||
|
} else if (frame.getType() == CameraCommand.FrameData.FrameType.U16C1
|
||||||
|
|| frame.getType() == CameraCommand.FrameData.FrameType.F16C1) {
|
||||||
|
if (source.length < pixelCount * Short.BYTES) {
|
||||||
|
throw new GlobalException("16-bit depth image byte count is invalid");
|
||||||
|
}
|
||||||
|
for (int i = 0; i < pixelCount; i++) values[i] = Short.toUnsignedInt(buffer.getShort());
|
||||||
|
} else {
|
||||||
|
throw new GlobalException("Unsupported depth frame type: " + frame.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
double min = Double.POSITIVE_INFINITY;
|
||||||
|
double max = Double.NEGATIVE_INFINITY;
|
||||||
|
for (double value : values) {
|
||||||
|
if (Double.isFinite(value) && value > 0) {
|
||||||
|
min = Math.min(min, value);
|
||||||
|
max = Math.max(max, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
byte[] grayscale = new byte[pixelCount];
|
||||||
|
if (Double.isFinite(min) && max > min) {
|
||||||
|
double scale = 255.0 / (max - min);
|
||||||
|
for (int i = 0; i < values.length; i++) {
|
||||||
|
double value = values[i];
|
||||||
|
grayscale[i] = !Double.isFinite(value) || value <= 0
|
||||||
|
? 0 : (byte) Math.max(0, Math.min(255, Math.round((value - min) * scale)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return saveImage(ByteString.copyFrom(grayscale), frame.getWidth(), frame.getHeight(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class CameraStreamWriteException extends RuntimeException {
|
||||||
|
private CameraStreamWriteException(IOException cause) {
|
||||||
|
super(cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,8 +24,8 @@ public class EdgeDexHandServiceImpl implements EdgeDexHandService, EdgeStreamSer
|
|||||||
private final MessagePushService messagePushService;
|
private final MessagePushService messagePushService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DexhandCommand.DexHandState getStatus(String terminalId, String deviceId) {
|
public DexhandCommand.DexHandState getStatus(String robotId, String deviceId) {
|
||||||
DexHandServiceGrpc.DexHandServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, DexHandServiceGrpc.DexHandServiceBlockingStub.class);
|
DexHandServiceGrpc.DexHandServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, DexHandServiceGrpc.DexHandServiceBlockingStub.class);
|
||||||
DexhandCommand.GetDexHandStateCommand.Request request = DexhandCommand.GetDexHandStateCommand.Request.newBuilder()
|
DexhandCommand.GetDexHandStateCommand.Request request = DexhandCommand.GetDexHandStateCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(deviceId))
|
.setHeader(EdgeCommonUtil.buildRequest(deviceId))
|
||||||
.build();
|
.build();
|
||||||
@ -33,13 +33,13 @@ public class EdgeDexHandServiceImpl implements EdgeDexHandService, EdgeStreamSer
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDexHandPos(String terminalId, String deviceId) {
|
public void setDexHandPos(String robotId, String deviceId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDexHandAngle(String terminalId, String deviceId, int id, float value) {
|
public void setDexHandAngle(String robotId, String deviceId, int id, float value) {
|
||||||
DexHandServiceGrpc.DexHandServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, DexHandServiceGrpc.DexHandServiceBlockingStub.class);
|
DexHandServiceGrpc.DexHandServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, DexHandServiceGrpc.DexHandServiceBlockingStub.class);
|
||||||
DexhandCommand.FreedomValue.Builder builder = DexhandCommand.FreedomValue.newBuilder();
|
DexhandCommand.FreedomValue.Builder builder = DexhandCommand.FreedomValue.newBuilder();
|
||||||
builder.setId(id);
|
builder.setId(id);
|
||||||
builder.setValue(value);
|
builder.setValue(value);
|
||||||
@ -51,23 +51,23 @@ public class EdgeDexHandServiceImpl implements EdgeDexHandService, EdgeStreamSer
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDexHandForce(String terminalId, String deviceId) {
|
public void setDexHandForce(String robotId, String deviceId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDexHandSpeed(String terminalId, String deviceId) {
|
public void setDexHandSpeed(String robotId, String deviceId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDexHandPresetAct(String terminalId, String deviceId) {
|
public void setDexHandPresetAct(String robotId, String deviceId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSensorData(String terminalId, String deviceId) {
|
public String getSensorData(String robotId, String deviceId) {
|
||||||
DexHandServiceGrpc.DexHandServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, DexHandServiceGrpc.DexHandServiceBlockingStub.class);
|
DexHandServiceGrpc.DexHandServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, DexHandServiceGrpc.DexHandServiceBlockingStub.class);
|
||||||
DexhandCommand.GetSensorDataCommand.Request request = DexhandCommand.GetSensorDataCommand.Request.newBuilder()
|
DexhandCommand.GetSensorDataCommand.Request request = DexhandCommand.GetSensorDataCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(deviceId))
|
.setHeader(EdgeCommonUtil.buildRequest(deviceId))
|
||||||
.build();
|
.build();
|
||||||
@ -76,14 +76,14 @@ public class EdgeDexHandServiceImpl implements EdgeDexHandService, EdgeStreamSer
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StreamObserver<DexhandCommand.GetSensorDataStreamCommand.Request> getSensorDataStream(String terminalId, String deviceId) {
|
public StreamObserver<DexhandCommand.GetSensorDataStreamCommand.Request> getSensorDataStream(String robotId, String deviceId) {
|
||||||
DexHandServiceGrpc.DexHandServiceStub stub = grpcServiceManager.getGrpcClient(terminalId, DexHandServiceGrpc.DexHandServiceStub.class);
|
DexHandServiceGrpc.DexHandServiceStub stub = grpcServiceManager.getGrpcClient(robotId, DexHandServiceGrpc.DexHandServiceStub.class);
|
||||||
StreamObserver<DexhandCommand.GetSensorDataStreamCommand.Feedback> responseObserver = new StreamObserver<DexhandCommand.GetSensorDataStreamCommand.Feedback>() {
|
StreamObserver<DexhandCommand.GetSensorDataStreamCommand.Feedback> responseObserver = new StreamObserver<DexhandCommand.GetSensorDataStreamCommand.Feedback>() {
|
||||||
@Override
|
@Override
|
||||||
public void onNext(DexhandCommand.GetSensorDataStreamCommand.Feedback value) {
|
public void onNext(DexhandCommand.GetSensorDataStreamCommand.Feedback value) {
|
||||||
// 例如,将传感器数据转换为JSON字符串
|
// 例如,将传感器数据转换为JSON字符串
|
||||||
String playLoad = JSON.toJSONString(value.getSensorList());
|
String playLoad = JSON.toJSONString(value.getSensorList());
|
||||||
messagePushService.pushToChannel("edgeDexHandServiceImpl/getSensorDataStream/" + terminalId + "/" + deviceId, playLoad);
|
messagePushService.pushToChannel("edgeDexHandServiceImpl/getSensorDataStream/" + robotId + "/" + deviceId, playLoad);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -26,8 +26,8 @@ public class EdgeHlcServiceImpl implements EdgeHlcService {
|
|||||||
private final GrpcServiceManager grpcServiceManager;
|
private final GrpcServiceManager grpcServiceManager;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String touch(File image, String terminalId, String deviceId, int x, int y, double maxForce) {
|
public String touch(File image, String robotId, String deviceId, int x, int y, double maxForce) {
|
||||||
HlcServiceGrpc.HlcServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, HlcServiceGrpc.HlcServiceBlockingStub.class);
|
HlcServiceGrpc.HlcServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, HlcServiceGrpc.HlcServiceBlockingStub.class);
|
||||||
HlcCommand.Touch.Request request = HlcCommand.Touch.Request.newBuilder()
|
HlcCommand.Touch.Request request = HlcCommand.Touch.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(deviceId))
|
.setHeader(EdgeCommonUtil.buildRequest(deviceId))
|
||||||
.setU(x)
|
.setU(x)
|
||||||
@ -89,7 +89,7 @@ public class EdgeHlcServiceImpl implements EdgeHlcService {
|
|||||||
if (edgeTouchVO.getX() == edgeTouchVO.getY() && edgeTouchVO.getX() == 0) {
|
if (edgeTouchVO.getX() == edgeTouchVO.getY() && edgeTouchVO.getX() == 0) {
|
||||||
throw new GlobalException("触控坐标不能为0");
|
throw new GlobalException("触控坐标不能为0");
|
||||||
}
|
}
|
||||||
HlcServiceGrpc.HlcServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeTouchVO.getTerminalId(), HlcServiceGrpc.HlcServiceBlockingStub.class);
|
HlcServiceGrpc.HlcServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeTouchVO.getRobotId(), HlcServiceGrpc.HlcServiceBlockingStub.class);
|
||||||
HlcCommand.Touch.Request request = HlcCommand.Touch.Request.newBuilder()
|
HlcCommand.Touch.Request request = HlcCommand.Touch.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeTouchVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeTouchVO.getDeviceId()))
|
||||||
.setU(edgeTouchVO.getX())
|
.setU(edgeTouchVO.getX())
|
||||||
|
|||||||
@ -41,7 +41,7 @@ public class EdgeMicrophoneServiceImpl implements EdgeMicrophoneService {
|
|||||||
@Override
|
@Override
|
||||||
public String getStatus(EdgeCommonVO edgeCommonVO) {
|
public String getStatus(EdgeCommonVO edgeCommonVO) {
|
||||||
try {
|
try {
|
||||||
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getTerminalId(), MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getRobotId(), MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
||||||
MicrophoneCommand.GetMicStateCommand.Request request = MicrophoneCommand.GetMicStateCommand.Request.newBuilder()
|
MicrophoneCommand.GetMicStateCommand.Request request = MicrophoneCommand.GetMicStateCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
.setHeader(EdgeCommonUtil.buildRequest(edgeCommonVO.getDeviceId()))
|
||||||
.build();
|
.build();
|
||||||
@ -63,7 +63,7 @@ public class EdgeMicrophoneServiceImpl implements EdgeMicrophoneService {
|
|||||||
String deviceId = edgeCommonVO.getDeviceId();
|
String deviceId = edgeCommonVO.getDeviceId();
|
||||||
try {
|
try {
|
||||||
// 获取gRPC客户端存根
|
// 获取gRPC客户端存根
|
||||||
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getTerminalId(), MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getRobotId(), MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
||||||
String filePath = StrUtil.format("{}/{}_{}.wav", "/home/share/assets/video", deviceId, System.currentTimeMillis());
|
String filePath = StrUtil.format("{}/{}_{}.wav", "/home/share/assets/video", deviceId, System.currentTimeMillis());
|
||||||
|
|
||||||
// 构建请求消息
|
// 构建请求消息
|
||||||
@ -89,7 +89,7 @@ public class EdgeMicrophoneServiceImpl implements EdgeMicrophoneService {
|
|||||||
public String stopRecord(EdgeCommonVO edgeCommonVO) {
|
public String stopRecord(EdgeCommonVO edgeCommonVO) {
|
||||||
try {
|
try {
|
||||||
// 获取gRPC客户端存根
|
// 获取gRPC客户端存根
|
||||||
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getTerminalId(), MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getRobotId(), MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建请求消息
|
// 构建请求消息
|
||||||
MicrophoneCommand.StopMicRecordingCommand.Request request = MicrophoneCommand.StopMicRecordingCommand.Request.newBuilder()
|
MicrophoneCommand.StopMicRecordingCommand.Request request = MicrophoneCommand.StopMicRecordingCommand.Request.newBuilder()
|
||||||
@ -113,7 +113,7 @@ public class EdgeMicrophoneServiceImpl implements EdgeMicrophoneService {
|
|||||||
public void pauseRecord(EdgeCommonVO edgeCommonVO) {
|
public void pauseRecord(EdgeCommonVO edgeCommonVO) {
|
||||||
try {
|
try {
|
||||||
// 获取gRPC客户端存根
|
// 获取gRPC客户端存根
|
||||||
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getTerminalId(), MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getRobotId(), MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建请求消息
|
// 构建请求消息
|
||||||
MicrophoneCommand.PauseMicRecordingCommand.Request request = MicrophoneCommand.PauseMicRecordingCommand.Request.newBuilder()
|
MicrophoneCommand.PauseMicRecordingCommand.Request request = MicrophoneCommand.PauseMicRecordingCommand.Request.newBuilder()
|
||||||
@ -136,7 +136,7 @@ public class EdgeMicrophoneServiceImpl implements EdgeMicrophoneService {
|
|||||||
public void resumeRecord(EdgeCommonVO edgeCommonVO) {
|
public void resumeRecord(EdgeCommonVO edgeCommonVO) {
|
||||||
try {
|
try {
|
||||||
// 获取gRPC客户端存根
|
// 获取gRPC客户端存根
|
||||||
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getTerminalId(), MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getRobotId(), MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建请求消息
|
// 构建请求消息
|
||||||
MicrophoneCommand.ResumeMicRecordingCommand.Request request = MicrophoneCommand.ResumeMicRecordingCommand.Request.newBuilder()
|
MicrophoneCommand.ResumeMicRecordingCommand.Request request = MicrophoneCommand.ResumeMicRecordingCommand.Request.newBuilder()
|
||||||
@ -159,7 +159,7 @@ public class EdgeMicrophoneServiceImpl implements EdgeMicrophoneService {
|
|||||||
public void setVolume(EdgeMicrophoneVolumeVO edgeMicrophoneVolumeVO) {
|
public void setVolume(EdgeMicrophoneVolumeVO edgeMicrophoneVolumeVO) {
|
||||||
try {
|
try {
|
||||||
// 获取gRPC客户端存根
|
// 获取gRPC客户端存根
|
||||||
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeMicrophoneVolumeVO.getTerminalId(), MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeMicrophoneVolumeVO.getRobotId(), MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建请求消息
|
// 构建请求消息
|
||||||
MicrophoneCommand.SetMicPhoneVolumeCommand.Request request = MicrophoneCommand.SetMicPhoneVolumeCommand.Request.newBuilder()
|
MicrophoneCommand.SetMicPhoneVolumeCommand.Request request = MicrophoneCommand.SetMicPhoneVolumeCommand.Request.newBuilder()
|
||||||
@ -183,7 +183,7 @@ public class EdgeMicrophoneServiceImpl implements EdgeMicrophoneService {
|
|||||||
public int getVolume(EdgeCommonVO edgeCommonVO) {
|
public int getVolume(EdgeCommonVO edgeCommonVO) {
|
||||||
try {
|
try {
|
||||||
// 获取gRPC客户端存根
|
// 获取gRPC客户端存根
|
||||||
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getTerminalId(), MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
MicPhoneServiceGrpc.MicPhoneServiceBlockingStub stub = grpcServiceManager.getGrpcClient(edgeCommonVO.getRobotId(), MicPhoneServiceGrpc.MicPhoneServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建请求消息
|
// 构建请求消息
|
||||||
MicrophoneCommand.GetMicPhoneVolumeCommand.Request request = MicrophoneCommand.GetMicPhoneVolumeCommand.Request.newBuilder()
|
MicrophoneCommand.GetMicPhoneVolumeCommand.Request request = MicrophoneCommand.GetMicPhoneVolumeCommand.Request.newBuilder()
|
||||||
|
|||||||
@ -0,0 +1,189 @@
|
|||||||
|
package com.cmvr.edge.client.service.impl;
|
||||||
|
|
||||||
|
import cmvr.api.MotorCommand;
|
||||||
|
import cmvr.api.MotorServiceGrpc;
|
||||||
|
import com.cmvr.common.exception.GlobalException;
|
||||||
|
import com.cmvr.edge.client.manage.GrpcBidiSessionRegistry;
|
||||||
|
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
||||||
|
import com.cmvr.edge.client.model.motor.EdgeMotorCyclicOpenVO;
|
||||||
|
import com.cmvr.edge.client.model.motor.EdgeMotorCyclicSetpointVO;
|
||||||
|
import com.cmvr.edge.client.model.motor.EdgeMotorEnabledVO;
|
||||||
|
import com.cmvr.edge.client.model.motor.EdgeMotorMotionVO;
|
||||||
|
import com.cmvr.edge.client.model.motor.EdgeMotorTargetVO;
|
||||||
|
import com.cmvr.edge.client.service.EdgeMotorService;
|
||||||
|
import com.cmvr.edge.client.utils.EdgeCommonUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.concurrent.ConcurrentMap;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EdgeMotorServiceImpl implements EdgeMotorService {
|
||||||
|
|
||||||
|
private final GrpcServiceManager grpcServiceManager;
|
||||||
|
private final GrpcBidiSessionRegistry<MotorCommand.CyclicPositionRequest,
|
||||||
|
MotorCommand.CyclicControlResponse> positionStreams = new GrpcBidiSessionRegistry<>();
|
||||||
|
private final GrpcBidiSessionRegistry<MotorCommand.CyclicVelocityRequest,
|
||||||
|
MotorCommand.CyclicControlResponse> velocityStreams = new GrpcBidiSessionRegistry<>();
|
||||||
|
private final ConcurrentMap<String, Boolean> streamTypes = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MotorCommand.MotorCommandResponse setZero(EdgeMotorTargetVO request) {
|
||||||
|
return blockingStub(request.getRobotId()).setZero(MotorCommand.SetMotorZeroRequest.newBuilder()
|
||||||
|
.setTarget(buildTarget(request)).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MotorCommand.MotorCommandResponse moveToZero(EdgeMotorMotionVO request) {
|
||||||
|
MotorCommand.MoveMotorToZeroRequest.Builder builder = MotorCommand.MoveMotorToZeroRequest.newBuilder()
|
||||||
|
.setTarget(buildTarget(request)).setWait(buildWait(request));
|
||||||
|
if (request.getMaxVelocityRadS() != null) builder.setMaxVelocityRadS(request.getMaxVelocityRadS());
|
||||||
|
if (request.getAccelerationRadS2() != null) builder.setAccelerationRadS2(request.getAccelerationRadS2());
|
||||||
|
return blockingStub(request.getRobotId()).moveToZero(builder.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MotorCommand.MotorCommandResponse profilePosition(EdgeMotorMotionVO request) {
|
||||||
|
if (request.getTargetPositionRad() == null) {
|
||||||
|
throw new GlobalException("targetPositionRad cannot be empty");
|
||||||
|
}
|
||||||
|
MotorCommand.ProfilePositionRequest.Builder builder = MotorCommand.ProfilePositionRequest.newBuilder()
|
||||||
|
.setTarget(buildTarget(request))
|
||||||
|
.setTargetPositionRad(request.getTargetPositionRad())
|
||||||
|
.setWait(buildWait(request));
|
||||||
|
if (request.getMaxVelocityRadS() != null) builder.setMaxVelocityRadS(request.getMaxVelocityRadS());
|
||||||
|
if (request.getAccelerationRadS2() != null) builder.setAccelerationRadS2(request.getAccelerationRadS2());
|
||||||
|
return blockingStub(request.getRobotId()).profilePosition(builder.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MotorCommand.MotorCommandResponse profileVelocity(EdgeMotorMotionVO request) {
|
||||||
|
if (request.getTargetVelocityRadS() == null) {
|
||||||
|
throw new GlobalException("targetVelocityRadS cannot be empty");
|
||||||
|
}
|
||||||
|
MotorCommand.ProfileVelocityRequest.Builder builder = MotorCommand.ProfileVelocityRequest.newBuilder()
|
||||||
|
.setTarget(buildTarget(request))
|
||||||
|
.setTargetVelocityRadS(request.getTargetVelocityRadS())
|
||||||
|
.setWait(buildWait(request));
|
||||||
|
if (request.getAccelerationRadS2() != null) builder.setAccelerationRadS2(request.getAccelerationRadS2());
|
||||||
|
return blockingStub(request.getRobotId()).profileVelocity(builder.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MotorCommand.MotorCommandResponse emergencyStop(EdgeMotorTargetVO request) {
|
||||||
|
return blockingStub(request.getRobotId()).emergencyStop(MotorCommand.EmergencyStopRequest.newBuilder()
|
||||||
|
.setTarget(buildTarget(request)).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MotorCommand.GetMotorStatusResponse getStatus(EdgeMotorTargetVO request) {
|
||||||
|
return blockingStub(request.getRobotId()).getStatus(MotorCommand.GetMotorStatusRequest.newBuilder()
|
||||||
|
.setTarget(buildTarget(request)).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MotorCommand.MotorCommandResponse setEnabled(EdgeMotorEnabledVO request) {
|
||||||
|
return blockingStub(request.getRobotId()).setEnabled(MotorCommand.SetMotorEnabledRequest.newBuilder()
|
||||||
|
.setTarget(buildTarget(request)).setEnabled(request.isEnabled()).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String openCyclicPosition(EdgeMotorCyclicOpenVO request) {
|
||||||
|
MotorServiceGrpc.MotorServiceStub stub = asyncStub(request.getRobotId());
|
||||||
|
MotorCommand.CyclicPositionRequest open = MotorCommand.CyclicPositionRequest.newBuilder()
|
||||||
|
.setOpen(buildOpen(request)).build();
|
||||||
|
String sessionId = positionStreams.open(stub::streamCyclicPosition, open);
|
||||||
|
streamTypes.put(sessionId, Boolean.TRUE);
|
||||||
|
return sessionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendCyclicPosition(EdgeMotorCyclicSetpointVO request) {
|
||||||
|
if (request.getTargetPositionRad() == null) {
|
||||||
|
throw new GlobalException("targetPositionRad cannot be empty");
|
||||||
|
}
|
||||||
|
MotorCommand.CyclicPositionSetpoint.Builder setpoint = MotorCommand.CyclicPositionSetpoint.newBuilder()
|
||||||
|
.setSequence(request.getSequence()).setTargetPositionRad(request.getTargetPositionRad());
|
||||||
|
if (request.getTargetVelocityRadS() != null) {
|
||||||
|
setpoint.setTargetVelocityRadS(request.getTargetVelocityRadS());
|
||||||
|
}
|
||||||
|
positionStreams.send(request.getSessionId(), MotorCommand.CyclicPositionRequest.newBuilder()
|
||||||
|
.setSetpoint(setpoint).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String openCyclicVelocity(EdgeMotorCyclicOpenVO request) {
|
||||||
|
MotorServiceGrpc.MotorServiceStub stub = asyncStub(request.getRobotId());
|
||||||
|
MotorCommand.CyclicVelocityRequest open = MotorCommand.CyclicVelocityRequest.newBuilder()
|
||||||
|
.setOpen(buildOpen(request)).build();
|
||||||
|
String sessionId = velocityStreams.open(stub::streamCyclicVelocity, open);
|
||||||
|
streamTypes.put(sessionId, Boolean.FALSE);
|
||||||
|
return sessionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendCyclicVelocity(EdgeMotorCyclicSetpointVO request) {
|
||||||
|
if (request.getTargetVelocityRadS() == null) {
|
||||||
|
throw new GlobalException("targetVelocityRadS cannot be empty");
|
||||||
|
}
|
||||||
|
MotorCommand.CyclicVelocitySetpoint setpoint = MotorCommand.CyclicVelocitySetpoint.newBuilder()
|
||||||
|
.setSequence(request.getSequence()).setTargetVelocityRadS(request.getTargetVelocityRadS()).build();
|
||||||
|
velocityStreams.send(request.getSessionId(), MotorCommand.CyclicVelocityRequest.newBuilder()
|
||||||
|
.setSetpoint(setpoint).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MotorCommand.CyclicControlResponse getStreamStatus(String sessionId) {
|
||||||
|
Boolean position = streamTypes.get(sessionId);
|
||||||
|
if (position == null) throw new GlobalException("Unknown stream session: " + sessionId);
|
||||||
|
return position ? positionStreams.getLatest(sessionId) : velocityStreams.getLatest(sessionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void closeStream(String sessionId) {
|
||||||
|
Boolean position = streamTypes.remove(sessionId);
|
||||||
|
if (position == null) throw new GlobalException("Unknown stream session: " + sessionId);
|
||||||
|
if (position) positionStreams.close(sessionId); else velocityStreams.close(sessionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
private MotorCommand.MotorTarget buildTarget(EdgeMotorTargetVO request) {
|
||||||
|
MotorCommand.MotorTarget.Builder builder = MotorCommand.MotorTarget.newBuilder()
|
||||||
|
.setHeader(EdgeCommonUtil.buildRequest(request.getDeviceId()));
|
||||||
|
if (request.getMotorId() != null) {
|
||||||
|
if (request.getMotorId() < 0) throw new GlobalException("motorId cannot be negative");
|
||||||
|
builder.setMotorId(request.getMotorId());
|
||||||
|
} else if (request.getJointName() != null && !request.getJointName().trim().isEmpty()) {
|
||||||
|
builder.setJointName(request.getJointName());
|
||||||
|
} else {
|
||||||
|
throw new GlobalException("Either motorId or jointName must be provided");
|
||||||
|
}
|
||||||
|
return builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
private MotorCommand.MotorWaitOptions buildWait(EdgeMotorMotionVO request) {
|
||||||
|
MotorCommand.MotorWaitOptions.Builder builder = MotorCommand.MotorWaitOptions.newBuilder();
|
||||||
|
if (request.getTimeoutMs() != null) builder.setTimeoutMs(request.getTimeoutMs());
|
||||||
|
if (request.getPollPeriodMs() != null) builder.setPollPeriodMs(request.getPollPeriodMs());
|
||||||
|
if (request.getPositionToleranceRad() != null) builder.setPositionToleranceRad(request.getPositionToleranceRad());
|
||||||
|
if (request.getVelocityToleranceRadS() != null) builder.setVelocityToleranceRadS(request.getVelocityToleranceRadS());
|
||||||
|
if (request.getSettleSampleCount() != null) builder.setSettleSampleCount(request.getSettleSampleCount());
|
||||||
|
return builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
private MotorCommand.CyclicStreamOpen buildOpen(EdgeMotorCyclicOpenVO request) {
|
||||||
|
MotorCommand.CyclicStreamOpen.Builder builder = MotorCommand.CyclicStreamOpen.newBuilder()
|
||||||
|
.setTarget(buildTarget(request));
|
||||||
|
if (request.getWatchdogTimeoutMs() != null) builder.setWatchdogTimeoutMs(request.getWatchdogTimeoutMs());
|
||||||
|
return builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
private MotorServiceGrpc.MotorServiceBlockingStub blockingStub(String robotId) {
|
||||||
|
return grpcServiceManager.getGrpcClient(robotId, MotorServiceGrpc.MotorServiceBlockingStub.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
private MotorServiceGrpc.MotorServiceStub asyncStub(String robotId) {
|
||||||
|
return grpcServiceManager.getGrpcClient(robotId, MotorServiceGrpc.MotorServiceStub.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -40,15 +40,15 @@ public class EdgeSpeakerServiceImpl implements EdgeSpeakerService {
|
|||||||
* 获取扬声器当前状态
|
* 获取扬声器当前状态
|
||||||
* 通过gRPC调用获取扬声器的运行状态,包括是否正在播放、音量等信息
|
* 通过gRPC调用获取扬声器的运行状态,包括是否正在播放、音量等信息
|
||||||
*
|
*
|
||||||
* @param terminalId 终端设备ID
|
* @param robotId 机器人永久唯一ID
|
||||||
* @param deviceId 设备ID
|
* @param deviceId 设备ID
|
||||||
* @return SpeakerState 返回扬声器的当前状态
|
* @return SpeakerState 返回扬声器的当前状态
|
||||||
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SpeakerCommand.GetSpeakerStateCommand.Feedback getStatus(String terminalId, String deviceId) {
|
public SpeakerCommand.GetSpeakerStateCommand.Feedback getStatus(String robotId, String deviceId) {
|
||||||
try {
|
try {
|
||||||
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
||||||
SpeakerCommand.GetSpeakerStateCommand.Request request = SpeakerCommand.GetSpeakerStateCommand.Request.newBuilder()
|
SpeakerCommand.GetSpeakerStateCommand.Request request = SpeakerCommand.GetSpeakerStateCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(deviceId))
|
.setHeader(EdgeCommonUtil.buildRequest(deviceId))
|
||||||
.build();
|
.build();
|
||||||
@ -64,16 +64,16 @@ public class EdgeSpeakerServiceImpl implements EdgeSpeakerService {
|
|||||||
* 播放音频文件
|
* 播放音频文件
|
||||||
* 通过gRPC调用播放指定路径的音频文件
|
* 通过gRPC调用播放指定路径的音频文件
|
||||||
*
|
*
|
||||||
* @param terminalId 终端设备ID
|
* @param robotId 机器人永久唯一ID
|
||||||
* @param deviceId 设备ID
|
* @param deviceId 设备ID
|
||||||
* @param audioPath 音频文件的路径
|
* @param audioPath 音频文件的路径
|
||||||
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String playAudio(String terminalId, String deviceId, String audioPath) {
|
public String playAudio(String robotId, String deviceId, String audioPath) {
|
||||||
try {
|
try {
|
||||||
// 获取gRPC客户端存根
|
// 获取gRPC客户端存根
|
||||||
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建请求消息
|
// 构建请求消息
|
||||||
SpeakerCommand.PlayAudioCommand.Request request = SpeakerCommand.PlayAudioCommand.Request.newBuilder()
|
SpeakerCommand.PlayAudioCommand.Request request = SpeakerCommand.PlayAudioCommand.Request.newBuilder()
|
||||||
@ -97,15 +97,15 @@ public class EdgeSpeakerServiceImpl implements EdgeSpeakerService {
|
|||||||
* 停止当前播放
|
* 停止当前播放
|
||||||
* 通过gRPC调用停止扬声器的当前播放
|
* 通过gRPC调用停止扬声器的当前播放
|
||||||
*
|
*
|
||||||
* @param terminalId 终端设备ID
|
* @param robotId 机器人永久唯一ID
|
||||||
* @param deviceId 设备ID
|
* @param deviceId 设备ID
|
||||||
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void stopPlayback(String terminalId, String deviceId) {
|
public void stopPlayback(String robotId, String deviceId) {
|
||||||
try {
|
try {
|
||||||
// 获取gRPC客户端存根
|
// 获取gRPC客户端存根
|
||||||
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建请求消息
|
// 构建请求消息
|
||||||
SpeakerCommand.StopSpeakerCommand.Request request = SpeakerCommand.StopSpeakerCommand.Request.newBuilder()
|
SpeakerCommand.StopSpeakerCommand.Request request = SpeakerCommand.StopSpeakerCommand.Request.newBuilder()
|
||||||
@ -124,15 +124,15 @@ public class EdgeSpeakerServiceImpl implements EdgeSpeakerService {
|
|||||||
* 暂停当前播放
|
* 暂停当前播放
|
||||||
* 通过gRPC调用暂停扬声器的当前播放
|
* 通过gRPC调用暂停扬声器的当前播放
|
||||||
*
|
*
|
||||||
* @param terminalId 终端设备ID
|
* @param robotId 机器人永久唯一ID
|
||||||
* @param deviceId 设备ID
|
* @param deviceId 设备ID
|
||||||
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void pausePlayback(String terminalId, String deviceId) {
|
public void pausePlayback(String robotId, String deviceId) {
|
||||||
try {
|
try {
|
||||||
// 获取gRPC客户端存根
|
// 获取gRPC客户端存根
|
||||||
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建请求消息
|
// 构建请求消息
|
||||||
SpeakerCommand.PauseSpeakerCommand.Request request = SpeakerCommand.PauseSpeakerCommand.Request.newBuilder()
|
SpeakerCommand.PauseSpeakerCommand.Request request = SpeakerCommand.PauseSpeakerCommand.Request.newBuilder()
|
||||||
@ -151,15 +151,15 @@ public class EdgeSpeakerServiceImpl implements EdgeSpeakerService {
|
|||||||
* 恢复暂停的播放
|
* 恢复暂停的播放
|
||||||
* 通过gRPC调用恢复扬声器之前暂停的播放
|
* 通过gRPC调用恢复扬声器之前暂停的播放
|
||||||
*
|
*
|
||||||
* @param terminalId 终端设备ID
|
* @param robotId 机器人永久唯一ID
|
||||||
* @param deviceId 设备ID
|
* @param deviceId 设备ID
|
||||||
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void resumePlayback(String terminalId, String deviceId) {
|
public void resumePlayback(String robotId, String deviceId) {
|
||||||
try {
|
try {
|
||||||
// 获取gRPC客户端存根
|
// 获取gRPC客户端存根
|
||||||
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建请求消息
|
// 构建请求消息
|
||||||
SpeakerCommand.ResumeSpeakerCommand.Request request = SpeakerCommand.ResumeSpeakerCommand.Request.newBuilder()
|
SpeakerCommand.ResumeSpeakerCommand.Request request = SpeakerCommand.ResumeSpeakerCommand.Request.newBuilder()
|
||||||
@ -178,16 +178,16 @@ public class EdgeSpeakerServiceImpl implements EdgeSpeakerService {
|
|||||||
* 设置扬声器音量
|
* 设置扬声器音量
|
||||||
* 通过gRPC调用设置扬声器的音量大小
|
* 通过gRPC调用设置扬声器的音量大小
|
||||||
*
|
*
|
||||||
* @param terminalId 终端设备ID
|
* @param robotId 机器人永久唯一ID
|
||||||
* @param deviceId 设备ID
|
* @param deviceId 设备ID
|
||||||
* @param volume 音量大小(0-100)
|
* @param volume 音量大小(0-100)
|
||||||
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setVolume(String terminalId, String deviceId, int volume) {
|
public void setVolume(String robotId, String deviceId, int volume) {
|
||||||
try {
|
try {
|
||||||
// 获取gRPC客户端存根
|
// 获取gRPC客户端存根
|
||||||
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建请求消息
|
// 构建请求消息
|
||||||
SpeakerCommand.SetSpeakerVolumeCommand.Request request = SpeakerCommand.SetSpeakerVolumeCommand.Request.newBuilder()
|
SpeakerCommand.SetSpeakerVolumeCommand.Request request = SpeakerCommand.SetSpeakerVolumeCommand.Request.newBuilder()
|
||||||
@ -207,16 +207,16 @@ public class EdgeSpeakerServiceImpl implements EdgeSpeakerService {
|
|||||||
* 获取当前音量
|
* 获取当前音量
|
||||||
* 通过gRPC调用获取扬声器的当前音量大小
|
* 通过gRPC调用获取扬声器的当前音量大小
|
||||||
*
|
*
|
||||||
* @param terminalId 终端设备ID
|
* @param robotId 机器人永久唯一ID
|
||||||
* @param deviceId 设备ID
|
* @param deviceId 设备ID
|
||||||
* @return int 返回当前音量大小(0-100)
|
* @return int 返回当前音量大小(0-100)
|
||||||
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
* @throws RuntimeException 当gRPC调用失败时抛出异常
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getVolume(String terminalId, String deviceId) {
|
public int getVolume(String robotId, String deviceId) {
|
||||||
try {
|
try {
|
||||||
// 获取gRPC客户端存根
|
// 获取gRPC客户端存根
|
||||||
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
SpeakerServiceGrpc.SpeakerServiceBlockingStub stub = grpcServiceManager.getGrpcClient(robotId, SpeakerServiceGrpc.SpeakerServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建请求消息
|
// 构建请求消息
|
||||||
SpeakerCommand.GetSpeakerVolumeCommand.Request request = SpeakerCommand.GetSpeakerVolumeCommand.Request.newBuilder()
|
SpeakerCommand.GetSpeakerVolumeCommand.Request request = SpeakerCommand.GetSpeakerVolumeCommand.Request.newBuilder()
|
||||||
|
|||||||
@ -1,18 +1,25 @@
|
|||||||
package com.cmvr.edge.client.service.impl;
|
package com.cmvr.edge.client.service.impl;
|
||||||
|
|
||||||
|
import cmvr.api.Common;
|
||||||
|
import cmvr.api.ArmServiceGrpc;
|
||||||
import cmvr.api.SystemCommand;
|
import cmvr.api.SystemCommand;
|
||||||
import cmvr.api.SystemServiceGrpc;
|
import cmvr.api.SystemServiceGrpc;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.cmvr.device.domain.DeDeviceRegistration;
|
import com.cmvr.device.domain.DeDeviceRegistration;
|
||||||
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
||||||
|
import com.cmvr.edge.client.model.system.EdgeSystemJsonCommandVO;
|
||||||
|
import com.cmvr.edge.client.model.system.EdgeSystemUpdateParamsVO;
|
||||||
import com.cmvr.edge.client.service.EdgeSystemService;
|
import com.cmvr.edge.client.service.EdgeSystemService;
|
||||||
import com.cmvr.edge.client.utils.EdgeCommonUtil;
|
import com.cmvr.edge.client.utils.EdgeCommonUtil;
|
||||||
|
import com.cmvr.common.exception.GlobalException;
|
||||||
|
import com.google.protobuf.ByteString;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Base64;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,55 +36,146 @@ public class EdgeSystemServiceImpl implements EdgeSystemService {
|
|||||||
|
|
||||||
private final GrpcServiceManager grpcServiceManager;
|
private final GrpcServiceManager grpcServiceManager;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SystemCommand.GetSystemInfoCommand.Feedback getSystemInfo(String robotId) {
|
||||||
|
SystemServiceGrpc.SystemServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
|
robotId, SystemServiceGrpc.SystemServiceBlockingStub.class);
|
||||||
|
return stub.getSystemInfo(SystemCommand.GetSystemInfoCommand.Request.newBuilder().build());
|
||||||
|
}
|
||||||
|
|
||||||
public List<DeDeviceRegistration> deviceList(String terminalId){
|
@Override
|
||||||
|
public Common.CommandHeader.Feedback updateParams(EdgeSystemUpdateParamsVO request) {
|
||||||
|
SystemCommand.UpdateParamsCommand.Request.Builder requestBuilder =
|
||||||
|
SystemCommand.UpdateParamsCommand.Request.newBuilder()
|
||||||
|
.setHeader(EdgeCommonUtil.buildRequest(request.getDeviceId()));
|
||||||
|
if (request.getParams() != null) {
|
||||||
|
for (EdgeSystemUpdateParamsVO.Param param : request.getParams()) {
|
||||||
|
requestBuilder.addParams(buildParam(param));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SystemServiceGrpc.SystemServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
|
request.getRobotId(), SystemServiceGrpc.SystemServiceBlockingStub.class);
|
||||||
|
return stub.updateParams(requestBuilder.build()).getHeader();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Common.JsonDeviceCommand.Feedback executeJsonCommand(EdgeSystemJsonCommandVO request) {
|
||||||
|
Common.JsonDeviceCommand.Request grpcRequest = Common.JsonDeviceCommand.Request.newBuilder()
|
||||||
|
.setHeader(EdgeCommonUtil.buildRequest(request.getDeviceId()))
|
||||||
|
.setRequestJson(request.getRequestJson() == null ? "" : request.getRequestJson())
|
||||||
|
.build();
|
||||||
|
ArmServiceGrpc.ArmServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
|
request.getRobotId(), ArmServiceGrpc.ArmServiceBlockingStub.class);
|
||||||
|
return stub.executeJsonCommand(grpcRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Common.ConfigParam buildParam(EdgeSystemUpdateParamsVO.Param param) {
|
||||||
|
if (param == null || param.getName() == null || param.getName().trim().isEmpty()) {
|
||||||
|
throw new GlobalException("Parameter name cannot be empty");
|
||||||
|
}
|
||||||
|
Common.ConfigParam.Builder builder = Common.ConfigParam.newBuilder().setParamName(param.getName());
|
||||||
|
int valueCount = 0;
|
||||||
|
if (param.getIntValue() != null) {
|
||||||
|
builder.setIntValue(param.getIntValue());
|
||||||
|
valueCount++;
|
||||||
|
}
|
||||||
|
if (param.getDoubleValue() != null) {
|
||||||
|
builder.setDoubleValue(param.getDoubleValue());
|
||||||
|
valueCount++;
|
||||||
|
}
|
||||||
|
if (param.getStringValue() != null) {
|
||||||
|
builder.setStringValue(param.getStringValue());
|
||||||
|
valueCount++;
|
||||||
|
}
|
||||||
|
if (param.getBoolValue() != null) {
|
||||||
|
builder.setBoolValue(param.getBoolValue());
|
||||||
|
valueCount++;
|
||||||
|
}
|
||||||
|
if (param.getBytesBase64() != null) {
|
||||||
|
try {
|
||||||
|
builder.setBytesValue(ByteString.copyFrom(Base64.getDecoder().decode(param.getBytesBase64())));
|
||||||
|
} catch (IllegalArgumentException exception) {
|
||||||
|
throw new GlobalException("Invalid Base64 value for parameter " + param.getName());
|
||||||
|
}
|
||||||
|
valueCount++;
|
||||||
|
}
|
||||||
|
if (valueCount != 1) {
|
||||||
|
throw new GlobalException("Parameter " + param.getName() + " must contain exactly one typed value");
|
||||||
|
}
|
||||||
|
return builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeDeviceRegistration> deviceList(String robotId) {
|
||||||
try {
|
try {
|
||||||
//调用接口获取返回值对象
|
SystemServiceGrpc.SystemServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
SystemCommand.GetSystemStatusCommand.Feedback response=getSystemStatus(terminalId);
|
robotId, SystemServiceGrpc.SystemServiceBlockingStub.class);
|
||||||
|
SystemCommand.GetDeviceListCommand.Feedback response = stub.getDeviceList(
|
||||||
|
SystemCommand.GetDeviceListCommand.Request.newBuilder().build());
|
||||||
|
|
||||||
// 获取设备列表
|
List<SystemCommand.SystemDeviceInfo> deviceList = response.getDeviceListList();
|
||||||
List<SystemCommand.DeviceList> deviceList = response.getDeviceListList();
|
List<DeDeviceRegistration> devices = new ArrayList<>(deviceList.size());
|
||||||
|
for (SystemCommand.SystemDeviceInfo device : deviceList) {
|
||||||
// 如果设备列表不为空,则处理设备信息
|
DeDeviceRegistration registration = new DeDeviceRegistration();
|
||||||
if (!deviceList.isEmpty()) {
|
registration.setDeviceCode(device.getDeviceId());
|
||||||
// 创建Device对象列表,用于存储转换后的设备信息
|
registration.setDeviceModel(toDeviceModel(device));
|
||||||
List<DeDeviceRegistration> devices = new ArrayList<>();
|
registration.setIdDeDeviceTerminalConfig(robotId);
|
||||||
|
devices.add(registration);
|
||||||
// 遍历设备列表,将每个设备信息转换为Device对象
|
|
||||||
for (SystemCommand.DeviceList device : deviceList) {
|
|
||||||
DeDeviceRegistration d=new DeDeviceRegistration();
|
|
||||||
// 设置设备ID
|
|
||||||
d.setDeviceCode(device.getDeviceId());
|
|
||||||
// 设置设备类型,将枚举类型转换为字符串
|
|
||||||
d.setDeviceModel(device.getDeviceType().name());
|
|
||||||
// 设置设备的终端ID
|
|
||||||
d.setIdDeDeviceTerminalConfig(terminalId);
|
|
||||||
|
|
||||||
devices.add(d);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 记录获取到的设备数量
|
logger.info("获取到设备列表,数量:{},设备管理器:{} {}",
|
||||||
logger.info("获取到设备列表,数量:{}", devices.size());
|
devices.size(), response.getManagerName(), response.getManagerVersion());
|
||||||
return devices;
|
return devices;
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("调用设备列表接口异常", e);
|
||||||
|
throw new GlobalException("获取设备列表失败: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 如果响应为空或设备列表为空,记录错误信息
|
private String toDeviceModel(SystemCommand.SystemDeviceInfo device) {
|
||||||
logger.error("获取系统状态失败: {}", response != null ?
|
switch (device.getDeviceType()) {
|
||||||
(response.getHeader() != null ? response.getHeader().getErrorMessage() : "响应头为空") : "响应为空");
|
case SYSTEM_DEVICE_TYPE_AGV:
|
||||||
return null;
|
return "AGV";
|
||||||
|
case SYSTEM_DEVICE_TYPE_ARM:
|
||||||
}catch (Exception e){
|
return "ARM";
|
||||||
// 捕获并记录调用过程中的异常
|
case SYSTEM_DEVICE_TYPE_BATTERY:
|
||||||
logger.error("调用系统状态接口异常", e);
|
return "Battery";
|
||||||
return null;
|
case SYSTEM_DEVICE_TYPE_BIO_HEAD:
|
||||||
|
return "BioHead";
|
||||||
|
case SYSTEM_DEVICE_TYPE_CAMERA:
|
||||||
|
return "Camera";
|
||||||
|
case SYSTEM_DEVICE_TYPE_CAN_BUS:
|
||||||
|
return "CanBus";
|
||||||
|
case SYSTEM_DEVICE_TYPE_DEX_HAND:
|
||||||
|
return "DexHand";
|
||||||
|
case SYSTEM_DEVICE_TYPE_GRIPPER:
|
||||||
|
return "Gripper";
|
||||||
|
case SYSTEM_DEVICE_TYPE_MICROPHONE:
|
||||||
|
return "Microphone";
|
||||||
|
case SYSTEM_DEVICE_TYPE_MOTOR:
|
||||||
|
return "Motor";
|
||||||
|
case SYSTEM_DEVICE_TYPE_MOTOR_SYSTEM:
|
||||||
|
return "MotorSystem";
|
||||||
|
case SYSTEM_DEVICE_TYPE_MUJOCO_VIEWER:
|
||||||
|
return "MujocoViewer";
|
||||||
|
case SYSTEM_DEVICE_TYPE_MUJOCO_WORLD:
|
||||||
|
return "MujocoWorld";
|
||||||
|
case SYSTEM_DEVICE_TYPE_ROBOT:
|
||||||
|
return "Robot";
|
||||||
|
case SYSTEM_DEVICE_TYPE_SPEAKER:
|
||||||
|
return "Speaker";
|
||||||
|
case SYSTEM_DEVICE_TYPE_UNSPECIFIED:
|
||||||
|
case UNRECOGNIZED:
|
||||||
|
default:
|
||||||
|
return device.getTypeName().isEmpty() ? "Unknown" : device.getTypeName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String stopAll(String terminalId) {
|
public String stopAll(String robotId) {
|
||||||
SystemServiceGrpc.SystemServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
SystemServiceGrpc.SystemServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
terminalId,
|
robotId,
|
||||||
SystemServiceGrpc.SystemServiceBlockingStub.class);
|
SystemServiceGrpc.SystemServiceBlockingStub.class);
|
||||||
SystemCommand.StopAllCommand.Request build = SystemCommand.StopAllCommand.Request.newBuilder()
|
SystemCommand.StopAllCommand.Request build = SystemCommand.StopAllCommand.Request.newBuilder()
|
||||||
.setHeader(EdgeCommonUtil.buildRequest(""))
|
.setHeader(EdgeCommonUtil.buildRequest(""))
|
||||||
@ -94,11 +192,11 @@ public class EdgeSystemServiceImpl implements EdgeSystemService {
|
|||||||
* @return 系统状态信息,如果获取失败则返回null
|
* @return 系统状态信息,如果获取失败则返回null
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SystemCommand.GetSystemStatusCommand.Feedback getSystemStatus(String terminalId) {
|
public SystemCommand.GetSystemStatusCommand.Feedback getSystemStatus(String robotId) {
|
||||||
try {
|
try {
|
||||||
// 创建gRPC阻塞式存根,用于调用服务端方法
|
// 创建gRPC阻塞式存根,用于调用服务端方法
|
||||||
SystemServiceGrpc.SystemServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
SystemServiceGrpc.SystemServiceBlockingStub stub = grpcServiceManager.getGrpcClient(
|
||||||
terminalId,
|
robotId,
|
||||||
SystemServiceGrpc.SystemServiceBlockingStub.class);
|
SystemServiceGrpc.SystemServiceBlockingStub.class);
|
||||||
|
|
||||||
// 构建请求对象,由于是获取系统状态,请求参数为空
|
// 构建请求对象,由于是获取系统状态,请求参数为空
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.cmvr.edge.client.service.impl;
|
|||||||
import com.cmvr.edge.client.manage.GrpcStreamManager;
|
import com.cmvr.edge.client.manage.GrpcStreamManager;
|
||||||
import com.cmvr.edge.client.service.EdgeStreamService;
|
import com.cmvr.edge.client.service.EdgeStreamService;
|
||||||
import com.cmvr.framework.websocket.service.GrpcClientService;
|
import com.cmvr.framework.websocket.service.GrpcClientService;
|
||||||
|
import com.cmvr.framework.websocket.manager.ChannelSubscriptionManager;
|
||||||
import io.grpc.Status;
|
import io.grpc.Status;
|
||||||
import io.grpc.stub.StreamObserver;
|
import io.grpc.stub.StreamObserver;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -12,6 +13,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* grpc客户端服务实现类
|
* grpc客户端服务实现类
|
||||||
@ -26,14 +28,18 @@ public class GrpcClientServiceImpl implements GrpcClientService {
|
|||||||
* 所有流式服务
|
* 所有流式服务
|
||||||
*/
|
*/
|
||||||
private final Map<String, EdgeStreamService> serviceMap;
|
private final Map<String, EdgeStreamService> serviceMap;
|
||||||
|
private final ChannelSubscriptionManager channelSubscriptionManager;
|
||||||
|
private final Map<String, Object> streamLocks = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public GrpcClientServiceImpl(Map<String, EdgeStreamService> serviceMap) {
|
public GrpcClientServiceImpl(Map<String, EdgeStreamService> serviceMap,
|
||||||
|
ChannelSubscriptionManager channelSubscriptionManager) {
|
||||||
this.serviceMap = serviceMap;
|
this.serviceMap = serviceMap;
|
||||||
|
this.channelSubscriptionManager = channelSubscriptionManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void send(boolean isStart, String terminalId, String deviceId, String service, String method) {
|
public void send(boolean isStart, String robotId, String deviceId, String service, String method) {
|
||||||
try {
|
try {
|
||||||
// 从 Map 中获取服务实例
|
// 从 Map 中获取服务实例
|
||||||
EdgeStreamService serviceInstance = serviceMap.get(service);
|
EdgeStreamService serviceInstance = serviceMap.get(service);
|
||||||
@ -42,26 +48,32 @@ public class GrpcClientServiceImpl implements GrpcClientService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 构造流键
|
// 构造流键
|
||||||
String key = terminalId + deviceId + service + method;
|
String key = robotId + deviceId + service + method;
|
||||||
|
String channel = service + "/" + method + "/" + robotId + "/" + deviceId;
|
||||||
|
Object streamLock = streamLocks.computeIfAbsent(key, ignored -> new Object());
|
||||||
|
|
||||||
if (isStart) {
|
synchronized (streamLock) {
|
||||||
// 通过反射调用指定方法
|
if (isStart) {
|
||||||
Method streamMethod = serviceInstance.getClass().getMethod(method, String.class, String.class);
|
if (GrpcStreamManager.containsKey(key)) {
|
||||||
StreamObserver<?> streamObserver = (StreamObserver<?>) streamMethod.invoke(serviceInstance, terminalId, deviceId);
|
return;
|
||||||
if (streamObserver != null) {
|
}
|
||||||
GrpcStreamManager.addStream(key, streamObserver);
|
Method streamMethod = serviceInstance.getClass().getMethod(method, String.class, String.class);
|
||||||
}
|
StreamObserver<?> streamObserver = (StreamObserver<?>) streamMethod.invoke(serviceInstance, robotId, deviceId);
|
||||||
} else {
|
if (streamObserver != null) {
|
||||||
if (!GrpcStreamManager.containsKey(key)) {
|
GrpcStreamManager.addStream(key, streamObserver);
|
||||||
return;
|
}
|
||||||
}
|
} else {
|
||||||
// 移除并关闭流
|
// 旧连接的异步取消到达时,如果已有新订阅者,则继续复用当前流。
|
||||||
StreamObserver<?> streamObserver = GrpcStreamManager.removeStream(key);
|
if (channelSubscriptionManager.hasSubscribers(channel) || !GrpcStreamManager.containsKey(key)) {
|
||||||
try {
|
return;
|
||||||
streamObserver.onError(Status.CANCELLED.withDescription("流需要关闭").asException());
|
}
|
||||||
log.info("流关闭: {}", key);
|
StreamObserver<?> streamObserver = GrpcStreamManager.removeStream(key);
|
||||||
} catch (Exception e) {
|
try {
|
||||||
log.info("流结束");
|
streamObserver.onError(Status.CANCELLED.withDescription("流需要关闭").asException());
|
||||||
|
log.info("流关闭: {}", key);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info("流结束");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -0,0 +1,593 @@
|
|||||||
|
package com.cmvr.edge.client.utils;
|
||||||
|
|
||||||
|
import org.bytedeco.ffmpeg.global.avcodec;
|
||||||
|
import org.bytedeco.javacv.FFmpegFrameGrabber;
|
||||||
|
import org.bytedeco.javacv.FFmpegFrameRecorder;
|
||||||
|
import org.bytedeco.javacv.Frame;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.util.ArrayDeque;
|
||||||
|
import java.util.Deque;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将一条连续 H.265 裸码流转换为浏览器 MediaSource 可追加的 H.264 fragmented MP4。
|
||||||
|
*/
|
||||||
|
public final class H265Fmp4Transcoder implements AutoCloseable {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(H265Fmp4Transcoder.class);
|
||||||
|
public static final String MIME_TYPE = "video/mp4; codecs=\"avc1.42C01E\"";
|
||||||
|
private static final int MAX_QUEUED_BYTES = 512 * 1024;
|
||||||
|
|
||||||
|
private final Consumer<Throwable> errorConsumer;
|
||||||
|
private final String streamName;
|
||||||
|
private final int configuredFrameRate;
|
||||||
|
private final LiveEncodedVideoInputStream inputStream;
|
||||||
|
private final MediaChunkOutputStream outputStream;
|
||||||
|
private final AtomicBoolean closed = new AtomicBoolean(false);
|
||||||
|
private final Thread worker;
|
||||||
|
|
||||||
|
private volatile FFmpegFrameGrabber grabber;
|
||||||
|
private volatile FFmpegFrameRecorder recorder;
|
||||||
|
|
||||||
|
public H265Fmp4Transcoder(String streamName,
|
||||||
|
int configuredFrameRate,
|
||||||
|
Consumer<byte[]> chunkConsumer,
|
||||||
|
Consumer<Throwable> errorConsumer) throws IOException {
|
||||||
|
this.errorConsumer = errorConsumer;
|
||||||
|
this.streamName = streamName;
|
||||||
|
this.configuredFrameRate = configuredFrameRate;
|
||||||
|
int maxQueuedFrames = Math.max(4, Math.min(20,
|
||||||
|
(int) Math.ceil((configuredFrameRate > 0 ? configuredFrameRate : 25) * 0.35D)));
|
||||||
|
this.inputStream = new LiveEncodedVideoInputStream(streamName, maxQueuedFrames, MAX_QUEUED_BYTES);
|
||||||
|
this.outputStream = new MediaChunkOutputStream(chunkConsumer);
|
||||||
|
this.worker = new Thread(this::transcode, "camera-fmp4-" + streamName);
|
||||||
|
this.worker.setDaemon(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void start() {
|
||||||
|
worker.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gRPC按顺序写入编码帧;管道满时自然背压,防止无限堆积导致延迟持续增长。
|
||||||
|
*/
|
||||||
|
public void write(byte[] encodedFrame, boolean keyFrame, String codec) throws IOException {
|
||||||
|
if (encodedFrame == null || encodedFrame.length == 0 || closed.get()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
inputStream.offer(encodedFrame, keyFrame, codec);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void transcode() {
|
||||||
|
try {
|
||||||
|
InputCodec inputCodec = inputStream.awaitInputCodec();
|
||||||
|
grabber = new FFmpegFrameGrabber(inputStream, 0);
|
||||||
|
grabber.setFormat(inputCodec.ffmpegFormat);
|
||||||
|
grabber.setOption("fflags", "nobuffer");
|
||||||
|
grabber.setOption("flags", "low_delay");
|
||||||
|
grabber.setOption("probesize", "32768");
|
||||||
|
// The codec and sequence headers are known before startup, so probing can stay disabled for live input.
|
||||||
|
grabber.start(false);
|
||||||
|
inputStream.markDecoderInitialized();
|
||||||
|
|
||||||
|
Frame frame = grabber.grabImage();
|
||||||
|
if (frame == null) {
|
||||||
|
throw new IllegalStateException("H.265码流未产生可解码图像");
|
||||||
|
}
|
||||||
|
int width = frame.imageWidth > 0 ? frame.imageWidth : grabber.getImageWidth();
|
||||||
|
int height = frame.imageHeight > 0 ? frame.imageHeight : grabber.getImageHeight();
|
||||||
|
if (width <= 0 || height <= 0) {
|
||||||
|
throw new IllegalStateException("无法从H.265码流读取图像尺寸");
|
||||||
|
}
|
||||||
|
log.info("摄像头流{}识别到首帧: {}x{}", streamName, width, height);
|
||||||
|
|
||||||
|
double sourceFrameRate = configuredFrameRate;
|
||||||
|
if (!Double.isFinite(sourceFrameRate) || sourceFrameRate <= 0) {
|
||||||
|
sourceFrameRate = grabber.getFrameRate();
|
||||||
|
}
|
||||||
|
if (!Double.isFinite(sourceFrameRate) || sourceFrameRate <= 0) {
|
||||||
|
sourceFrameRate = 25D;
|
||||||
|
}
|
||||||
|
sourceFrameRate = Math.max(5D, Math.min(sourceFrameRate, 60D));
|
||||||
|
double outputFrameRate = Math.min(sourceFrameRate, 25D);
|
||||||
|
int gopSize = Math.max(1, (int) Math.round(outputFrameRate * 0.4D));
|
||||||
|
long sourceFrameDurationMicros = Math.max(1L, Math.round(1_000_000D / sourceFrameRate));
|
||||||
|
long outputFrameDurationMicros = Math.max(1L, Math.round(1_000_000D / outputFrameRate));
|
||||||
|
log.info("Camera stream {} uses {} source fps, {} output fps and a {} frame GOP",
|
||||||
|
streamName, sourceFrameRate, outputFrameRate, gopSize);
|
||||||
|
|
||||||
|
recorder = new FFmpegFrameRecorder(outputStream, width, height, 0);
|
||||||
|
recorder.setFormat("mp4");
|
||||||
|
recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
|
||||||
|
recorder.setFrameRate(outputFrameRate);
|
||||||
|
recorder.setGopSize(gopSize);
|
||||||
|
recorder.setVideoBitrate(4_000_000);
|
||||||
|
recorder.setVideoOption("preset", "ultrafast");
|
||||||
|
recorder.setVideoOption("tune", "zerolatency");
|
||||||
|
recorder.setVideoOption("bf", "0");
|
||||||
|
recorder.setOption("movflags", "frag_keyframe+empty_moov+default_base_moof+omit_tfhd_offset");
|
||||||
|
recorder.setOption("frag_duration", "100000");
|
||||||
|
recorder.setOption("flush_packets", "1");
|
||||||
|
recorder.start();
|
||||||
|
outputStream.publishAvailable();
|
||||||
|
|
||||||
|
long sourceFrameIndex = 0L;
|
||||||
|
long nextOutputTimestampMicros = 0L;
|
||||||
|
do {
|
||||||
|
long sourceTimestampMicros = sourceFrameIndex * sourceFrameDurationMicros;
|
||||||
|
if (sourceTimestampMicros + sourceFrameDurationMicros / 2 >= nextOutputTimestampMicros) {
|
||||||
|
recorder.setTimestamp(nextOutputTimestampMicros);
|
||||||
|
recorder.record(frame);
|
||||||
|
nextOutputTimestampMicros += outputFrameDurationMicros;
|
||||||
|
outputStream.publishAvailable();
|
||||||
|
}
|
||||||
|
sourceFrameIndex++;
|
||||||
|
} while (!closed.get() && (frame = grabber.grabImage()) != null);
|
||||||
|
} catch (Throwable throwable) {
|
||||||
|
if (!closed.get()) {
|
||||||
|
errorConsumer.accept(throwable);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
releaseNativeResources();
|
||||||
|
try {
|
||||||
|
outputStream.publishAvailable();
|
||||||
|
} catch (RuntimeException ignored) {
|
||||||
|
}
|
||||||
|
inputStream.close();
|
||||||
|
closed.set(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void close() {
|
||||||
|
if (!closed.compareAndSet(false, true)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
inputStream.close();
|
||||||
|
worker.interrupt();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void releaseNativeResources() {
|
||||||
|
FFmpegFrameRecorder currentRecorder = recorder;
|
||||||
|
recorder = null;
|
||||||
|
if (currentRecorder != null) {
|
||||||
|
try {
|
||||||
|
currentRecorder.stop();
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
currentRecorder.release();
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FFmpegFrameGrabber currentGrabber = grabber;
|
||||||
|
grabber = null;
|
||||||
|
if (currentGrabber != null) {
|
||||||
|
try {
|
||||||
|
currentGrabber.stop();
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
currentGrabber.release();
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private enum InputCodec {
|
||||||
|
H264("h264", "H.264"),
|
||||||
|
H265("hevc", "H.265");
|
||||||
|
|
||||||
|
private final String ffmpegFormat;
|
||||||
|
private final String displayName;
|
||||||
|
|
||||||
|
InputCodec(String ffmpegFormat, String displayName) {
|
||||||
|
this.ffmpegFormat = ffmpegFormat;
|
||||||
|
this.displayName = displayName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class LiveEncodedVideoInputStream extends InputStream {
|
||||||
|
private final String streamName;
|
||||||
|
private final int maxQueuedFrames;
|
||||||
|
private final int maxQueuedBytes;
|
||||||
|
private final Deque<EncodedFrame> queue = new ArrayDeque<>();
|
||||||
|
private byte[] currentFrame;
|
||||||
|
private int currentOffset;
|
||||||
|
private int queuedBytes;
|
||||||
|
private boolean droppingUntilKeyFrame;
|
||||||
|
private boolean closed;
|
||||||
|
private long droppedFrames;
|
||||||
|
private long lastDropLogNanos;
|
||||||
|
private InputCodec inputCodec;
|
||||||
|
private boolean sequenceHeaderSeen;
|
||||||
|
private boolean decoderStarted;
|
||||||
|
private boolean decoderInitialized;
|
||||||
|
private boolean h264SpsSeen;
|
||||||
|
private boolean h264PpsSeen;
|
||||||
|
private boolean framingNormalizationLogged;
|
||||||
|
|
||||||
|
private LiveEncodedVideoInputStream(String streamName, int maxQueuedFrames, int maxQueuedBytes) {
|
||||||
|
this.streamName = streamName;
|
||||||
|
this.maxQueuedFrames = maxQueuedFrames;
|
||||||
|
this.maxQueuedBytes = maxQueuedBytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized void offer(byte[] data, boolean keyFrame, String codecHint) throws IOException {
|
||||||
|
if (closed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] normalizedData = normalizeToAnnexB(data, codecHint);
|
||||||
|
if (normalizedData != data && !framingNormalizationLogged) {
|
||||||
|
framingNormalizationLogged = true;
|
||||||
|
log.info("Camera stream {} normalized {} packets to Annex-B framing", streamName, codecHint);
|
||||||
|
}
|
||||||
|
data = normalizedData;
|
||||||
|
|
||||||
|
InputCodec encodedFrameCodec = detectEncodedFrameCodec(data);
|
||||||
|
InputCodec detectedCodec = encodedFrameCodec != null ? encodedFrameCodec : detectCodecHint(codecHint);
|
||||||
|
if (detectedCodec != null) {
|
||||||
|
if (inputCodec != null && inputCodec != detectedCodec) {
|
||||||
|
throw new IOException("Camera stream codec changed from " + inputCodec.displayName
|
||||||
|
+ " to " + detectedCodec.displayName + "; reconnect the stream");
|
||||||
|
}
|
||||||
|
if (inputCodec == null) {
|
||||||
|
inputCodec = detectedCodec;
|
||||||
|
log.info("Camera stream {} selected {} decoder (codec hint: {})",
|
||||||
|
streamName, inputCodec.displayName,
|
||||||
|
codecHint == null || codecHint.isBlank() ? "NAL detection" : codecHint);
|
||||||
|
notifyAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean h264SpsFrame = inputCodec == InputCodec.H264 && containsNalType(data, InputCodec.H264, 7);
|
||||||
|
boolean h264PpsFrame = inputCodec == InputCodec.H264 && containsNalType(data, InputCodec.H264, 8);
|
||||||
|
boolean h265SpsFrame = inputCodec == InputCodec.H265 && containsNalType(data, InputCodec.H265, 33);
|
||||||
|
boolean sequenceHeaderStart = h264SpsFrame || h265SpsFrame;
|
||||||
|
if (sequenceHeaderStart && !decoderStarted) {
|
||||||
|
int staleFrames = queue.size();
|
||||||
|
queue.clear();
|
||||||
|
queuedBytes = 0;
|
||||||
|
droppingUntilKeyFrame = false;
|
||||||
|
recordDrop(staleFrames);
|
||||||
|
if (inputCodec == InputCodec.H264) {
|
||||||
|
h264SpsSeen = false;
|
||||||
|
h264PpsSeen = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean wasSequenceHeaderSeen = sequenceHeaderSeen;
|
||||||
|
if (inputCodec == InputCodec.H264) {
|
||||||
|
h264SpsSeen |= h264SpsFrame;
|
||||||
|
h264PpsSeen |= h264PpsFrame;
|
||||||
|
sequenceHeaderSeen = h264SpsSeen && h264PpsSeen;
|
||||||
|
} else if (inputCodec == InputCodec.H265) {
|
||||||
|
sequenceHeaderSeen |= h265SpsFrame;
|
||||||
|
}
|
||||||
|
if (!wasSequenceHeaderSeen && sequenceHeaderSeen) {
|
||||||
|
log.info("Camera stream {} received the {} sequence header; decoder can start",
|
||||||
|
streamName, inputCodec.displayName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (droppingUntilKeyFrame) {
|
||||||
|
if (!keyFrame) {
|
||||||
|
recordDrop(1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
droppingUntilKeyFrame = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean queueOverloaded = queue.size() >= maxQueuedFrames
|
||||||
|
|| queuedBytes + data.length > maxQueuedBytes;
|
||||||
|
boolean newerGopAvailable = decoderInitialized && keyFrame
|
||||||
|
&& queue.size() >= Math.max(2, maxQueuedFrames / 2);
|
||||||
|
if (queueOverloaded || newerGopAvailable) {
|
||||||
|
int staleFrames = queue.size();
|
||||||
|
queue.clear();
|
||||||
|
queuedBytes = 0;
|
||||||
|
recordDrop(staleFrames);
|
||||||
|
if (!keyFrame) {
|
||||||
|
droppingUntilKeyFrame = true;
|
||||||
|
recordDrop(1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
queue.addLast(new EncodedFrame(data));
|
||||||
|
queuedBytes += data.length;
|
||||||
|
notifyAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized InputCodec awaitInputCodec() throws IOException {
|
||||||
|
while (!closed && (inputCodec == null || !sequenceHeaderSeen)) {
|
||||||
|
try {
|
||||||
|
wait();
|
||||||
|
} catch (InterruptedException exception) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
throw new IOException("Interrupted while waiting for camera codec", exception);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (inputCodec == null || !sequenceHeaderSeen) {
|
||||||
|
throw new IOException("Camera stream closed before its H.264/H.265 sequence header was received");
|
||||||
|
}
|
||||||
|
decoderStarted = true;
|
||||||
|
return inputCodec;
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized void markDecoderInitialized() {
|
||||||
|
decoderInitialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized int read() throws IOException {
|
||||||
|
byte[] oneByte = new byte[1];
|
||||||
|
int count = read(oneByte, 0, 1);
|
||||||
|
return count < 0 ? -1 : oneByte[0] & 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized int read(byte[] target, int offset, int length) throws IOException {
|
||||||
|
while (!closed && !ensureCurrentFrame()) {
|
||||||
|
try {
|
||||||
|
wait();
|
||||||
|
} catch (InterruptedException exception) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
throw new IOException("Interrupted while waiting for encoded video data", exception);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!ensureCurrentFrame()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int count = Math.min(length, currentFrame.length - currentOffset);
|
||||||
|
System.arraycopy(currentFrame, currentOffset, target, offset, count);
|
||||||
|
currentOffset += count;
|
||||||
|
if (currentOffset >= currentFrame.length) {
|
||||||
|
currentFrame = null;
|
||||||
|
currentOffset = 0;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized int available() {
|
||||||
|
int currentBytes = currentFrame == null ? 0 : currentFrame.length - currentOffset;
|
||||||
|
return currentBytes + queuedBytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void close() {
|
||||||
|
closed = true;
|
||||||
|
queue.clear();
|
||||||
|
queuedBytes = 0;
|
||||||
|
currentFrame = null;
|
||||||
|
notifyAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean ensureCurrentFrame() {
|
||||||
|
if (currentFrame != null && currentOffset < currentFrame.length) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
EncodedFrame next = queue.pollFirst();
|
||||||
|
if (next == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
queuedBytes -= next.data.length;
|
||||||
|
currentFrame = next.data;
|
||||||
|
currentOffset = 0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void recordDrop(long count) {
|
||||||
|
if (count <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
droppedFrames += count;
|
||||||
|
long now = System.nanoTime();
|
||||||
|
if (now - lastDropLogNanos >= 1_000_000_000L) {
|
||||||
|
log.warn("Camera stream {} is behind; dropped {} stale encoded frames and will resume at the latest key frame",
|
||||||
|
streamName, droppedFrames);
|
||||||
|
droppedFrames = 0;
|
||||||
|
lastDropLogNanos = now;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static byte[] normalizeToAnnexB(byte[] data, String codecHint) {
|
||||||
|
if (hasAnnexBStartCode(data)) {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] converted = convertLengthPrefixedToAnnexB(data);
|
||||||
|
if (converted != null) {
|
||||||
|
return converted;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (detectCodecHint(codecHint) != null) {
|
||||||
|
byte[] prefixed = new byte[data.length + 4];
|
||||||
|
prefixed[3] = 1;
|
||||||
|
System.arraycopy(data, 0, prefixed, 4, data.length);
|
||||||
|
return prefixed;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean hasAnnexBStartCode(byte[] data) {
|
||||||
|
int scanLimit = Math.min(data.length - 2, 8);
|
||||||
|
for (int index = 0; index < scanLimit; index++) {
|
||||||
|
if (startCodeLength(data, index) > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static byte[] convertLengthPrefixedToAnnexB(byte[] data) {
|
||||||
|
if (data.length < 5) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
int offset = 0;
|
||||||
|
int nalCount = 0;
|
||||||
|
ByteArrayOutputStream output = new ByteArrayOutputStream(data.length + 16);
|
||||||
|
while (offset + 4 <= data.length) {
|
||||||
|
long nalLength = ((long) (data[offset] & 0xFF) << 24)
|
||||||
|
| ((long) (data[offset + 1] & 0xFF) << 16)
|
||||||
|
| ((long) (data[offset + 2] & 0xFF) << 8)
|
||||||
|
| (data[offset + 3] & 0xFFL);
|
||||||
|
offset += 4;
|
||||||
|
if (nalLength <= 0 || nalLength > data.length - offset) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
output.write(0);
|
||||||
|
output.write(0);
|
||||||
|
output.write(0);
|
||||||
|
output.write(1);
|
||||||
|
output.write(data, offset, (int) nalLength);
|
||||||
|
offset += (int) nalLength;
|
||||||
|
nalCount++;
|
||||||
|
}
|
||||||
|
return offset == data.length && nalCount > 0 ? output.toByteArray() : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static InputCodec detectCodecHint(String codecHint) {
|
||||||
|
if (codecHint != null && !codecHint.isBlank()) {
|
||||||
|
String normalized = codecHint.trim().toLowerCase(Locale.ROOT);
|
||||||
|
if (normalized.contains("h265") || normalized.contains("h.265")
|
||||||
|
|| normalized.contains("hevc") || normalized.contains("hev1")
|
||||||
|
|| normalized.contains("hvc1")) {
|
||||||
|
return InputCodec.H265;
|
||||||
|
}
|
||||||
|
if (normalized.contains("h264") || normalized.contains("h.264")
|
||||||
|
|| normalized.contains("avc") || normalized.contains("avc1")) {
|
||||||
|
return InputCodec.H264;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean containsNalType(byte[] data, InputCodec codec, int expectedType) {
|
||||||
|
for (int index = 0; index + 3 < data.length; index++) {
|
||||||
|
int startCodeLength = startCodeLength(data, index);
|
||||||
|
if (startCodeLength > 0) {
|
||||||
|
int nalType = nalType(codec, data[index + startCodeLength] & 0xFF);
|
||||||
|
if (nalType == expectedType) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
index += startCodeLength - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int nalType(InputCodec codec, int header) {
|
||||||
|
return codec == InputCodec.H264 ? header & 0x1F : (header >> 1) & 0x3F;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static InputCodec detectEncodedFrameCodec(byte[] data) {
|
||||||
|
if (data == null || data.length == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (int index = 0; index + 3 < data.length; index++) {
|
||||||
|
int startCodeLength = startCodeLength(data, index);
|
||||||
|
if (startCodeLength > 0) {
|
||||||
|
InputCodec codec = detectNalHeader(data[index + startCodeLength] & 0xFF);
|
||||||
|
if (codec != null) {
|
||||||
|
return codec;
|
||||||
|
}
|
||||||
|
index += startCodeLength - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int offset = 0;
|
||||||
|
while (offset + 5 <= data.length) {
|
||||||
|
long nalLength = ((long) (data[offset] & 0xFF) << 24)
|
||||||
|
| ((long) (data[offset + 1] & 0xFF) << 16)
|
||||||
|
| ((long) (data[offset + 2] & 0xFF) << 8)
|
||||||
|
| (data[offset + 3] & 0xFFL);
|
||||||
|
if (nalLength <= 0 || nalLength > data.length - offset - 4L) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
InputCodec codec = detectNalHeader(data[offset + 4] & 0xFF);
|
||||||
|
if (codec != null) {
|
||||||
|
return codec;
|
||||||
|
}
|
||||||
|
offset += 4 + (int) nalLength;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int startCodeLength(byte[] data, int index) {
|
||||||
|
if (index + 2 < data.length && data[index] == 0 && data[index + 1] == 0) {
|
||||||
|
if (data[index + 2] == 1) {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
if (index + 3 < data.length && data[index + 2] == 0 && data[index + 3] == 1) {
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static InputCodec detectNalHeader(int header) {
|
||||||
|
int h264Type = header & 0x1F;
|
||||||
|
if (h264Type == 7) {
|
||||||
|
return InputCodec.H264;
|
||||||
|
}
|
||||||
|
int h265Type = (header >> 1) & 0x3F;
|
||||||
|
if (h265Type == 33) {
|
||||||
|
return InputCodec.H265;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class EncodedFrame {
|
||||||
|
private final byte[] data;
|
||||||
|
|
||||||
|
private EncodedFrame(byte[] data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class MediaChunkOutputStream extends OutputStream {
|
||||||
|
private final ByteArrayOutputStream buffer = new ByteArrayOutputStream(128 * 1024);
|
||||||
|
private final Consumer<byte[]> consumer;
|
||||||
|
|
||||||
|
private MediaChunkOutputStream(Consumer<byte[]> consumer) {
|
||||||
|
this.consumer = consumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void write(int value) {
|
||||||
|
buffer.write(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void write(byte[] bytes, int offset, int length) {
|
||||||
|
buffer.write(bytes, offset, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void flush() {
|
||||||
|
publishAvailable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized void publishAvailable() {
|
||||||
|
if (buffer.size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
byte[] chunk = buffer.toByteArray();
|
||||||
|
buffer.reset();
|
||||||
|
consumer.accept(chunk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
21
cmvr-iot-api/cmvr-iot-edge/cmvr-iot-grpc-lib/README.md
Normal file
21
cmvr-iot-api/cmvr-iot-edge/cmvr-iot-grpc-lib/README.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# CMVR-ES Proto Contract
|
||||||
|
|
||||||
|
This module maintains a one-way mirror of protobuf definitions from the
|
||||||
|
`xtkuang_dev` branch of the CMVR-ES repository.
|
||||||
|
|
||||||
|
During Maven's `initialize` phase, the build performs a shallow sparse clone
|
||||||
|
of the upstream `protos/cmvr/api`, `protos/cmvr/msgs`, and
|
||||||
|
`protos/cmvr/common` directories. These directories replace the local
|
||||||
|
`src/main/proto/cmvr` mirror, and Java/gRPC sources are regenerated under
|
||||||
|
`src/main/java/cmvr` so Maven and IDE compilation use the same files.
|
||||||
|
|
||||||
|
The build machine must have `git` installed and read access to the CMVR-ES
|
||||||
|
SSH repository. The upstream repository and ref can be overridden when
|
||||||
|
needed:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mvn -Dcmvr.es.repository=<git-url> -Dcmvr.es.proto.ref=<branch-or-tag> compile
|
||||||
|
```
|
||||||
|
|
||||||
|
Do not edit local proto or generated Java files. The next Maven build replaces
|
||||||
|
them with the current upstream definitions.
|
||||||
@ -10,6 +10,12 @@
|
|||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>cmvr-iot-grpc-lib</artifactId>
|
<artifactId>cmvr-iot-grpc-lib</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<cmvr.es.repository>ssh://git@192.168.28.10:10022/SmartBench/cmvr-es.git</cmvr.es.repository>
|
||||||
|
<cmvr.es.proto.ref>xtkuang_dev</cmvr.es.proto.ref>
|
||||||
|
<cmvr.es.checkout.dir>${project.build.directory}/cmvr-es</cmvr.es.checkout.dir>
|
||||||
|
</properties>
|
||||||
<description> cmvr-iot gRPC 公共 proto 生成库</description>
|
<description> cmvr-iot gRPC 公共 proto 生成库</description>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -52,6 +58,64 @@
|
|||||||
</extension>
|
</extension>
|
||||||
</extensions>
|
</extensions>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>fetch-cmvr-es-protos</id>
|
||||||
|
<phase>initialize</phase>
|
||||||
|
<configuration>
|
||||||
|
<target>
|
||||||
|
<delete dir="${cmvr.es.checkout.dir}" quiet="true"/>
|
||||||
|
<mkdir dir="${project.build.directory}"/>
|
||||||
|
<exec executable="git" failonerror="true">
|
||||||
|
<arg value="clone"/>
|
||||||
|
<arg value="--depth"/>
|
||||||
|
<arg value="1"/>
|
||||||
|
<arg value="--filter=blob:none"/>
|
||||||
|
<arg value="--sparse"/>
|
||||||
|
<arg value="--single-branch"/>
|
||||||
|
<arg value="--branch"/>
|
||||||
|
<arg value="${cmvr.es.proto.ref}"/>
|
||||||
|
<arg value="${cmvr.es.repository}"/>
|
||||||
|
<arg value="${cmvr.es.checkout.dir}"/>
|
||||||
|
</exec>
|
||||||
|
<exec executable="git" failonerror="true">
|
||||||
|
<arg value="-C"/>
|
||||||
|
<arg value="${cmvr.es.checkout.dir}"/>
|
||||||
|
<arg value="sparse-checkout"/>
|
||||||
|
<arg value="set"/>
|
||||||
|
<arg value="protos/cmvr/api"/>
|
||||||
|
<arg value="protos/cmvr/msgs"/>
|
||||||
|
<arg value="protos/cmvr/common"/>
|
||||||
|
</exec>
|
||||||
|
<exec executable="git" failonerror="true">
|
||||||
|
<arg value="-C"/>
|
||||||
|
<arg value="${cmvr.es.checkout.dir}"/>
|
||||||
|
<arg value="rev-parse"/>
|
||||||
|
<arg value="HEAD"/>
|
||||||
|
</exec>
|
||||||
|
<delete dir="${basedir}/src/main/proto/cmvr" quiet="true"/>
|
||||||
|
<copy todir="${basedir}/src/main/proto/cmvr/api">
|
||||||
|
<fileset dir="${cmvr.es.checkout.dir}/protos/cmvr/api" includes="**/*.proto"/>
|
||||||
|
</copy>
|
||||||
|
<copy todir="${basedir}/src/main/proto/cmvr/msgs">
|
||||||
|
<fileset dir="${cmvr.es.checkout.dir}/protos/cmvr/msgs" includes="**/*.proto"/>
|
||||||
|
</copy>
|
||||||
|
<copy todir="${basedir}/src/main/proto/cmvr/common">
|
||||||
|
<fileset dir="${cmvr.es.checkout.dir}/protos/cmvr/common" includes="**/*.proto"/>
|
||||||
|
</copy>
|
||||||
|
<delete dir="${basedir}/src/main/java/cmvr" quiet="true"/>
|
||||||
|
</target>
|
||||||
|
</configuration>
|
||||||
|
<goals>
|
||||||
|
<goal>run</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.xolstice.maven.plugins</groupId>
|
<groupId>org.xolstice.maven.plugins</groupId>
|
||||||
<artifactId>protobuf-maven-plugin</artifactId>
|
<artifactId>protobuf-maven-plugin</artifactId>
|
||||||
@ -60,10 +124,14 @@
|
|||||||
<protocArtifact>com.google.protobuf:protoc:3.21.7:exe:${os.detected.classifier}</protocArtifact>
|
<protocArtifact>com.google.protobuf:protoc:3.21.7:exe:${os.detected.classifier}</protocArtifact>
|
||||||
<pluginId>grpc-java</pluginId>
|
<pluginId>grpc-java</pluginId>
|
||||||
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.52.0:exe:${os.detected.classifier}</pluginArtifact>
|
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.52.0:exe:${os.detected.classifier}</pluginArtifact>
|
||||||
<!-- 输出目录 -->
|
<protoSourceRoot>${basedir}/src/main/proto</protoSourceRoot>
|
||||||
<outputDirectory>${basedir}/src/main/java</outputDirectory>
|
<outputDirectory>${basedir}/src/main/java</outputDirectory>
|
||||||
<!-- 每次执行命令时不清空之前生成的代码(追加的方式) -->
|
|
||||||
<clearOutputDirectory>false</clearOutputDirectory>
|
<clearOutputDirectory>false</clearOutputDirectory>
|
||||||
|
<includes>
|
||||||
|
<include>cmvr/api/*.proto</include>
|
||||||
|
<include>cmvr/msgs/*.proto</include>
|
||||||
|
<include>cmvr/common/*.proto</include>
|
||||||
|
</includes>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -449,6 +449,37 @@ public final class ArmServiceGrpc {
|
|||||||
return getComputeForwardKinematicsMethod;
|
return getComputeForwardKinematicsMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.Common.JsonDeviceCommand.Request,
|
||||||
|
cmvr.api.Common.JsonDeviceCommand.Feedback> getExecuteJsonCommandMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "ExecuteJsonCommand",
|
||||||
|
requestType = cmvr.api.Common.JsonDeviceCommand.Request.class,
|
||||||
|
responseType = cmvr.api.Common.JsonDeviceCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.Common.JsonDeviceCommand.Request,
|
||||||
|
cmvr.api.Common.JsonDeviceCommand.Feedback> getExecuteJsonCommandMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.Common.JsonDeviceCommand.Request, cmvr.api.Common.JsonDeviceCommand.Feedback> getExecuteJsonCommandMethod;
|
||||||
|
if ((getExecuteJsonCommandMethod = ArmServiceGrpc.getExecuteJsonCommandMethod) == null) {
|
||||||
|
synchronized (ArmServiceGrpc.class) {
|
||||||
|
if ((getExecuteJsonCommandMethod = ArmServiceGrpc.getExecuteJsonCommandMethod) == null) {
|
||||||
|
ArmServiceGrpc.getExecuteJsonCommandMethod = getExecuteJsonCommandMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.Common.JsonDeviceCommand.Request, cmvr.api.Common.JsonDeviceCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "ExecuteJsonCommand"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.Common.JsonDeviceCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.Common.JsonDeviceCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new ArmServiceMethodDescriptorSupplier("ExecuteJsonCommand"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getExecuteJsonCommandMethod;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new async stub that supports all call types for the service
|
* Creates a new async stub that supports all call types for the service
|
||||||
*/
|
*/
|
||||||
@ -595,6 +626,16 @@ public final class ArmServiceGrpc {
|
|||||||
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getComputeForwardKinematicsMethod(), responseObserver);
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getComputeForwardKinematicsMethod(), responseObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* Vendor-specific arm extension currently used for AUBO cabinet IO.
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void executeJsonCommand(cmvr.api.Common.JsonDeviceCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.Common.JsonDeviceCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExecuteJsonCommandMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||||||
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||||||
.addMethod(
|
.addMethod(
|
||||||
@ -695,6 +736,13 @@ public final class ArmServiceGrpc {
|
|||||||
cmvr.api.ArmCommand.ComputeForwardKinematics.Request,
|
cmvr.api.ArmCommand.ComputeForwardKinematics.Request,
|
||||||
cmvr.api.ArmCommand.ComputeForwardKinematics.Response>(
|
cmvr.api.ArmCommand.ComputeForwardKinematics.Response>(
|
||||||
this, METHODID_COMPUTE_FORWARD_KINEMATICS)))
|
this, METHODID_COMPUTE_FORWARD_KINEMATICS)))
|
||||||
|
.addMethod(
|
||||||
|
getExecuteJsonCommandMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.Common.JsonDeviceCommand.Request,
|
||||||
|
cmvr.api.Common.JsonDeviceCommand.Feedback>(
|
||||||
|
this, METHODID_EXECUTE_JSON_COMMAND)))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -824,6 +872,17 @@ public final class ArmServiceGrpc {
|
|||||||
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
getChannel().newCall(getComputeForwardKinematicsMethod(), getCallOptions()), request, responseObserver);
|
getChannel().newCall(getComputeForwardKinematicsMethod(), getCallOptions()), request, responseObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* Vendor-specific arm extension currently used for AUBO cabinet IO.
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void executeJsonCommand(cmvr.api.Common.JsonDeviceCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.Common.JsonDeviceCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getExecuteJsonCommandMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -937,6 +996,16 @@ public final class ArmServiceGrpc {
|
|||||||
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
getChannel(), getComputeForwardKinematicsMethod(), getCallOptions(), request);
|
getChannel(), getComputeForwardKinematicsMethod(), getCallOptions(), request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* Vendor-specific arm extension currently used for AUBO cabinet IO.
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public cmvr.api.Common.JsonDeviceCommand.Feedback executeJsonCommand(cmvr.api.Common.JsonDeviceCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getExecuteJsonCommandMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1064,6 +1133,17 @@ public final class ArmServiceGrpc {
|
|||||||
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
getChannel().newCall(getComputeForwardKinematicsMethod(), getCallOptions()), request);
|
getChannel().newCall(getComputeForwardKinematicsMethod(), getCallOptions()), request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* Vendor-specific arm extension currently used for AUBO cabinet IO.
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.Common.JsonDeviceCommand.Feedback> executeJsonCommand(
|
||||||
|
cmvr.api.Common.JsonDeviceCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getExecuteJsonCommandMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int METHODID_TORQUE_OFF = 0;
|
private static final int METHODID_TORQUE_OFF = 0;
|
||||||
@ -1080,6 +1160,7 @@ public final class ArmServiceGrpc {
|
|||||||
private static final int METHODID_CALIBRATE_ZERO_Q = 11;
|
private static final int METHODID_CALIBRATE_ZERO_Q = 11;
|
||||||
private static final int METHODID_GET_POSE_MATRIX = 12;
|
private static final int METHODID_GET_POSE_MATRIX = 12;
|
||||||
private static final int METHODID_COMPUTE_FORWARD_KINEMATICS = 13;
|
private static final int METHODID_COMPUTE_FORWARD_KINEMATICS = 13;
|
||||||
|
private static final int METHODID_EXECUTE_JSON_COMMAND = 14;
|
||||||
|
|
||||||
private static final class MethodHandlers<Req, Resp> implements
|
private static final class MethodHandlers<Req, Resp> implements
|
||||||
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||||
@ -1154,6 +1235,10 @@ public final class ArmServiceGrpc {
|
|||||||
serviceImpl.computeForwardKinematics((cmvr.api.ArmCommand.ComputeForwardKinematics.Request) request,
|
serviceImpl.computeForwardKinematics((cmvr.api.ArmCommand.ComputeForwardKinematics.Request) request,
|
||||||
(io.grpc.stub.StreamObserver<cmvr.api.ArmCommand.ComputeForwardKinematics.Response>) responseObserver);
|
(io.grpc.stub.StreamObserver<cmvr.api.ArmCommand.ComputeForwardKinematics.Response>) responseObserver);
|
||||||
break;
|
break;
|
||||||
|
case METHODID_EXECUTE_JSON_COMMAND:
|
||||||
|
serviceImpl.executeJsonCommand((cmvr.api.Common.JsonDeviceCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.Common.JsonDeviceCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new AssertionError();
|
throw new AssertionError();
|
||||||
}
|
}
|
||||||
@ -1229,6 +1314,7 @@ public final class ArmServiceGrpc {
|
|||||||
.addMethod(getCalibrateZeroQMethod())
|
.addMethod(getCalibrateZeroQMethod())
|
||||||
.addMethod(getGetPoseMatrixMethod())
|
.addMethod(getGetPoseMatrixMethod())
|
||||||
.addMethod(getComputeForwardKinematicsMethod())
|
.addMethod(getComputeForwardKinematicsMethod())
|
||||||
|
.addMethod(getExecuteJsonCommandMethod())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ public final class ArmServiceOuterClass {
|
|||||||
java.lang.String[] descriptorData = {
|
java.lang.String[] descriptorData = {
|
||||||
"\n\032cmvr/api/arm_service.proto\022\010cmvr.api\032\025" +
|
"\n\032cmvr/api/arm_service.proto\022\010cmvr.api\032\025" +
|
||||||
"cmvr/api/common.proto\032\032cmvr/api/arm_comm" +
|
"cmvr/api/common.proto\032\032cmvr/api/arm_comm" +
|
||||||
"and.proto2\246\010\n\nArmService\022N\n\ttorqueOff\022\037." +
|
"and.proto2\207\t\n\nArmService\022N\n\ttorqueOff\022\037." +
|
||||||
"cmvr.api.CommandHeader.Request\032 .cmvr.ap" +
|
"cmvr.api.CommandHeader.Request\032 .cmvr.ap" +
|
||||||
"i.CommandHeader.Feedback\022M\n\010torqueOn\022\037.c" +
|
"i.CommandHeader.Feedback\022M\n\010torqueOn\022\037.c" +
|
||||||
"mvr.api.CommandHeader.Request\032 .cmvr.api" +
|
"mvr.api.CommandHeader.Request\032 .cmvr.api" +
|
||||||
@ -51,8 +51,10 @@ public final class ArmServiceOuterClass {
|
|||||||
"est\032 .cmvr.api.GetPoseMatrix.Response\022s\n" +
|
"est\032 .cmvr.api.GetPoseMatrix.Response\022s\n" +
|
||||||
"\030computeForwardKinematics\022*.cmvr.api.Com" +
|
"\030computeForwardKinematics\022*.cmvr.api.Com" +
|
||||||
"puteForwardKinematics.Request\032+.cmvr.api" +
|
"puteForwardKinematics.Request\032+.cmvr.api" +
|
||||||
".ComputeForwardKinematics.Responseb\006prot" +
|
".ComputeForwardKinematics.Response\022_\n\022Ex" +
|
||||||
"o3"
|
"ecuteJsonCommand\022#.cmvr.api.JsonDeviceCo" +
|
||||||
|
"mmand.Request\032$.cmvr.api.JsonDeviceComma" +
|
||||||
|
"nd.Feedbackb\006proto3"
|
||||||
};
|
};
|
||||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
.internalBuildGeneratedFileFrom(descriptorData,
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -263,6 +263,37 @@ public final class CameraServiceGrpc {
|
|||||||
return getStopRecordingMethod;
|
return getStopRecordingMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.CameraCommand.ControlPtzCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.ControlPtzCommand.Feedback> getControlPtzMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "ControlPtz",
|
||||||
|
requestType = cmvr.api.CameraCommand.ControlPtzCommand.Request.class,
|
||||||
|
responseType = cmvr.api.CameraCommand.ControlPtzCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.CameraCommand.ControlPtzCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.ControlPtzCommand.Feedback> getControlPtzMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.CameraCommand.ControlPtzCommand.Request, cmvr.api.CameraCommand.ControlPtzCommand.Feedback> getControlPtzMethod;
|
||||||
|
if ((getControlPtzMethod = CameraServiceGrpc.getControlPtzMethod) == null) {
|
||||||
|
synchronized (CameraServiceGrpc.class) {
|
||||||
|
if ((getControlPtzMethod = CameraServiceGrpc.getControlPtzMethod) == null) {
|
||||||
|
CameraServiceGrpc.getControlPtzMethod = getControlPtzMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.CameraCommand.ControlPtzCommand.Request, cmvr.api.CameraCommand.ControlPtzCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "ControlPtz"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.ControlPtzCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.CameraCommand.ControlPtzCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new CameraServiceMethodDescriptorSupplier("ControlPtz"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getControlPtzMethod;
|
||||||
|
}
|
||||||
|
|
||||||
private static volatile io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetRGBImageStreamCommand.Request,
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.CameraCommand.GetRGBImageStreamCommand.Request,
|
||||||
cmvr.api.CameraCommand.GetRGBImageStreamCommand.Feedback> getGetRGBImageStreamMethod;
|
cmvr.api.CameraCommand.GetRGBImageStreamCommand.Feedback> getGetRGBImageStreamMethod;
|
||||||
|
|
||||||
@ -460,6 +491,13 @@ public final class CameraServiceGrpc {
|
|||||||
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStopRecordingMethod(), responseObserver);
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStopRecordingMethod(), responseObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void controlPtz(cmvr.api.CameraCommand.ControlPtzCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.ControlPtzCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getControlPtzMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBImageStreamCommand.Request> getRGBImageStream(
|
public io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBImageStreamCommand.Request> getRGBImageStream(
|
||||||
@ -539,6 +577,13 @@ public final class CameraServiceGrpc {
|
|||||||
cmvr.api.CameraCommand.StopCameraRecordingCommand.Request,
|
cmvr.api.CameraCommand.StopCameraRecordingCommand.Request,
|
||||||
cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback>(
|
cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback>(
|
||||||
this, METHODID_STOP_RECORDING)))
|
this, METHODID_STOP_RECORDING)))
|
||||||
|
.addMethod(
|
||||||
|
getControlPtzMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.CameraCommand.ControlPtzCommand.Request,
|
||||||
|
cmvr.api.CameraCommand.ControlPtzCommand.Feedback>(
|
||||||
|
this, METHODID_CONTROL_PTZ)))
|
||||||
.addMethod(
|
.addMethod(
|
||||||
getGetRGBImageStreamMethod(),
|
getGetRGBImageStreamMethod(),
|
||||||
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
|
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
|
||||||
@ -642,6 +687,14 @@ public final class CameraServiceGrpc {
|
|||||||
getChannel().newCall(getStopRecordingMethod(), getCallOptions()), request, responseObserver);
|
getChannel().newCall(getStopRecordingMethod(), getCallOptions()), request, responseObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void controlPtz(cmvr.api.CameraCommand.ControlPtzCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.ControlPtzCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getControlPtzMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBImageStreamCommand.Request> getRGBImageStream(
|
public io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.GetRGBImageStreamCommand.Request> getRGBImageStream(
|
||||||
@ -736,6 +789,13 @@ public final class CameraServiceGrpc {
|
|||||||
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
getChannel(), getStopRecordingMethod(), getCallOptions(), request);
|
getChannel(), getStopRecordingMethod(), getCallOptions(), request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.CameraCommand.ControlPtzCommand.Feedback controlPtz(cmvr.api.CameraCommand.ControlPtzCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getControlPtzMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -815,6 +875,14 @@ public final class CameraServiceGrpc {
|
|||||||
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
getChannel().newCall(getStopRecordingMethod(), getCallOptions()), request);
|
getChannel().newCall(getStopRecordingMethod(), getCallOptions()), request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.CameraCommand.ControlPtzCommand.Feedback> controlPtz(
|
||||||
|
cmvr.api.CameraCommand.ControlPtzCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getControlPtzMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int METHODID_GET_STATUS = 0;
|
private static final int METHODID_GET_STATUS = 0;
|
||||||
@ -825,9 +893,10 @@ public final class CameraServiceGrpc {
|
|||||||
private static final int METHODID_GET_RGBDIMAGES = 5;
|
private static final int METHODID_GET_RGBDIMAGES = 5;
|
||||||
private static final int METHODID_START_RECORDING = 6;
|
private static final int METHODID_START_RECORDING = 6;
|
||||||
private static final int METHODID_STOP_RECORDING = 7;
|
private static final int METHODID_STOP_RECORDING = 7;
|
||||||
private static final int METHODID_GET_RGBIMAGE_STREAM = 8;
|
private static final int METHODID_CONTROL_PTZ = 8;
|
||||||
private static final int METHODID_GET_DEPTH_IMAGE_STREAM = 9;
|
private static final int METHODID_GET_RGBIMAGE_STREAM = 9;
|
||||||
private static final int METHODID_GET_RGBDIMAGES_STREAM = 10;
|
private static final int METHODID_GET_DEPTH_IMAGE_STREAM = 10;
|
||||||
|
private static final int METHODID_GET_RGBDIMAGES_STREAM = 11;
|
||||||
|
|
||||||
private static final class MethodHandlers<Req, Resp> implements
|
private static final class MethodHandlers<Req, Resp> implements
|
||||||
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||||
@ -878,6 +947,10 @@ public final class CameraServiceGrpc {
|
|||||||
serviceImpl.stopRecording((cmvr.api.CameraCommand.StopCameraRecordingCommand.Request) request,
|
serviceImpl.stopRecording((cmvr.api.CameraCommand.StopCameraRecordingCommand.Request) request,
|
||||||
(io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback>) responseObserver);
|
(io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.StopCameraRecordingCommand.Feedback>) responseObserver);
|
||||||
break;
|
break;
|
||||||
|
case METHODID_CONTROL_PTZ:
|
||||||
|
serviceImpl.controlPtz((cmvr.api.CameraCommand.ControlPtzCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.CameraCommand.ControlPtzCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new AssertionError();
|
throw new AssertionError();
|
||||||
}
|
}
|
||||||
@ -956,6 +1029,7 @@ public final class CameraServiceGrpc {
|
|||||||
.addMethod(getGetRGBDImagesMethod())
|
.addMethod(getGetRGBDImagesMethod())
|
||||||
.addMethod(getStartRecordingMethod())
|
.addMethod(getStartRecordingMethod())
|
||||||
.addMethod(getStopRecordingMethod())
|
.addMethod(getStopRecordingMethod())
|
||||||
|
.addMethod(getControlPtzMethod())
|
||||||
.addMethod(getGetRGBImageStreamMethod())
|
.addMethod(getGetRGBImageStreamMethod())
|
||||||
.addMethod(getGetDepthImageStreamMethod())
|
.addMethod(getGetDepthImageStreamMethod())
|
||||||
.addMethod(getGetRGBDImagesStreamMethod())
|
.addMethod(getGetRGBDImagesStreamMethod())
|
||||||
|
|||||||
@ -24,7 +24,7 @@ public final class CameraServiceOuterClass {
|
|||||||
static {
|
static {
|
||||||
java.lang.String[] descriptorData = {
|
java.lang.String[] descriptorData = {
|
||||||
"\n\035cmvr/api/camera_service.proto\022\010cmvr.ap" +
|
"\n\035cmvr/api/camera_service.proto\022\010cmvr.ap" +
|
||||||
"i\032\035cmvr/api/camera_command.proto2\233\t\n\rCam" +
|
"i\032\035cmvr/api/camera_command.proto2\366\t\n\rCam" +
|
||||||
"eraService\022`\n\tGetStatus\022\'.cmvr.api.GetCa" +
|
"eraService\022`\n\tGetStatus\022\'.cmvr.api.GetCa" +
|
||||||
"meraStateCommand.Request\032(.cmvr.api.GetC" +
|
"meraStateCommand.Request\032(.cmvr.api.GetC" +
|
||||||
"ameraStateCommand.Feedback\"\000\022\\\n\013StartCam" +
|
"ameraStateCommand.Feedback\"\000\022\\\n\013StartCam" +
|
||||||
@ -45,16 +45,18 @@ public final class CameraServiceOuterClass {
|
|||||||
"dingCommand.Feedback\"\000\022n\n\rStopRecording\022" +
|
"dingCommand.Feedback\"\000\022n\n\rStopRecording\022" +
|
||||||
",.cmvr.api.StopCameraRecordingCommand.Re" +
|
",.cmvr.api.StopCameraRecordingCommand.Re" +
|
||||||
"quest\032-.cmvr.api.StopCameraRecordingComm" +
|
"quest\032-.cmvr.api.StopCameraRecordingComm" +
|
||||||
"and.Feedback\"\000\022r\n\021GetRGBImageStream\022*.cm" +
|
"and.Feedback\"\000\022Y\n\nControlPtz\022#.cmvr.api." +
|
||||||
"vr.api.GetRGBImageStreamCommand.Request\032" +
|
"ControlPtzCommand.Request\032$.cmvr.api.Con" +
|
||||||
"+.cmvr.api.GetRGBImageStreamCommand.Feed" +
|
"trolPtzCommand.Feedback\"\000\022r\n\021GetRGBImage" +
|
||||||
"back\"\000(\0010\001\022x\n\023GetDepthImageStream\022,.cmvr" +
|
"Stream\022*.cmvr.api.GetRGBImageStreamComma" +
|
||||||
".api.GetDepthImageStreamCommand.Request\032" +
|
"nd.Request\032+.cmvr.api.GetRGBImageStreamC" +
|
||||||
"-.cmvr.api.GetDepthImageStreamCommand.Fe" +
|
"ommand.Feedback\"\000(\0010\001\022x\n\023GetDepthImageSt" +
|
||||||
"edback\"\000(\0010\001\022x\n\023GetRGBDImagesStream\022,.cm" +
|
"ream\022,.cmvr.api.GetDepthImageStreamComma" +
|
||||||
"vr.api.GetRGBDImagesStreamCommand.Reques" +
|
"nd.Request\032-.cmvr.api.GetDepthImageStrea" +
|
||||||
"t\032-.cmvr.api.GetRGBDImagesStreamCommand." +
|
"mCommand.Feedback\"\000(\0010\001\022x\n\023GetRGBDImages" +
|
||||||
"Feedback\"\000(\0010\001b\006proto3"
|
"Stream\022,.cmvr.api.GetRGBDImagesStreamCom" +
|
||||||
|
"mand.Request\032-.cmvr.api.GetRGBDImagesStr" +
|
||||||
|
"eamCommand.Feedback\"\000(\0010\001b\006proto3"
|
||||||
};
|
};
|
||||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
.internalBuildGeneratedFileFrom(descriptorData,
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -596,8 +596,8 @@ public final class DexhandCommand {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface RH56DFTPDexHandOrBuilder extends
|
public interface FreedomStateOrBuilder extends
|
||||||
// @@protoc_insertion_point(interface_extends:cmvr.api.RH56DFTPDexHand)
|
// @@protoc_insertion_point(interface_extends:cmvr.api.FreedomState)
|
||||||
com.google.protobuf.MessageOrBuilder {
|
com.google.protobuf.MessageOrBuilder {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -722,18 +722,18 @@ public final class DexhandCommand {
|
|||||||
getErrorMessageBytes(int index);
|
getErrorMessageBytes(int index);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Protobuf type {@code cmvr.api.RH56DFTPDexHand}
|
* Protobuf type {@code cmvr.api.FreedomState}
|
||||||
*/
|
*/
|
||||||
public static final class RH56DFTPDexHand extends
|
public static final class FreedomState extends
|
||||||
com.google.protobuf.GeneratedMessageV3 implements
|
com.google.protobuf.GeneratedMessageV3 implements
|
||||||
// @@protoc_insertion_point(message_implements:cmvr.api.RH56DFTPDexHand)
|
// @@protoc_insertion_point(message_implements:cmvr.api.FreedomState)
|
||||||
RH56DFTPDexHandOrBuilder {
|
FreedomStateOrBuilder {
|
||||||
private static final long serialVersionUID = 0L;
|
private static final long serialVersionUID = 0L;
|
||||||
// Use RH56DFTPDexHand.newBuilder() to construct.
|
// Use FreedomState.newBuilder() to construct.
|
||||||
private RH56DFTPDexHand(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
private FreedomState(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||||
super(builder);
|
super(builder);
|
||||||
}
|
}
|
||||||
private RH56DFTPDexHand() {
|
private FreedomState() {
|
||||||
errorMessage_ = com.google.protobuf.LazyStringArrayList.EMPTY;
|
errorMessage_ = com.google.protobuf.LazyStringArrayList.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -741,7 +741,7 @@ public final class DexhandCommand {
|
|||||||
@SuppressWarnings({"unused"})
|
@SuppressWarnings({"unused"})
|
||||||
protected java.lang.Object newInstance(
|
protected java.lang.Object newInstance(
|
||||||
UnusedPrivateParameter unused) {
|
UnusedPrivateParameter unused) {
|
||||||
return new RH56DFTPDexHand();
|
return new FreedomState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
@ -751,15 +751,15 @@ public final class DexhandCommand {
|
|||||||
}
|
}
|
||||||
public static final com.google.protobuf.Descriptors.Descriptor
|
public static final com.google.protobuf.Descriptors.Descriptor
|
||||||
getDescriptor() {
|
getDescriptor() {
|
||||||
return cmvr.api.DexhandCommand.internal_static_cmvr_api_RH56DFTPDexHand_descriptor;
|
return cmvr.api.DexhandCommand.internal_static_cmvr_api_FreedomState_descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
internalGetFieldAccessorTable() {
|
internalGetFieldAccessorTable() {
|
||||||
return cmvr.api.DexhandCommand.internal_static_cmvr_api_RH56DFTPDexHand_fieldAccessorTable
|
return cmvr.api.DexhandCommand.internal_static_cmvr_api_FreedomState_fieldAccessorTable
|
||||||
.ensureFieldAccessorsInitialized(
|
.ensureFieldAccessorsInitialized(
|
||||||
cmvr.api.DexhandCommand.RH56DFTPDexHand.class, cmvr.api.DexhandCommand.RH56DFTPDexHand.Builder.class);
|
cmvr.api.DexhandCommand.FreedomState.class, cmvr.api.DexhandCommand.FreedomState.Builder.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final int DOF_ID_FIELD_NUMBER = 1;
|
public static final int DOF_ID_FIELD_NUMBER = 1;
|
||||||
@ -1033,10 +1033,10 @@ public final class DexhandCommand {
|
|||||||
if (obj == this) {
|
if (obj == this) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!(obj instanceof cmvr.api.DexhandCommand.RH56DFTPDexHand)) {
|
if (!(obj instanceof cmvr.api.DexhandCommand.FreedomState)) {
|
||||||
return super.equals(obj);
|
return super.equals(obj);
|
||||||
}
|
}
|
||||||
cmvr.api.DexhandCommand.RH56DFTPDexHand other = (cmvr.api.DexhandCommand.RH56DFTPDexHand) obj;
|
cmvr.api.DexhandCommand.FreedomState other = (cmvr.api.DexhandCommand.FreedomState) obj;
|
||||||
|
|
||||||
if (getDofId()
|
if (getDofId()
|
||||||
!= other.getDofId()) return false;
|
!= other.getDofId()) return false;
|
||||||
@ -1092,69 +1092,69 @@ public final class DexhandCommand {
|
|||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static cmvr.api.DexhandCommand.RH56DFTPDexHand parseFrom(
|
public static cmvr.api.DexhandCommand.FreedomState parseFrom(
|
||||||
java.nio.ByteBuffer data)
|
java.nio.ByteBuffer data)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return PARSER.parseFrom(data);
|
return PARSER.parseFrom(data);
|
||||||
}
|
}
|
||||||
public static cmvr.api.DexhandCommand.RH56DFTPDexHand parseFrom(
|
public static cmvr.api.DexhandCommand.FreedomState parseFrom(
|
||||||
java.nio.ByteBuffer data,
|
java.nio.ByteBuffer data,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return PARSER.parseFrom(data, extensionRegistry);
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
}
|
}
|
||||||
public static cmvr.api.DexhandCommand.RH56DFTPDexHand parseFrom(
|
public static cmvr.api.DexhandCommand.FreedomState parseFrom(
|
||||||
com.google.protobuf.ByteString data)
|
com.google.protobuf.ByteString data)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return PARSER.parseFrom(data);
|
return PARSER.parseFrom(data);
|
||||||
}
|
}
|
||||||
public static cmvr.api.DexhandCommand.RH56DFTPDexHand parseFrom(
|
public static cmvr.api.DexhandCommand.FreedomState parseFrom(
|
||||||
com.google.protobuf.ByteString data,
|
com.google.protobuf.ByteString data,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return PARSER.parseFrom(data, extensionRegistry);
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
}
|
}
|
||||||
public static cmvr.api.DexhandCommand.RH56DFTPDexHand parseFrom(byte[] data)
|
public static cmvr.api.DexhandCommand.FreedomState parseFrom(byte[] data)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return PARSER.parseFrom(data);
|
return PARSER.parseFrom(data);
|
||||||
}
|
}
|
||||||
public static cmvr.api.DexhandCommand.RH56DFTPDexHand parseFrom(
|
public static cmvr.api.DexhandCommand.FreedomState parseFrom(
|
||||||
byte[] data,
|
byte[] data,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return PARSER.parseFrom(data, extensionRegistry);
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
}
|
}
|
||||||
public static cmvr.api.DexhandCommand.RH56DFTPDexHand parseFrom(java.io.InputStream input)
|
public static cmvr.api.DexhandCommand.FreedomState parseFrom(java.io.InputStream input)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return com.google.protobuf.GeneratedMessageV3
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
.parseWithIOException(PARSER, input);
|
.parseWithIOException(PARSER, input);
|
||||||
}
|
}
|
||||||
public static cmvr.api.DexhandCommand.RH56DFTPDexHand parseFrom(
|
public static cmvr.api.DexhandCommand.FreedomState parseFrom(
|
||||||
java.io.InputStream input,
|
java.io.InputStream input,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return com.google.protobuf.GeneratedMessageV3
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||||
}
|
}
|
||||||
public static cmvr.api.DexhandCommand.RH56DFTPDexHand parseDelimitedFrom(java.io.InputStream input)
|
public static cmvr.api.DexhandCommand.FreedomState parseDelimitedFrom(java.io.InputStream input)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return com.google.protobuf.GeneratedMessageV3
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
.parseDelimitedWithIOException(PARSER, input);
|
.parseDelimitedWithIOException(PARSER, input);
|
||||||
}
|
}
|
||||||
public static cmvr.api.DexhandCommand.RH56DFTPDexHand parseDelimitedFrom(
|
public static cmvr.api.DexhandCommand.FreedomState parseDelimitedFrom(
|
||||||
java.io.InputStream input,
|
java.io.InputStream input,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return com.google.protobuf.GeneratedMessageV3
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
|
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
|
||||||
}
|
}
|
||||||
public static cmvr.api.DexhandCommand.RH56DFTPDexHand parseFrom(
|
public static cmvr.api.DexhandCommand.FreedomState parseFrom(
|
||||||
com.google.protobuf.CodedInputStream input)
|
com.google.protobuf.CodedInputStream input)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return com.google.protobuf.GeneratedMessageV3
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
.parseWithIOException(PARSER, input);
|
.parseWithIOException(PARSER, input);
|
||||||
}
|
}
|
||||||
public static cmvr.api.DexhandCommand.RH56DFTPDexHand parseFrom(
|
public static cmvr.api.DexhandCommand.FreedomState parseFrom(
|
||||||
com.google.protobuf.CodedInputStream input,
|
com.google.protobuf.CodedInputStream input,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
@ -1167,7 +1167,7 @@ public final class DexhandCommand {
|
|||||||
public static Builder newBuilder() {
|
public static Builder newBuilder() {
|
||||||
return DEFAULT_INSTANCE.toBuilder();
|
return DEFAULT_INSTANCE.toBuilder();
|
||||||
}
|
}
|
||||||
public static Builder newBuilder(cmvr.api.DexhandCommand.RH56DFTPDexHand prototype) {
|
public static Builder newBuilder(cmvr.api.DexhandCommand.FreedomState prototype) {
|
||||||
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
||||||
}
|
}
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
@ -1183,26 +1183,26 @@ public final class DexhandCommand {
|
|||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Protobuf type {@code cmvr.api.RH56DFTPDexHand}
|
* Protobuf type {@code cmvr.api.FreedomState}
|
||||||
*/
|
*/
|
||||||
public static final class Builder extends
|
public static final class Builder extends
|
||||||
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
||||||
// @@protoc_insertion_point(builder_implements:cmvr.api.RH56DFTPDexHand)
|
// @@protoc_insertion_point(builder_implements:cmvr.api.FreedomState)
|
||||||
cmvr.api.DexhandCommand.RH56DFTPDexHandOrBuilder {
|
cmvr.api.DexhandCommand.FreedomStateOrBuilder {
|
||||||
public static final com.google.protobuf.Descriptors.Descriptor
|
public static final com.google.protobuf.Descriptors.Descriptor
|
||||||
getDescriptor() {
|
getDescriptor() {
|
||||||
return cmvr.api.DexhandCommand.internal_static_cmvr_api_RH56DFTPDexHand_descriptor;
|
return cmvr.api.DexhandCommand.internal_static_cmvr_api_FreedomState_descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
internalGetFieldAccessorTable() {
|
internalGetFieldAccessorTable() {
|
||||||
return cmvr.api.DexhandCommand.internal_static_cmvr_api_RH56DFTPDexHand_fieldAccessorTable
|
return cmvr.api.DexhandCommand.internal_static_cmvr_api_FreedomState_fieldAccessorTable
|
||||||
.ensureFieldAccessorsInitialized(
|
.ensureFieldAccessorsInitialized(
|
||||||
cmvr.api.DexhandCommand.RH56DFTPDexHand.class, cmvr.api.DexhandCommand.RH56DFTPDexHand.Builder.class);
|
cmvr.api.DexhandCommand.FreedomState.class, cmvr.api.DexhandCommand.FreedomState.Builder.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct using cmvr.api.DexhandCommand.RH56DFTPDexHand.newBuilder()
|
// Construct using cmvr.api.DexhandCommand.FreedomState.newBuilder()
|
||||||
private Builder() {
|
private Builder() {
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1239,17 +1239,17 @@ public final class DexhandCommand {
|
|||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public com.google.protobuf.Descriptors.Descriptor
|
public com.google.protobuf.Descriptors.Descriptor
|
||||||
getDescriptorForType() {
|
getDescriptorForType() {
|
||||||
return cmvr.api.DexhandCommand.internal_static_cmvr_api_RH56DFTPDexHand_descriptor;
|
return cmvr.api.DexhandCommand.internal_static_cmvr_api_FreedomState_descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public cmvr.api.DexhandCommand.RH56DFTPDexHand getDefaultInstanceForType() {
|
public cmvr.api.DexhandCommand.FreedomState getDefaultInstanceForType() {
|
||||||
return cmvr.api.DexhandCommand.RH56DFTPDexHand.getDefaultInstance();
|
return cmvr.api.DexhandCommand.FreedomState.getDefaultInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public cmvr.api.DexhandCommand.RH56DFTPDexHand build() {
|
public cmvr.api.DexhandCommand.FreedomState build() {
|
||||||
cmvr.api.DexhandCommand.RH56DFTPDexHand result = buildPartial();
|
cmvr.api.DexhandCommand.FreedomState result = buildPartial();
|
||||||
if (!result.isInitialized()) {
|
if (!result.isInitialized()) {
|
||||||
throw newUninitializedMessageException(result);
|
throw newUninitializedMessageException(result);
|
||||||
}
|
}
|
||||||
@ -1257,8 +1257,8 @@ public final class DexhandCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public cmvr.api.DexhandCommand.RH56DFTPDexHand buildPartial() {
|
public cmvr.api.DexhandCommand.FreedomState buildPartial() {
|
||||||
cmvr.api.DexhandCommand.RH56DFTPDexHand result = new cmvr.api.DexhandCommand.RH56DFTPDexHand(this);
|
cmvr.api.DexhandCommand.FreedomState result = new cmvr.api.DexhandCommand.FreedomState(this);
|
||||||
int from_bitField0_ = bitField0_;
|
int from_bitField0_ = bitField0_;
|
||||||
result.dofId_ = dofId_;
|
result.dofId_ = dofId_;
|
||||||
result.angle_ = angle_;
|
result.angle_ = angle_;
|
||||||
@ -1311,16 +1311,16 @@ public final class DexhandCommand {
|
|||||||
}
|
}
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||||
if (other instanceof cmvr.api.DexhandCommand.RH56DFTPDexHand) {
|
if (other instanceof cmvr.api.DexhandCommand.FreedomState) {
|
||||||
return mergeFrom((cmvr.api.DexhandCommand.RH56DFTPDexHand)other);
|
return mergeFrom((cmvr.api.DexhandCommand.FreedomState)other);
|
||||||
} else {
|
} else {
|
||||||
super.mergeFrom(other);
|
super.mergeFrom(other);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder mergeFrom(cmvr.api.DexhandCommand.RH56DFTPDexHand other) {
|
public Builder mergeFrom(cmvr.api.DexhandCommand.FreedomState other) {
|
||||||
if (other == cmvr.api.DexhandCommand.RH56DFTPDexHand.getDefaultInstance()) return this;
|
if (other == cmvr.api.DexhandCommand.FreedomState.getDefaultInstance()) return this;
|
||||||
if (other.getDofId() != 0) {
|
if (other.getDofId() != 0) {
|
||||||
setDofId(other.getDofId());
|
setDofId(other.getDofId());
|
||||||
}
|
}
|
||||||
@ -1946,23 +1946,23 @@ public final class DexhandCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @@protoc_insertion_point(builder_scope:cmvr.api.RH56DFTPDexHand)
|
// @@protoc_insertion_point(builder_scope:cmvr.api.FreedomState)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @@protoc_insertion_point(class_scope:cmvr.api.RH56DFTPDexHand)
|
// @@protoc_insertion_point(class_scope:cmvr.api.FreedomState)
|
||||||
private static final cmvr.api.DexhandCommand.RH56DFTPDexHand DEFAULT_INSTANCE;
|
private static final cmvr.api.DexhandCommand.FreedomState DEFAULT_INSTANCE;
|
||||||
static {
|
static {
|
||||||
DEFAULT_INSTANCE = new cmvr.api.DexhandCommand.RH56DFTPDexHand();
|
DEFAULT_INSTANCE = new cmvr.api.DexhandCommand.FreedomState();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static cmvr.api.DexhandCommand.RH56DFTPDexHand getDefaultInstance() {
|
public static cmvr.api.DexhandCommand.FreedomState getDefaultInstance() {
|
||||||
return DEFAULT_INSTANCE;
|
return DEFAULT_INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final com.google.protobuf.Parser<RH56DFTPDexHand>
|
private static final com.google.protobuf.Parser<FreedomState>
|
||||||
PARSER = new com.google.protobuf.AbstractParser<RH56DFTPDexHand>() {
|
PARSER = new com.google.protobuf.AbstractParser<FreedomState>() {
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public RH56DFTPDexHand parsePartialFrom(
|
public FreedomState parsePartialFrom(
|
||||||
com.google.protobuf.CodedInputStream input,
|
com.google.protobuf.CodedInputStream input,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
@ -1981,17 +1981,17 @@ public final class DexhandCommand {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static com.google.protobuf.Parser<RH56DFTPDexHand> parser() {
|
public static com.google.protobuf.Parser<FreedomState> parser() {
|
||||||
return PARSER;
|
return PARSER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public com.google.protobuf.Parser<RH56DFTPDexHand> getParserForType() {
|
public com.google.protobuf.Parser<FreedomState> getParserForType() {
|
||||||
return PARSER;
|
return PARSER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public cmvr.api.DexhandCommand.RH56DFTPDexHand getDefaultInstanceForType() {
|
public cmvr.api.DexhandCommand.FreedomState getDefaultInstanceForType() {
|
||||||
return DEFAULT_INSTANCE;
|
return DEFAULT_INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4577,24 +4577,24 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
java.util.List<cmvr.api.DexhandCommand.RH56DFTPDexHand>
|
java.util.List<cmvr.api.DexhandCommand.FreedomState>
|
||||||
getHandsList();
|
getHandsList();
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
cmvr.api.DexhandCommand.RH56DFTPDexHand getHands(int index);
|
cmvr.api.DexhandCommand.FreedomState getHands(int index);
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
int getHandsCount();
|
int getHandsCount();
|
||||||
/**
|
/**
|
||||||
@ -4602,18 +4602,18 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
java.util.List<? extends cmvr.api.DexhandCommand.RH56DFTPDexHandOrBuilder>
|
java.util.List<? extends cmvr.api.DexhandCommand.FreedomStateOrBuilder>
|
||||||
getHandsOrBuilderList();
|
getHandsOrBuilderList();
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
cmvr.api.DexhandCommand.RH56DFTPDexHandOrBuilder getHandsOrBuilder(
|
cmvr.api.DexhandCommand.FreedomStateOrBuilder getHandsOrBuilder(
|
||||||
int index);
|
int index);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -4673,16 +4673,16 @@ public final class DexhandCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static final int HANDS_FIELD_NUMBER = 2;
|
public static final int HANDS_FIELD_NUMBER = 2;
|
||||||
private java.util.List<cmvr.api.DexhandCommand.RH56DFTPDexHand> hands_;
|
private java.util.List<cmvr.api.DexhandCommand.FreedomState> hands_;
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public java.util.List<cmvr.api.DexhandCommand.RH56DFTPDexHand> getHandsList() {
|
public java.util.List<cmvr.api.DexhandCommand.FreedomState> getHandsList() {
|
||||||
return hands_;
|
return hands_;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -4690,10 +4690,10 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public java.util.List<? extends cmvr.api.DexhandCommand.RH56DFTPDexHandOrBuilder>
|
public java.util.List<? extends cmvr.api.DexhandCommand.FreedomStateOrBuilder>
|
||||||
getHandsOrBuilderList() {
|
getHandsOrBuilderList() {
|
||||||
return hands_;
|
return hands_;
|
||||||
}
|
}
|
||||||
@ -4702,7 +4702,7 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public int getHandsCount() {
|
public int getHandsCount() {
|
||||||
@ -4713,10 +4713,10 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public cmvr.api.DexhandCommand.RH56DFTPDexHand getHands(int index) {
|
public cmvr.api.DexhandCommand.FreedomState getHands(int index) {
|
||||||
return hands_.get(index);
|
return hands_.get(index);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -4724,10 +4724,10 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
@java.lang.Override
|
@java.lang.Override
|
||||||
public cmvr.api.DexhandCommand.RH56DFTPDexHandOrBuilder getHandsOrBuilder(
|
public cmvr.api.DexhandCommand.FreedomStateOrBuilder getHandsOrBuilder(
|
||||||
int index) {
|
int index) {
|
||||||
return hands_.get(index);
|
return hands_.get(index);
|
||||||
}
|
}
|
||||||
@ -5089,9 +5089,9 @@ public final class DexhandCommand {
|
|||||||
break;
|
break;
|
||||||
} // case 8
|
} // case 8
|
||||||
case 18: {
|
case 18: {
|
||||||
cmvr.api.DexhandCommand.RH56DFTPDexHand m =
|
cmvr.api.DexhandCommand.FreedomState m =
|
||||||
input.readMessage(
|
input.readMessage(
|
||||||
cmvr.api.DexhandCommand.RH56DFTPDexHand.parser(),
|
cmvr.api.DexhandCommand.FreedomState.parser(),
|
||||||
extensionRegistry);
|
extensionRegistry);
|
||||||
if (handsBuilder_ == null) {
|
if (handsBuilder_ == null) {
|
||||||
ensureHandsIsMutable();
|
ensureHandsIsMutable();
|
||||||
@ -5161,26 +5161,26 @@ public final class DexhandCommand {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private java.util.List<cmvr.api.DexhandCommand.RH56DFTPDexHand> hands_ =
|
private java.util.List<cmvr.api.DexhandCommand.FreedomState> hands_ =
|
||||||
java.util.Collections.emptyList();
|
java.util.Collections.emptyList();
|
||||||
private void ensureHandsIsMutable() {
|
private void ensureHandsIsMutable() {
|
||||||
if (!((bitField0_ & 0x00000001) != 0)) {
|
if (!((bitField0_ & 0x00000001) != 0)) {
|
||||||
hands_ = new java.util.ArrayList<cmvr.api.DexhandCommand.RH56DFTPDexHand>(hands_);
|
hands_ = new java.util.ArrayList<cmvr.api.DexhandCommand.FreedomState>(hands_);
|
||||||
bitField0_ |= 0x00000001;
|
bitField0_ |= 0x00000001;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private com.google.protobuf.RepeatedFieldBuilderV3<
|
private com.google.protobuf.RepeatedFieldBuilderV3<
|
||||||
cmvr.api.DexhandCommand.RH56DFTPDexHand, cmvr.api.DexhandCommand.RH56DFTPDexHand.Builder, cmvr.api.DexhandCommand.RH56DFTPDexHandOrBuilder> handsBuilder_;
|
cmvr.api.DexhandCommand.FreedomState, cmvr.api.DexhandCommand.FreedomState.Builder, cmvr.api.DexhandCommand.FreedomStateOrBuilder> handsBuilder_;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public java.util.List<cmvr.api.DexhandCommand.RH56DFTPDexHand> getHandsList() {
|
public java.util.List<cmvr.api.DexhandCommand.FreedomState> getHandsList() {
|
||||||
if (handsBuilder_ == null) {
|
if (handsBuilder_ == null) {
|
||||||
return java.util.Collections.unmodifiableList(hands_);
|
return java.util.Collections.unmodifiableList(hands_);
|
||||||
} else {
|
} else {
|
||||||
@ -5192,7 +5192,7 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public int getHandsCount() {
|
public int getHandsCount() {
|
||||||
if (handsBuilder_ == null) {
|
if (handsBuilder_ == null) {
|
||||||
@ -5206,9 +5206,9 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public cmvr.api.DexhandCommand.RH56DFTPDexHand getHands(int index) {
|
public cmvr.api.DexhandCommand.FreedomState getHands(int index) {
|
||||||
if (handsBuilder_ == null) {
|
if (handsBuilder_ == null) {
|
||||||
return hands_.get(index);
|
return hands_.get(index);
|
||||||
} else {
|
} else {
|
||||||
@ -5220,10 +5220,10 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public Builder setHands(
|
public Builder setHands(
|
||||||
int index, cmvr.api.DexhandCommand.RH56DFTPDexHand value) {
|
int index, cmvr.api.DexhandCommand.FreedomState value) {
|
||||||
if (handsBuilder_ == null) {
|
if (handsBuilder_ == null) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
throw new NullPointerException();
|
throw new NullPointerException();
|
||||||
@ -5241,10 +5241,10 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public Builder setHands(
|
public Builder setHands(
|
||||||
int index, cmvr.api.DexhandCommand.RH56DFTPDexHand.Builder builderForValue) {
|
int index, cmvr.api.DexhandCommand.FreedomState.Builder builderForValue) {
|
||||||
if (handsBuilder_ == null) {
|
if (handsBuilder_ == null) {
|
||||||
ensureHandsIsMutable();
|
ensureHandsIsMutable();
|
||||||
hands_.set(index, builderForValue.build());
|
hands_.set(index, builderForValue.build());
|
||||||
@ -5259,9 +5259,9 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public Builder addHands(cmvr.api.DexhandCommand.RH56DFTPDexHand value) {
|
public Builder addHands(cmvr.api.DexhandCommand.FreedomState value) {
|
||||||
if (handsBuilder_ == null) {
|
if (handsBuilder_ == null) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
throw new NullPointerException();
|
throw new NullPointerException();
|
||||||
@ -5279,10 +5279,10 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public Builder addHands(
|
public Builder addHands(
|
||||||
int index, cmvr.api.DexhandCommand.RH56DFTPDexHand value) {
|
int index, cmvr.api.DexhandCommand.FreedomState value) {
|
||||||
if (handsBuilder_ == null) {
|
if (handsBuilder_ == null) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
throw new NullPointerException();
|
throw new NullPointerException();
|
||||||
@ -5300,10 +5300,10 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public Builder addHands(
|
public Builder addHands(
|
||||||
cmvr.api.DexhandCommand.RH56DFTPDexHand.Builder builderForValue) {
|
cmvr.api.DexhandCommand.FreedomState.Builder builderForValue) {
|
||||||
if (handsBuilder_ == null) {
|
if (handsBuilder_ == null) {
|
||||||
ensureHandsIsMutable();
|
ensureHandsIsMutable();
|
||||||
hands_.add(builderForValue.build());
|
hands_.add(builderForValue.build());
|
||||||
@ -5318,10 +5318,10 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public Builder addHands(
|
public Builder addHands(
|
||||||
int index, cmvr.api.DexhandCommand.RH56DFTPDexHand.Builder builderForValue) {
|
int index, cmvr.api.DexhandCommand.FreedomState.Builder builderForValue) {
|
||||||
if (handsBuilder_ == null) {
|
if (handsBuilder_ == null) {
|
||||||
ensureHandsIsMutable();
|
ensureHandsIsMutable();
|
||||||
hands_.add(index, builderForValue.build());
|
hands_.add(index, builderForValue.build());
|
||||||
@ -5336,10 +5336,10 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public Builder addAllHands(
|
public Builder addAllHands(
|
||||||
java.lang.Iterable<? extends cmvr.api.DexhandCommand.RH56DFTPDexHand> values) {
|
java.lang.Iterable<? extends cmvr.api.DexhandCommand.FreedomState> values) {
|
||||||
if (handsBuilder_ == null) {
|
if (handsBuilder_ == null) {
|
||||||
ensureHandsIsMutable();
|
ensureHandsIsMutable();
|
||||||
com.google.protobuf.AbstractMessageLite.Builder.addAll(
|
com.google.protobuf.AbstractMessageLite.Builder.addAll(
|
||||||
@ -5355,7 +5355,7 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public Builder clearHands() {
|
public Builder clearHands() {
|
||||||
if (handsBuilder_ == null) {
|
if (handsBuilder_ == null) {
|
||||||
@ -5372,7 +5372,7 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public Builder removeHands(int index) {
|
public Builder removeHands(int index) {
|
||||||
if (handsBuilder_ == null) {
|
if (handsBuilder_ == null) {
|
||||||
@ -5389,9 +5389,9 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public cmvr.api.DexhandCommand.RH56DFTPDexHand.Builder getHandsBuilder(
|
public cmvr.api.DexhandCommand.FreedomState.Builder getHandsBuilder(
|
||||||
int index) {
|
int index) {
|
||||||
return getHandsFieldBuilder().getBuilder(index);
|
return getHandsFieldBuilder().getBuilder(index);
|
||||||
}
|
}
|
||||||
@ -5400,9 +5400,9 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public cmvr.api.DexhandCommand.RH56DFTPDexHandOrBuilder getHandsOrBuilder(
|
public cmvr.api.DexhandCommand.FreedomStateOrBuilder getHandsOrBuilder(
|
||||||
int index) {
|
int index) {
|
||||||
if (handsBuilder_ == null) {
|
if (handsBuilder_ == null) {
|
||||||
return hands_.get(index); } else {
|
return hands_.get(index); } else {
|
||||||
@ -5414,9 +5414,9 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public java.util.List<? extends cmvr.api.DexhandCommand.RH56DFTPDexHandOrBuilder>
|
public java.util.List<? extends cmvr.api.DexhandCommand.FreedomStateOrBuilder>
|
||||||
getHandsOrBuilderList() {
|
getHandsOrBuilderList() {
|
||||||
if (handsBuilder_ != null) {
|
if (handsBuilder_ != null) {
|
||||||
return handsBuilder_.getMessageOrBuilderList();
|
return handsBuilder_.getMessageOrBuilderList();
|
||||||
@ -5429,41 +5429,41 @@ public final class DexhandCommand {
|
|||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public cmvr.api.DexhandCommand.RH56DFTPDexHand.Builder addHandsBuilder() {
|
public cmvr.api.DexhandCommand.FreedomState.Builder addHandsBuilder() {
|
||||||
return getHandsFieldBuilder().addBuilder(
|
return getHandsFieldBuilder().addBuilder(
|
||||||
cmvr.api.DexhandCommand.RH56DFTPDexHand.getDefaultInstance());
|
cmvr.api.DexhandCommand.FreedomState.getDefaultInstance());
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public cmvr.api.DexhandCommand.RH56DFTPDexHand.Builder addHandsBuilder(
|
public cmvr.api.DexhandCommand.FreedomState.Builder addHandsBuilder(
|
||||||
int index) {
|
int index) {
|
||||||
return getHandsFieldBuilder().addBuilder(
|
return getHandsFieldBuilder().addBuilder(
|
||||||
index, cmvr.api.DexhandCommand.RH56DFTPDexHand.getDefaultInstance());
|
index, cmvr.api.DexhandCommand.FreedomState.getDefaultInstance());
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 包含多个自由度状态
|
* 包含多个自由度状态
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <code>repeated .cmvr.api.RH56DFTPDexHand hands = 2;</code>
|
* <code>repeated .cmvr.api.FreedomState hands = 2;</code>
|
||||||
*/
|
*/
|
||||||
public java.util.List<cmvr.api.DexhandCommand.RH56DFTPDexHand.Builder>
|
public java.util.List<cmvr.api.DexhandCommand.FreedomState.Builder>
|
||||||
getHandsBuilderList() {
|
getHandsBuilderList() {
|
||||||
return getHandsFieldBuilder().getBuilderList();
|
return getHandsFieldBuilder().getBuilderList();
|
||||||
}
|
}
|
||||||
private com.google.protobuf.RepeatedFieldBuilderV3<
|
private com.google.protobuf.RepeatedFieldBuilderV3<
|
||||||
cmvr.api.DexhandCommand.RH56DFTPDexHand, cmvr.api.DexhandCommand.RH56DFTPDexHand.Builder, cmvr.api.DexhandCommand.RH56DFTPDexHandOrBuilder>
|
cmvr.api.DexhandCommand.FreedomState, cmvr.api.DexhandCommand.FreedomState.Builder, cmvr.api.DexhandCommand.FreedomStateOrBuilder>
|
||||||
getHandsFieldBuilder() {
|
getHandsFieldBuilder() {
|
||||||
if (handsBuilder_ == null) {
|
if (handsBuilder_ == null) {
|
||||||
handsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
|
handsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
|
||||||
cmvr.api.DexhandCommand.RH56DFTPDexHand, cmvr.api.DexhandCommand.RH56DFTPDexHand.Builder, cmvr.api.DexhandCommand.RH56DFTPDexHandOrBuilder>(
|
cmvr.api.DexhandCommand.FreedomState, cmvr.api.DexhandCommand.FreedomState.Builder, cmvr.api.DexhandCommand.FreedomStateOrBuilder>(
|
||||||
hands_,
|
hands_,
|
||||||
((bitField0_ & 0x00000001) != 0),
|
((bitField0_ & 0x00000001) != 0),
|
||||||
getParentForChildren(),
|
getParentForChildren(),
|
||||||
@ -21035,10 +21035,10 @@ public final class DexhandCommand {
|
|||||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
internal_static_cmvr_api_FreedomValue_fieldAccessorTable;
|
internal_static_cmvr_api_FreedomValue_fieldAccessorTable;
|
||||||
private static final com.google.protobuf.Descriptors.Descriptor
|
private static final com.google.protobuf.Descriptors.Descriptor
|
||||||
internal_static_cmvr_api_RH56DFTPDexHand_descriptor;
|
internal_static_cmvr_api_FreedomState_descriptor;
|
||||||
private static final
|
private static final
|
||||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
internal_static_cmvr_api_RH56DFTPDexHand_fieldAccessorTable;
|
internal_static_cmvr_api_FreedomState_fieldAccessorTable;
|
||||||
private static final com.google.protobuf.Descriptors.Descriptor
|
private static final com.google.protobuf.Descriptors.Descriptor
|
||||||
internal_static_cmvr_api_SensorData_descriptor;
|
internal_static_cmvr_api_SensorData_descriptor;
|
||||||
private static final
|
private static final
|
||||||
@ -21185,61 +21185,61 @@ public final class DexhandCommand {
|
|||||||
java.lang.String[] descriptorData = {
|
java.lang.String[] descriptorData = {
|
||||||
"\n\036cmvr/api/dexhand_command.proto\022\010cmvr.a" +
|
"\n\036cmvr/api/dexhand_command.proto\022\010cmvr.a" +
|
||||||
"pi\032\025cmvr/api/common.proto\")\n\014FreedomValu" +
|
"pi\032\025cmvr/api/common.proto\")\n\014FreedomValu" +
|
||||||
"e\022\n\n\002id\030\001 \001(\005\022\r\n\005value\030\002 \001(\002\"\254\001\n\017RH56DFT" +
|
"e\022\n\n\002id\030\001 \001(\005\022\r\n\005value\030\002 \001(\002\"\251\001\n\014Freedom" +
|
||||||
"PDexHand\022\016\n\006dof_id\030\001 \001(\005\022\r\n\005angle\030\002 \001(\005\022" +
|
"State\022\016\n\006dof_id\030\001 \001(\005\022\r\n\005angle\030\002 \001(\005\022\r\n\005" +
|
||||||
"\r\n\005speed\030\003 \001(\005\022\r\n\005force\030\004 \001(\005\022\020\n\010positio" +
|
"speed\030\003 \001(\005\022\r\n\005force\030\004 \001(\005\022\020\n\010position\030\005" +
|
||||||
"n\030\005 \001(\005\022\017\n\007current\030\006 \001(\005\022\023\n\013temperature\030" +
|
" \001(\005\022\017\n\007current\030\006 \001(\005\022\023\n\013temperature\030\007 \001" +
|
||||||
"\007 \001(\005\022\r\n\005error\030\010 \001(\005\022\025\n\rerror_message\030\t " +
|
"(\005\022\r\n\005error\030\010 \001(\005\022\025\n\rerror_message\030\t \003(\t" +
|
||||||
"\003(\t\"\220\003\n\nSensorData\0224\n\013finger_type\030\004 \001(\0162" +
|
"\"\220\003\n\nSensorData\0224\n\013finger_type\030\004 \001(\0162\037.c" +
|
||||||
"\037.cmvr.api.SensorData.FingerType\0220\n\tpart" +
|
"mvr.api.SensorData.FingerType\0220\n\tpart_ty" +
|
||||||
"_type\030\005 \001(\0162\035.cmvr.api.SensorData.PartTy" +
|
"pe\030\005 \001(\0162\035.cmvr.api.SensorData.PartType\022" +
|
||||||
"pe\022\023\n\013sensor_name\030\006 \001(\t\022*\n\004data\030\001 \003(\0132\034." +
|
"\023\n\013sensor_name\030\006 \001(\t\022*\n\004data\030\001 \003(\0132\034.cmv" +
|
||||||
"cmvr.api.SensorData.RowData\022\014\n\004rows\030\002 \001(" +
|
"r.api.SensorData.RowData\022\014\n\004rows\030\002 \001(\005\022\014" +
|
||||||
"\005\022\014\n\004cols\030\003 \001(\005\032\035\n\007RowData\022\022\n\006values\030\001 \003" +
|
"\n\004cols\030\003 \001(\005\032\035\n\007RowData\022\022\n\006values\030\001 \003(\005B" +
|
||||||
"(\005B\002\020\001\"T\n\nFingerType\022\t\n\005PINKY\020\000\022\010\n\004RING\020" +
|
"\002\020\001\"T\n\nFingerType\022\t\n\005PINKY\020\000\022\010\n\004RING\020\001\022\021" +
|
||||||
"\001\022\021\n\rMIDDLE_FINGER\020\002\022\t\n\005INDEX\020\003\022\t\n\005THUMB" +
|
"\n\rMIDDLE_FINGER\020\002\022\t\n\005INDEX\020\003\022\t\n\005THUMB\020\004\022" +
|
||||||
"\020\004\022\010\n\004PALM\020\005\"H\n\010PartType\022\007\n\003TIP\020\000\022\n\n\006FIN" +
|
"\010\n\004PALM\020\005\"H\n\010PartType\022\007\n\003TIP\020\000\022\n\n\006FINGER" +
|
||||||
"GER\020\001\022\007\n\003PAD\020\002\022\020\n\014THUMB_MIDDLE\020\003\022\014\n\010PALM" +
|
"\020\001\022\007\n\003PAD\020\002\022\020\n\014THUMB_MIDDLE\020\003\022\014\n\010PALM_PA" +
|
||||||
"_PAD\020\004\"P\n\014DexHandState\022\026\n\016is_initialized" +
|
"D\020\004\"M\n\014DexHandState\022\026\n\016is_initialized\030\001 " +
|
||||||
"\030\001 \001(\010\022(\n\005hands\030\002 \003(\0132\031.cmvr.api.RH56DFT" +
|
"\001(\010\022%\n\005hands\030\002 \003(\0132\026.cmvr.api.FreedomSta" +
|
||||||
"PDexHand\"\271\001\n\026GetDexHandStateCommand\032:\n\007R" +
|
"te\"\271\001\n\026GetDexHandStateCommand\032:\n\007Request" +
|
||||||
"equest\022/\n\006header\030\001 \001(\0132\037.cmvr.api.Comman" +
|
"\022/\n\006header\030\001 \001(\0132\037.cmvr.api.CommandHeade" +
|
||||||
"dHeader.Request\032c\n\010Feedback\0220\n\006header\030\001 " +
|
"r.Request\032c\n\010Feedback\0220\n\006header\030\001 \001(\0132 ." +
|
||||||
"\001(\0132 .cmvr.api.CommandHeader.Feedback\022%\n" +
|
"cmvr.api.CommandHeader.Feedback\022%\n\005state" +
|
||||||
"\005state\030\002 \001(\0132\026.cmvr.api.DexHandState\"\276\001\n" +
|
"\030\002 \001(\0132\026.cmvr.api.DexHandState\"\276\001\n\032SetDe" +
|
||||||
"\032SetDexHandPositionsCommand\032b\n\007Request\022/" +
|
"xHandPositionsCommand\032b\n\007Request\022/\n\006head" +
|
||||||
"\n\006header\030\001 \001(\0132\037.cmvr.api.CommandHeader." +
|
"er\030\001 \001(\0132\037.cmvr.api.CommandHeader.Reques" +
|
||||||
"Request\022&\n\006values\030\002 \003(\0132\026.cmvr.api.Freed" +
|
"t\022&\n\006values\030\002 \003(\0132\026.cmvr.api.FreedomValu" +
|
||||||
"omValue\032<\n\010Feedback\0220\n\006header\030\001 \001(\0132 .cm" +
|
"e\032<\n\010Feedback\0220\n\006header\030\001 \001(\0132 .cmvr.api" +
|
||||||
"vr.api.CommandHeader.Feedback\"\273\001\n\027SetDex" +
|
".CommandHeader.Feedback\"\273\001\n\027SetDexHandAn" +
|
||||||
"HandAnglesCommand\032b\n\007Request\022/\n\006header\030\001" +
|
"glesCommand\032b\n\007Request\022/\n\006header\030\001 \001(\0132\037" +
|
||||||
" \001(\0132\037.cmvr.api.CommandHeader.Request\022&\n" +
|
".cmvr.api.CommandHeader.Request\022&\n\006value" +
|
||||||
"\006values\030\002 \003(\0132\026.cmvr.api.FreedomValue\032<\n" +
|
"s\030\002 \003(\0132\026.cmvr.api.FreedomValue\032<\n\010Feedb" +
|
||||||
"\010Feedback\0220\n\006header\030\001 \001(\0132 .cmvr.api.Com" +
|
"ack\0220\n\006header\030\001 \001(\0132 .cmvr.api.CommandHe" +
|
||||||
"mandHeader.Feedback\"\272\001\n\026SetDexHandForceC" +
|
"ader.Feedback\"\272\001\n\026SetDexHandForceCommand" +
|
||||||
"ommand\032b\n\007Request\022/\n\006header\030\001 \001(\0132\037.cmvr" +
|
"\032b\n\007Request\022/\n\006header\030\001 \001(\0132\037.cmvr.api.C" +
|
||||||
".api.CommandHeader.Request\022&\n\006values\030\002 \003" +
|
"ommandHeader.Request\022&\n\006values\030\002 \003(\0132\026.c" +
|
||||||
"(\0132\026.cmvr.api.FreedomValue\032<\n\010Feedback\0220" +
|
"mvr.api.FreedomValue\032<\n\010Feedback\0220\n\006head" +
|
||||||
"\n\006header\030\001 \001(\0132 .cmvr.api.CommandHeader." +
|
"er\030\001 \001(\0132 .cmvr.api.CommandHeader.Feedba" +
|
||||||
"Feedback\"\272\001\n\026SetDexHandSpeedCommand\032b\n\007R" +
|
"ck\"\272\001\n\026SetDexHandSpeedCommand\032b\n\007Request" +
|
||||||
"equest\022/\n\006header\030\001 \001(\0132\037.cmvr.api.Comman" +
|
"\022/\n\006header\030\001 \001(\0132\037.cmvr.api.CommandHeade" +
|
||||||
"dHeader.Request\022&\n\006values\030\002 \003(\0132\026.cmvr.a" +
|
"r.Request\022&\n\006values\030\002 \003(\0132\026.cmvr.api.Fre" +
|
||||||
"pi.FreedomValue\032<\n\010Feedback\0220\n\006header\030\001 " +
|
"edomValue\032<\n\010Feedback\0220\n\006header\030\001 \001(\0132 ." +
|
||||||
"\001(\0132 .cmvr.api.CommandHeader.Feedback\"\253\001" +
|
"cmvr.api.CommandHeader.Feedback\"\253\001\n\032SetD" +
|
||||||
"\n\032SetDexHandPresetActCommand\032O\n\007Request\022" +
|
"exHandPresetActCommand\032O\n\007Request\022/\n\006hea" +
|
||||||
"/\n\006header\030\001 \001(\0132\037.cmvr.api.CommandHeader" +
|
"der\030\001 \001(\0132\037.cmvr.api.CommandHeader.Reque" +
|
||||||
".Request\022\023\n\013presetActId\030\002 \001(\005\032<\n\010Feedbac" +
|
"st\022\023\n\013presetActId\030\002 \001(\005\032<\n\010Feedback\0220\n\006h" +
|
||||||
"k\0220\n\006header\030\001 \001(\0132 .cmvr.api.CommandHead" +
|
"eader\030\001 \001(\0132 .cmvr.api.CommandHeader.Fee" +
|
||||||
"er.Feedback\"\266\001\n\024GetSensorDataCommand\032:\n\007" +
|
"dback\"\266\001\n\024GetSensorDataCommand\032:\n\007Reques" +
|
||||||
"Request\022/\n\006header\030\001 \001(\0132\037.cmvr.api.Comma" +
|
"t\022/\n\006header\030\001 \001(\0132\037.cmvr.api.CommandHead" +
|
||||||
"ndHeader.Request\032b\n\010Feedback\0220\n\006header\030\001" +
|
"er.Request\032b\n\010Feedback\0220\n\006header\030\001 \001(\0132 " +
|
||||||
" \001(\0132 .cmvr.api.CommandHeader.Feedback\022$" +
|
".cmvr.api.CommandHeader.Feedback\022$\n\006sens" +
|
||||||
"\n\006sensor\030\002 \003(\0132\024.cmvr.api.SensorData\"\274\001\n" +
|
"or\030\002 \003(\0132\024.cmvr.api.SensorData\"\274\001\n\032GetSe" +
|
||||||
"\032GetSensorDataStreamCommand\032:\n\007Request\022/" +
|
"nsorDataStreamCommand\032:\n\007Request\022/\n\006head" +
|
||||||
"\n\006header\030\001 \001(\0132\037.cmvr.api.CommandHeader." +
|
"er\030\001 \001(\0132\037.cmvr.api.CommandHeader.Reques" +
|
||||||
"Request\032b\n\010Feedback\0220\n\006header\030\001 \001(\0132 .cm" +
|
"t\032b\n\010Feedback\0220\n\006header\030\001 \001(\0132 .cmvr.api" +
|
||||||
"vr.api.CommandHeader.Feedback\022$\n\006sensor\030" +
|
".CommandHeader.Feedback\022$\n\006sensor\030\002 \003(\0132" +
|
||||||
"\002 \003(\0132\024.cmvr.api.SensorDatab\006proto3"
|
"\024.cmvr.api.SensorDatab\006proto3"
|
||||||
};
|
};
|
||||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
.internalBuildGeneratedFileFrom(descriptorData,
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
@ -21252,11 +21252,11 @@ public final class DexhandCommand {
|
|||||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||||
internal_static_cmvr_api_FreedomValue_descriptor,
|
internal_static_cmvr_api_FreedomValue_descriptor,
|
||||||
new java.lang.String[] { "Id", "Value", });
|
new java.lang.String[] { "Id", "Value", });
|
||||||
internal_static_cmvr_api_RH56DFTPDexHand_descriptor =
|
internal_static_cmvr_api_FreedomState_descriptor =
|
||||||
getDescriptor().getMessageTypes().get(1);
|
getDescriptor().getMessageTypes().get(1);
|
||||||
internal_static_cmvr_api_RH56DFTPDexHand_fieldAccessorTable = new
|
internal_static_cmvr_api_FreedomState_fieldAccessorTable = new
|
||||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||||
internal_static_cmvr_api_RH56DFTPDexHand_descriptor,
|
internal_static_cmvr_api_FreedomState_descriptor,
|
||||||
new java.lang.String[] { "DofId", "Angle", "Speed", "Force", "Position", "Current", "Temperature", "Error", "ErrorMessage", });
|
new java.lang.String[] { "DofId", "Angle", "Speed", "Force", "Position", "Current", "Temperature", "Error", "ErrorMessage", });
|
||||||
internal_static_cmvr_api_SensorData_descriptor =
|
internal_static_cmvr_api_SensorData_descriptor =
|
||||||
getDescriptor().getMessageTypes().get(2);
|
getDescriptor().getMessageTypes().get(2);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,836 @@
|
|||||||
|
package cmvr.api;
|
||||||
|
|
||||||
|
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
@javax.annotation.Generated(
|
||||||
|
value = "by gRPC proto compiler (version 1.52.0)",
|
||||||
|
comments = "Source: cmvr/api/motor_service.proto")
|
||||||
|
@io.grpc.stub.annotations.GrpcGenerated
|
||||||
|
public final class MotorServiceGrpc {
|
||||||
|
|
||||||
|
private MotorServiceGrpc() {}
|
||||||
|
|
||||||
|
public static final String SERVICE_NAME = "cmvr.api.MotorService";
|
||||||
|
|
||||||
|
// Static method descriptors that strictly reflect the proto.
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MotorCommand.SetMotorZeroRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse> getSetZeroMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "setZero",
|
||||||
|
requestType = cmvr.api.MotorCommand.SetMotorZeroRequest.class,
|
||||||
|
responseType = cmvr.api.MotorCommand.MotorCommandResponse.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MotorCommand.SetMotorZeroRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse> getSetZeroMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MotorCommand.SetMotorZeroRequest, cmvr.api.MotorCommand.MotorCommandResponse> getSetZeroMethod;
|
||||||
|
if ((getSetZeroMethod = MotorServiceGrpc.getSetZeroMethod) == null) {
|
||||||
|
synchronized (MotorServiceGrpc.class) {
|
||||||
|
if ((getSetZeroMethod = MotorServiceGrpc.getSetZeroMethod) == null) {
|
||||||
|
MotorServiceGrpc.getSetZeroMethod = getSetZeroMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MotorCommand.SetMotorZeroRequest, cmvr.api.MotorCommand.MotorCommandResponse>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "setZero"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.SetMotorZeroRequest.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MotorServiceMethodDescriptorSupplier("setZero"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getSetZeroMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MotorCommand.MoveMotorToZeroRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse> getMoveToZeroMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "moveToZero",
|
||||||
|
requestType = cmvr.api.MotorCommand.MoveMotorToZeroRequest.class,
|
||||||
|
responseType = cmvr.api.MotorCommand.MotorCommandResponse.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MotorCommand.MoveMotorToZeroRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse> getMoveToZeroMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MotorCommand.MoveMotorToZeroRequest, cmvr.api.MotorCommand.MotorCommandResponse> getMoveToZeroMethod;
|
||||||
|
if ((getMoveToZeroMethod = MotorServiceGrpc.getMoveToZeroMethod) == null) {
|
||||||
|
synchronized (MotorServiceGrpc.class) {
|
||||||
|
if ((getMoveToZeroMethod = MotorServiceGrpc.getMoveToZeroMethod) == null) {
|
||||||
|
MotorServiceGrpc.getMoveToZeroMethod = getMoveToZeroMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MotorCommand.MoveMotorToZeroRequest, cmvr.api.MotorCommand.MotorCommandResponse>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "moveToZero"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.MoveMotorToZeroRequest.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MotorServiceMethodDescriptorSupplier("moveToZero"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getMoveToZeroMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MotorCommand.ProfilePositionRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse> getProfilePositionMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "profilePosition",
|
||||||
|
requestType = cmvr.api.MotorCommand.ProfilePositionRequest.class,
|
||||||
|
responseType = cmvr.api.MotorCommand.MotorCommandResponse.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MotorCommand.ProfilePositionRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse> getProfilePositionMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MotorCommand.ProfilePositionRequest, cmvr.api.MotorCommand.MotorCommandResponse> getProfilePositionMethod;
|
||||||
|
if ((getProfilePositionMethod = MotorServiceGrpc.getProfilePositionMethod) == null) {
|
||||||
|
synchronized (MotorServiceGrpc.class) {
|
||||||
|
if ((getProfilePositionMethod = MotorServiceGrpc.getProfilePositionMethod) == null) {
|
||||||
|
MotorServiceGrpc.getProfilePositionMethod = getProfilePositionMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MotorCommand.ProfilePositionRequest, cmvr.api.MotorCommand.MotorCommandResponse>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "profilePosition"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.ProfilePositionRequest.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MotorServiceMethodDescriptorSupplier("profilePosition"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getProfilePositionMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MotorCommand.ProfileVelocityRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse> getProfileVelocityMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "profileVelocity",
|
||||||
|
requestType = cmvr.api.MotorCommand.ProfileVelocityRequest.class,
|
||||||
|
responseType = cmvr.api.MotorCommand.MotorCommandResponse.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MotorCommand.ProfileVelocityRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse> getProfileVelocityMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MotorCommand.ProfileVelocityRequest, cmvr.api.MotorCommand.MotorCommandResponse> getProfileVelocityMethod;
|
||||||
|
if ((getProfileVelocityMethod = MotorServiceGrpc.getProfileVelocityMethod) == null) {
|
||||||
|
synchronized (MotorServiceGrpc.class) {
|
||||||
|
if ((getProfileVelocityMethod = MotorServiceGrpc.getProfileVelocityMethod) == null) {
|
||||||
|
MotorServiceGrpc.getProfileVelocityMethod = getProfileVelocityMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MotorCommand.ProfileVelocityRequest, cmvr.api.MotorCommand.MotorCommandResponse>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "profileVelocity"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.ProfileVelocityRequest.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MotorServiceMethodDescriptorSupplier("profileVelocity"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getProfileVelocityMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MotorCommand.CyclicPositionRequest,
|
||||||
|
cmvr.api.MotorCommand.CyclicControlResponse> getStreamCyclicPositionMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "streamCyclicPosition",
|
||||||
|
requestType = cmvr.api.MotorCommand.CyclicPositionRequest.class,
|
||||||
|
responseType = cmvr.api.MotorCommand.CyclicControlResponse.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MotorCommand.CyclicPositionRequest,
|
||||||
|
cmvr.api.MotorCommand.CyclicControlResponse> getStreamCyclicPositionMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MotorCommand.CyclicPositionRequest, cmvr.api.MotorCommand.CyclicControlResponse> getStreamCyclicPositionMethod;
|
||||||
|
if ((getStreamCyclicPositionMethod = MotorServiceGrpc.getStreamCyclicPositionMethod) == null) {
|
||||||
|
synchronized (MotorServiceGrpc.class) {
|
||||||
|
if ((getStreamCyclicPositionMethod = MotorServiceGrpc.getStreamCyclicPositionMethod) == null) {
|
||||||
|
MotorServiceGrpc.getStreamCyclicPositionMethod = getStreamCyclicPositionMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MotorCommand.CyclicPositionRequest, cmvr.api.MotorCommand.CyclicControlResponse>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "streamCyclicPosition"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.CyclicPositionRequest.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.CyclicControlResponse.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MotorServiceMethodDescriptorSupplier("streamCyclicPosition"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getStreamCyclicPositionMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MotorCommand.CyclicVelocityRequest,
|
||||||
|
cmvr.api.MotorCommand.CyclicControlResponse> getStreamCyclicVelocityMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "streamCyclicVelocity",
|
||||||
|
requestType = cmvr.api.MotorCommand.CyclicVelocityRequest.class,
|
||||||
|
responseType = cmvr.api.MotorCommand.CyclicControlResponse.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MotorCommand.CyclicVelocityRequest,
|
||||||
|
cmvr.api.MotorCommand.CyclicControlResponse> getStreamCyclicVelocityMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MotorCommand.CyclicVelocityRequest, cmvr.api.MotorCommand.CyclicControlResponse> getStreamCyclicVelocityMethod;
|
||||||
|
if ((getStreamCyclicVelocityMethod = MotorServiceGrpc.getStreamCyclicVelocityMethod) == null) {
|
||||||
|
synchronized (MotorServiceGrpc.class) {
|
||||||
|
if ((getStreamCyclicVelocityMethod = MotorServiceGrpc.getStreamCyclicVelocityMethod) == null) {
|
||||||
|
MotorServiceGrpc.getStreamCyclicVelocityMethod = getStreamCyclicVelocityMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MotorCommand.CyclicVelocityRequest, cmvr.api.MotorCommand.CyclicControlResponse>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "streamCyclicVelocity"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.CyclicVelocityRequest.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.CyclicControlResponse.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MotorServiceMethodDescriptorSupplier("streamCyclicVelocity"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getStreamCyclicVelocityMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MotorCommand.EmergencyStopRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse> getEmergencyStopMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "emergencyStop",
|
||||||
|
requestType = cmvr.api.MotorCommand.EmergencyStopRequest.class,
|
||||||
|
responseType = cmvr.api.MotorCommand.MotorCommandResponse.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MotorCommand.EmergencyStopRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse> getEmergencyStopMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MotorCommand.EmergencyStopRequest, cmvr.api.MotorCommand.MotorCommandResponse> getEmergencyStopMethod;
|
||||||
|
if ((getEmergencyStopMethod = MotorServiceGrpc.getEmergencyStopMethod) == null) {
|
||||||
|
synchronized (MotorServiceGrpc.class) {
|
||||||
|
if ((getEmergencyStopMethod = MotorServiceGrpc.getEmergencyStopMethod) == null) {
|
||||||
|
MotorServiceGrpc.getEmergencyStopMethod = getEmergencyStopMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MotorCommand.EmergencyStopRequest, cmvr.api.MotorCommand.MotorCommandResponse>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "emergencyStop"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.EmergencyStopRequest.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MotorServiceMethodDescriptorSupplier("emergencyStop"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getEmergencyStopMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MotorCommand.GetMotorStatusRequest,
|
||||||
|
cmvr.api.MotorCommand.GetMotorStatusResponse> getGetStatusMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "getStatus",
|
||||||
|
requestType = cmvr.api.MotorCommand.GetMotorStatusRequest.class,
|
||||||
|
responseType = cmvr.api.MotorCommand.GetMotorStatusResponse.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MotorCommand.GetMotorStatusRequest,
|
||||||
|
cmvr.api.MotorCommand.GetMotorStatusResponse> getGetStatusMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MotorCommand.GetMotorStatusRequest, cmvr.api.MotorCommand.GetMotorStatusResponse> getGetStatusMethod;
|
||||||
|
if ((getGetStatusMethod = MotorServiceGrpc.getGetStatusMethod) == null) {
|
||||||
|
synchronized (MotorServiceGrpc.class) {
|
||||||
|
if ((getGetStatusMethod = MotorServiceGrpc.getGetStatusMethod) == null) {
|
||||||
|
MotorServiceGrpc.getGetStatusMethod = getGetStatusMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MotorCommand.GetMotorStatusRequest, cmvr.api.MotorCommand.GetMotorStatusResponse>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "getStatus"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.GetMotorStatusRequest.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.GetMotorStatusResponse.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MotorServiceMethodDescriptorSupplier("getStatus"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetStatusMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.MotorCommand.SetMotorEnabledRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse> getSetEnabledMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "setEnabled",
|
||||||
|
requestType = cmvr.api.MotorCommand.SetMotorEnabledRequest.class,
|
||||||
|
responseType = cmvr.api.MotorCommand.MotorCommandResponse.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.MotorCommand.SetMotorEnabledRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse> getSetEnabledMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.MotorCommand.SetMotorEnabledRequest, cmvr.api.MotorCommand.MotorCommandResponse> getSetEnabledMethod;
|
||||||
|
if ((getSetEnabledMethod = MotorServiceGrpc.getSetEnabledMethod) == null) {
|
||||||
|
synchronized (MotorServiceGrpc.class) {
|
||||||
|
if ((getSetEnabledMethod = MotorServiceGrpc.getSetEnabledMethod) == null) {
|
||||||
|
MotorServiceGrpc.getSetEnabledMethod = getSetEnabledMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.MotorCommand.SetMotorEnabledRequest, cmvr.api.MotorCommand.MotorCommandResponse>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "setEnabled"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.SetMotorEnabledRequest.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new MotorServiceMethodDescriptorSupplier("setEnabled"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getSetEnabledMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new async stub that supports all call types for the service
|
||||||
|
*/
|
||||||
|
public static MotorServiceStub newStub(io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<MotorServiceStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<MotorServiceStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public MotorServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new MotorServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return MotorServiceStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
|
||||||
|
*/
|
||||||
|
public static MotorServiceBlockingStub newBlockingStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<MotorServiceBlockingStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<MotorServiceBlockingStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public MotorServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new MotorServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return MotorServiceBlockingStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new ListenableFuture-style stub that supports unary calls on the service
|
||||||
|
*/
|
||||||
|
public static MotorServiceFutureStub newFutureStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<MotorServiceFutureStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<MotorServiceFutureStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public MotorServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new MotorServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return MotorServiceFutureStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static abstract class MotorServiceImplBase implements io.grpc.BindableService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void setZero(cmvr.api.MotorCommand.SetMotorZeroRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetZeroMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void moveToZero(cmvr.api.MotorCommand.MoveMotorToZeroRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMoveToZeroMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void profilePosition(cmvr.api.MotorCommand.ProfilePositionRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getProfilePositionMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void profileVelocity(cmvr.api.MotorCommand.ProfileVelocityRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getProfileVelocityMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.CyclicPositionRequest> streamCyclicPosition(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.CyclicControlResponse> responseObserver) {
|
||||||
|
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamCyclicPositionMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.CyclicVelocityRequest> streamCyclicVelocity(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.CyclicControlResponse> responseObserver) {
|
||||||
|
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamCyclicVelocityMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void emergencyStop(cmvr.api.MotorCommand.EmergencyStopRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEmergencyStopMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getStatus(cmvr.api.MotorCommand.GetMotorStatusRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.GetMotorStatusResponse> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetStatusMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void setEnabled(cmvr.api.MotorCommand.SetMotorEnabledRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetEnabledMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||||||
|
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||||||
|
.addMethod(
|
||||||
|
getSetZeroMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MotorCommand.SetMotorZeroRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse>(
|
||||||
|
this, METHODID_SET_ZERO)))
|
||||||
|
.addMethod(
|
||||||
|
getMoveToZeroMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MotorCommand.MoveMotorToZeroRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse>(
|
||||||
|
this, METHODID_MOVE_TO_ZERO)))
|
||||||
|
.addMethod(
|
||||||
|
getProfilePositionMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MotorCommand.ProfilePositionRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse>(
|
||||||
|
this, METHODID_PROFILE_POSITION)))
|
||||||
|
.addMethod(
|
||||||
|
getProfileVelocityMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MotorCommand.ProfileVelocityRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse>(
|
||||||
|
this, METHODID_PROFILE_VELOCITY)))
|
||||||
|
.addMethod(
|
||||||
|
getStreamCyclicPositionMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MotorCommand.CyclicPositionRequest,
|
||||||
|
cmvr.api.MotorCommand.CyclicControlResponse>(
|
||||||
|
this, METHODID_STREAM_CYCLIC_POSITION)))
|
||||||
|
.addMethod(
|
||||||
|
getStreamCyclicVelocityMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MotorCommand.CyclicVelocityRequest,
|
||||||
|
cmvr.api.MotorCommand.CyclicControlResponse>(
|
||||||
|
this, METHODID_STREAM_CYCLIC_VELOCITY)))
|
||||||
|
.addMethod(
|
||||||
|
getEmergencyStopMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MotorCommand.EmergencyStopRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse>(
|
||||||
|
this, METHODID_EMERGENCY_STOP)))
|
||||||
|
.addMethod(
|
||||||
|
getGetStatusMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MotorCommand.GetMotorStatusRequest,
|
||||||
|
cmvr.api.MotorCommand.GetMotorStatusResponse>(
|
||||||
|
this, METHODID_GET_STATUS)))
|
||||||
|
.addMethod(
|
||||||
|
getSetEnabledMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.MotorCommand.SetMotorEnabledRequest,
|
||||||
|
cmvr.api.MotorCommand.MotorCommandResponse>(
|
||||||
|
this, METHODID_SET_ENABLED)))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static final class MotorServiceStub extends io.grpc.stub.AbstractAsyncStub<MotorServiceStub> {
|
||||||
|
private MotorServiceStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected MotorServiceStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new MotorServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void setZero(cmvr.api.MotorCommand.SetMotorZeroRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getSetZeroMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void moveToZero(cmvr.api.MotorCommand.MoveMotorToZeroRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getMoveToZeroMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void profilePosition(cmvr.api.MotorCommand.ProfilePositionRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getProfilePositionMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void profileVelocity(cmvr.api.MotorCommand.ProfileVelocityRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getProfileVelocityMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.CyclicPositionRequest> streamCyclicPosition(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.CyclicControlResponse> responseObserver) {
|
||||||
|
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
|
||||||
|
getChannel().newCall(getStreamCyclicPositionMethod(), getCallOptions()), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.CyclicVelocityRequest> streamCyclicVelocity(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.CyclicControlResponse> responseObserver) {
|
||||||
|
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
|
||||||
|
getChannel().newCall(getStreamCyclicVelocityMethod(), getCallOptions()), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void emergencyStop(cmvr.api.MotorCommand.EmergencyStopRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getEmergencyStopMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getStatus(cmvr.api.MotorCommand.GetMotorStatusRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.GetMotorStatusResponse> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getGetStatusMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void setEnabled(cmvr.api.MotorCommand.SetMotorEnabledRequest request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getSetEnabledMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static final class MotorServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<MotorServiceBlockingStub> {
|
||||||
|
private MotorServiceBlockingStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected MotorServiceBlockingStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new MotorServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.MotorCommand.MotorCommandResponse setZero(cmvr.api.MotorCommand.SetMotorZeroRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getSetZeroMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.MotorCommand.MotorCommandResponse moveToZero(cmvr.api.MotorCommand.MoveMotorToZeroRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getMoveToZeroMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.MotorCommand.MotorCommandResponse profilePosition(cmvr.api.MotorCommand.ProfilePositionRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getProfilePositionMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.MotorCommand.MotorCommandResponse profileVelocity(cmvr.api.MotorCommand.ProfileVelocityRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getProfileVelocityMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.MotorCommand.MotorCommandResponse emergencyStop(cmvr.api.MotorCommand.EmergencyStopRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getEmergencyStopMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.MotorCommand.GetMotorStatusResponse getStatus(cmvr.api.MotorCommand.GetMotorStatusRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getGetStatusMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.MotorCommand.MotorCommandResponse setEnabled(cmvr.api.MotorCommand.SetMotorEnabledRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getSetEnabledMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public static final class MotorServiceFutureStub extends io.grpc.stub.AbstractFutureStub<MotorServiceFutureStub> {
|
||||||
|
private MotorServiceFutureStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected MotorServiceFutureStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new MotorServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.MotorCommand.MotorCommandResponse> setZero(
|
||||||
|
cmvr.api.MotorCommand.SetMotorZeroRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getSetZeroMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.MotorCommand.MotorCommandResponse> moveToZero(
|
||||||
|
cmvr.api.MotorCommand.MoveMotorToZeroRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getMoveToZeroMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.MotorCommand.MotorCommandResponse> profilePosition(
|
||||||
|
cmvr.api.MotorCommand.ProfilePositionRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getProfilePositionMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.MotorCommand.MotorCommandResponse> profileVelocity(
|
||||||
|
cmvr.api.MotorCommand.ProfileVelocityRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getProfileVelocityMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.MotorCommand.MotorCommandResponse> emergencyStop(
|
||||||
|
cmvr.api.MotorCommand.EmergencyStopRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getEmergencyStopMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.MotorCommand.GetMotorStatusResponse> getStatus(
|
||||||
|
cmvr.api.MotorCommand.GetMotorStatusRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getGetStatusMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.MotorCommand.MotorCommandResponse> setEnabled(
|
||||||
|
cmvr.api.MotorCommand.SetMotorEnabledRequest request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getSetEnabledMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final int METHODID_SET_ZERO = 0;
|
||||||
|
private static final int METHODID_MOVE_TO_ZERO = 1;
|
||||||
|
private static final int METHODID_PROFILE_POSITION = 2;
|
||||||
|
private static final int METHODID_PROFILE_VELOCITY = 3;
|
||||||
|
private static final int METHODID_EMERGENCY_STOP = 4;
|
||||||
|
private static final int METHODID_GET_STATUS = 5;
|
||||||
|
private static final int METHODID_SET_ENABLED = 6;
|
||||||
|
private static final int METHODID_STREAM_CYCLIC_POSITION = 7;
|
||||||
|
private static final int METHODID_STREAM_CYCLIC_VELOCITY = 8;
|
||||||
|
|
||||||
|
private static final class MethodHandlers<Req, Resp> implements
|
||||||
|
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
|
||||||
|
private final MotorServiceImplBase serviceImpl;
|
||||||
|
private final int methodId;
|
||||||
|
|
||||||
|
MethodHandlers(MotorServiceImplBase serviceImpl, int methodId) {
|
||||||
|
this.serviceImpl = serviceImpl;
|
||||||
|
this.methodId = methodId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
case METHODID_SET_ZERO:
|
||||||
|
serviceImpl.setZero((cmvr.api.MotorCommand.SetMotorZeroRequest) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_MOVE_TO_ZERO:
|
||||||
|
serviceImpl.moveToZero((cmvr.api.MotorCommand.MoveMotorToZeroRequest) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_PROFILE_POSITION:
|
||||||
|
serviceImpl.profilePosition((cmvr.api.MotorCommand.ProfilePositionRequest) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_PROFILE_VELOCITY:
|
||||||
|
serviceImpl.profileVelocity((cmvr.api.MotorCommand.ProfileVelocityRequest) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_EMERGENCY_STOP:
|
||||||
|
serviceImpl.emergencyStop((cmvr.api.MotorCommand.EmergencyStopRequest) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_GET_STATUS:
|
||||||
|
serviceImpl.getStatus((cmvr.api.MotorCommand.GetMotorStatusRequest) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.GetMotorStatusResponse>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_SET_ENABLED:
|
||||||
|
serviceImpl.setEnabled((cmvr.api.MotorCommand.SetMotorEnabledRequest) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.MotorCommandResponse>) responseObserver);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public io.grpc.stub.StreamObserver<Req> invoke(
|
||||||
|
io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
case METHODID_STREAM_CYCLIC_POSITION:
|
||||||
|
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.streamCyclicPosition(
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.CyclicControlResponse>) responseObserver);
|
||||||
|
case METHODID_STREAM_CYCLIC_VELOCITY:
|
||||||
|
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.streamCyclicVelocity(
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.MotorCommand.CyclicControlResponse>) responseObserver);
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static abstract class MotorServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
|
||||||
|
MotorServiceBaseDescriptorSupplier() {}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
|
||||||
|
return cmvr.api.MotorServiceOuterClass.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
return getFileDescriptor().findServiceByName("MotorService");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class MotorServiceFileDescriptorSupplier
|
||||||
|
extends MotorServiceBaseDescriptorSupplier {
|
||||||
|
MotorServiceFileDescriptorSupplier() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class MotorServiceMethodDescriptorSupplier
|
||||||
|
extends MotorServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
|
||||||
|
private final String methodName;
|
||||||
|
|
||||||
|
MotorServiceMethodDescriptorSupplier(String methodName) {
|
||||||
|
this.methodName = methodName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
|
||||||
|
return getServiceDescriptor().findMethodByName(methodName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||||
|
|
||||||
|
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
synchronized (MotorServiceGrpc.class) {
|
||||||
|
result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
|
||||||
|
.setSchemaDescriptor(new MotorServiceFileDescriptorSupplier())
|
||||||
|
.addMethod(getSetZeroMethod())
|
||||||
|
.addMethod(getMoveToZeroMethod())
|
||||||
|
.addMethod(getProfilePositionMethod())
|
||||||
|
.addMethod(getProfileVelocityMethod())
|
||||||
|
.addMethod(getStreamCyclicPositionMethod())
|
||||||
|
.addMethod(getStreamCyclicVelocityMethod())
|
||||||
|
.addMethod(getEmergencyStopMethod())
|
||||||
|
.addMethod(getGetStatusMethod())
|
||||||
|
.addMethod(getSetEnabledMethod())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: cmvr/api/motor_service.proto
|
||||||
|
|
||||||
|
package cmvr.api;
|
||||||
|
|
||||||
|
public final class MotorServiceOuterClass {
|
||||||
|
private MotorServiceOuterClass() {}
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistry registry) {
|
||||||
|
registerAllExtensions(
|
||||||
|
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return descriptor;
|
||||||
|
}
|
||||||
|
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
descriptor;
|
||||||
|
static {
|
||||||
|
java.lang.String[] descriptorData = {
|
||||||
|
"\n\034cmvr/api/motor_service.proto\022\010cmvr.api" +
|
||||||
|
"\032\034cmvr/api/motor_command.proto2\377\005\n\014Motor" +
|
||||||
|
"Service\022H\n\007setZero\022\035.cmvr.api.SetMotorZe" +
|
||||||
|
"roRequest\032\036.cmvr.api.MotorCommandRespons" +
|
||||||
|
"e\022N\n\nmoveToZero\022 .cmvr.api.MoveMotorToZe" +
|
||||||
|
"roRequest\032\036.cmvr.api.MotorCommandRespons" +
|
||||||
|
"e\022S\n\017profilePosition\022 .cmvr.api.ProfileP" +
|
||||||
|
"ositionRequest\032\036.cmvr.api.MotorCommandRe" +
|
||||||
|
"sponse\022S\n\017profileVelocity\022 .cmvr.api.Pro" +
|
||||||
|
"fileVelocityRequest\032\036.cmvr.api.MotorComm" +
|
||||||
|
"andResponse\022\\\n\024streamCyclicPosition\022\037.cm" +
|
||||||
|
"vr.api.CyclicPositionRequest\032\037.cmvr.api." +
|
||||||
|
"CyclicControlResponse(\0010\001\022\\\n\024streamCycli" +
|
||||||
|
"cVelocity\022\037.cmvr.api.CyclicVelocityReque" +
|
||||||
|
"st\032\037.cmvr.api.CyclicControlResponse(\0010\001\022" +
|
||||||
|
"O\n\remergencyStop\022\036.cmvr.api.EmergencySto" +
|
||||||
|
"pRequest\032\036.cmvr.api.MotorCommandResponse" +
|
||||||
|
"\022N\n\tgetStatus\022\037.cmvr.api.GetMotorStatusR" +
|
||||||
|
"equest\032 .cmvr.api.GetMotorStatusResponse" +
|
||||||
|
"\022N\n\nsetEnabled\022 .cmvr.api.SetMotorEnable" +
|
||||||
|
"dRequest\032\036.cmvr.api.MotorCommandResponse" +
|
||||||
|
"b\006proto3"
|
||||||
|
};
|
||||||
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
|
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||||
|
cmvr.api.MotorCommand.getDescriptor(),
|
||||||
|
});
|
||||||
|
cmvr.api.MotorCommand.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(outer_class_scope)
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -77,6 +77,37 @@ public final class SystemServiceGrpc {
|
|||||||
return getGetSystemStatusMethod;
|
return getGetSystemStatusMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.SystemCommand.GetDeviceListCommand.Request,
|
||||||
|
cmvr.api.SystemCommand.GetDeviceListCommand.Feedback> getGetDeviceListMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "GetDeviceList",
|
||||||
|
requestType = cmvr.api.SystemCommand.GetDeviceListCommand.Request.class,
|
||||||
|
responseType = cmvr.api.SystemCommand.GetDeviceListCommand.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.SystemCommand.GetDeviceListCommand.Request,
|
||||||
|
cmvr.api.SystemCommand.GetDeviceListCommand.Feedback> getGetDeviceListMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.SystemCommand.GetDeviceListCommand.Request, cmvr.api.SystemCommand.GetDeviceListCommand.Feedback> getGetDeviceListMethod;
|
||||||
|
if ((getGetDeviceListMethod = SystemServiceGrpc.getGetDeviceListMethod) == null) {
|
||||||
|
synchronized (SystemServiceGrpc.class) {
|
||||||
|
if ((getGetDeviceListMethod = SystemServiceGrpc.getGetDeviceListMethod) == null) {
|
||||||
|
SystemServiceGrpc.getGetDeviceListMethod = getGetDeviceListMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.SystemCommand.GetDeviceListCommand.Request, cmvr.api.SystemCommand.GetDeviceListCommand.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDeviceList"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SystemCommand.GetDeviceListCommand.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.SystemCommand.GetDeviceListCommand.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new SystemServiceMethodDescriptorSupplier("GetDeviceList"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getGetDeviceListMethod;
|
||||||
|
}
|
||||||
|
|
||||||
private static volatile io.grpc.MethodDescriptor<cmvr.api.SystemCommand.UpdateParamsCommand.Request,
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.SystemCommand.UpdateParamsCommand.Request,
|
||||||
cmvr.api.SystemCommand.UpdateParamsCommand.Feedback> getUpdateParamsMethod;
|
cmvr.api.SystemCommand.UpdateParamsCommand.Feedback> getUpdateParamsMethod;
|
||||||
|
|
||||||
@ -201,6 +232,13 @@ public final class SystemServiceGrpc {
|
|||||||
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSystemStatusMethod(), responseObserver);
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSystemStatusMethod(), responseObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getDeviceList(cmvr.api.SystemCommand.GetDeviceListCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SystemCommand.GetDeviceListCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetDeviceListMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public void updateParams(cmvr.api.SystemCommand.UpdateParamsCommand.Request request,
|
public void updateParams(cmvr.api.SystemCommand.UpdateParamsCommand.Request request,
|
||||||
@ -231,6 +269,13 @@ public final class SystemServiceGrpc {
|
|||||||
cmvr.api.SystemCommand.GetSystemStatusCommand.Request,
|
cmvr.api.SystemCommand.GetSystemStatusCommand.Request,
|
||||||
cmvr.api.SystemCommand.GetSystemStatusCommand.Feedback>(
|
cmvr.api.SystemCommand.GetSystemStatusCommand.Feedback>(
|
||||||
this, METHODID_GET_SYSTEM_STATUS)))
|
this, METHODID_GET_SYSTEM_STATUS)))
|
||||||
|
.addMethod(
|
||||||
|
getGetDeviceListMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.SystemCommand.GetDeviceListCommand.Request,
|
||||||
|
cmvr.api.SystemCommand.GetDeviceListCommand.Feedback>(
|
||||||
|
this, METHODID_GET_DEVICE_LIST)))
|
||||||
.addMethod(
|
.addMethod(
|
||||||
getUpdateParamsMethod(),
|
getUpdateParamsMethod(),
|
||||||
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
@ -279,6 +324,14 @@ public final class SystemServiceGrpc {
|
|||||||
getChannel().newCall(getGetSystemStatusMethod(), getCallOptions()), request, responseObserver);
|
getChannel().newCall(getGetSystemStatusMethod(), getCallOptions()), request, responseObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void getDeviceList(cmvr.api.SystemCommand.GetDeviceListCommand.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.SystemCommand.GetDeviceListCommand.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getGetDeviceListMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public void updateParams(cmvr.api.SystemCommand.UpdateParamsCommand.Request request,
|
public void updateParams(cmvr.api.SystemCommand.UpdateParamsCommand.Request request,
|
||||||
@ -324,6 +377,13 @@ public final class SystemServiceGrpc {
|
|||||||
getChannel(), getGetSystemStatusMethod(), getCallOptions(), request);
|
getChannel(), getGetSystemStatusMethod(), getCallOptions(), request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.SystemCommand.GetDeviceListCommand.Feedback getDeviceList(cmvr.api.SystemCommand.GetDeviceListCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getGetDeviceListMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public cmvr.api.SystemCommand.UpdateParamsCommand.Feedback updateParams(cmvr.api.SystemCommand.UpdateParamsCommand.Request request) {
|
public cmvr.api.SystemCommand.UpdateParamsCommand.Feedback updateParams(cmvr.api.SystemCommand.UpdateParamsCommand.Request request) {
|
||||||
@ -369,6 +429,14 @@ public final class SystemServiceGrpc {
|
|||||||
getChannel().newCall(getGetSystemStatusMethod(), getCallOptions()), request);
|
getChannel().newCall(getGetSystemStatusMethod(), getCallOptions()), request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.SystemCommand.GetDeviceListCommand.Feedback> getDeviceList(
|
||||||
|
cmvr.api.SystemCommand.GetDeviceListCommand.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getGetDeviceListMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.SystemCommand.UpdateParamsCommand.Feedback> updateParams(
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.SystemCommand.UpdateParamsCommand.Feedback> updateParams(
|
||||||
@ -388,8 +456,9 @@ public final class SystemServiceGrpc {
|
|||||||
|
|
||||||
private static final int METHODID_GET_SYSTEM_INFO = 0;
|
private static final int METHODID_GET_SYSTEM_INFO = 0;
|
||||||
private static final int METHODID_GET_SYSTEM_STATUS = 1;
|
private static final int METHODID_GET_SYSTEM_STATUS = 1;
|
||||||
private static final int METHODID_UPDATE_PARAMS = 2;
|
private static final int METHODID_GET_DEVICE_LIST = 2;
|
||||||
private static final int METHODID_STOP_ALL = 3;
|
private static final int METHODID_UPDATE_PARAMS = 3;
|
||||||
|
private static final int METHODID_STOP_ALL = 4;
|
||||||
|
|
||||||
private static final class MethodHandlers<Req, Resp> implements
|
private static final class MethodHandlers<Req, Resp> implements
|
||||||
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||||
@ -416,6 +485,10 @@ public final class SystemServiceGrpc {
|
|||||||
serviceImpl.getSystemStatus((cmvr.api.SystemCommand.GetSystemStatusCommand.Request) request,
|
serviceImpl.getSystemStatus((cmvr.api.SystemCommand.GetSystemStatusCommand.Request) request,
|
||||||
(io.grpc.stub.StreamObserver<cmvr.api.SystemCommand.GetSystemStatusCommand.Feedback>) responseObserver);
|
(io.grpc.stub.StreamObserver<cmvr.api.SystemCommand.GetSystemStatusCommand.Feedback>) responseObserver);
|
||||||
break;
|
break;
|
||||||
|
case METHODID_GET_DEVICE_LIST:
|
||||||
|
serviceImpl.getDeviceList((cmvr.api.SystemCommand.GetDeviceListCommand.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.SystemCommand.GetDeviceListCommand.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
case METHODID_UPDATE_PARAMS:
|
case METHODID_UPDATE_PARAMS:
|
||||||
serviceImpl.updateParams((cmvr.api.SystemCommand.UpdateParamsCommand.Request) request,
|
serviceImpl.updateParams((cmvr.api.SystemCommand.UpdateParamsCommand.Request) request,
|
||||||
(io.grpc.stub.StreamObserver<cmvr.api.SystemCommand.UpdateParamsCommand.Feedback>) responseObserver);
|
(io.grpc.stub.StreamObserver<cmvr.api.SystemCommand.UpdateParamsCommand.Feedback>) responseObserver);
|
||||||
@ -487,6 +560,7 @@ public final class SystemServiceGrpc {
|
|||||||
.setSchemaDescriptor(new SystemServiceFileDescriptorSupplier())
|
.setSchemaDescriptor(new SystemServiceFileDescriptorSupplier())
|
||||||
.addMethod(getGetSystemInfoMethod())
|
.addMethod(getGetSystemInfoMethod())
|
||||||
.addMethod(getGetSystemStatusMethod())
|
.addMethod(getGetSystemStatusMethod())
|
||||||
|
.addMethod(getGetDeviceListMethod())
|
||||||
.addMethod(getUpdateParamsMethod())
|
.addMethod(getUpdateParamsMethod())
|
||||||
.addMethod(getStopAllMethod())
|
.addMethod(getStopAllMethod())
|
||||||
.build();
|
.build();
|
||||||
|
|||||||
@ -24,18 +24,20 @@ public final class SystemServiceOuterClass {
|
|||||||
static {
|
static {
|
||||||
java.lang.String[] descriptorData = {
|
java.lang.String[] descriptorData = {
|
||||||
"\n\035cmvr/api/system_service.proto\022\010cmvr.ap" +
|
"\n\035cmvr/api/system_service.proto\022\010cmvr.ap" +
|
||||||
"i\032\035cmvr/api/system_command.proto2\220\003\n\rSys" +
|
"i\032\035cmvr/api/system_command.proto2\364\003\n\rSys" +
|
||||||
"temService\022b\n\rGetSystemInfo\022&.cmvr.api.G" +
|
"temService\022b\n\rGetSystemInfo\022&.cmvr.api.G" +
|
||||||
"etSystemInfoCommand.Request\032\'.cmvr.api.G" +
|
"etSystemInfoCommand.Request\032\'.cmvr.api.G" +
|
||||||
"etSystemInfoCommand.Feedback\"\000\022h\n\017GetSys" +
|
"etSystemInfoCommand.Feedback\"\000\022h\n\017GetSys" +
|
||||||
"temStatus\022(.cmvr.api.GetSystemStatusComm" +
|
"temStatus\022(.cmvr.api.GetSystemStatusComm" +
|
||||||
"and.Request\032).cmvr.api.GetSystemStatusCo" +
|
"and.Request\032).cmvr.api.GetSystemStatusCo" +
|
||||||
"mmand.Feedback\"\000\022_\n\014UpdateParams\022%.cmvr." +
|
"mmand.Feedback\"\000\022b\n\rGetDeviceList\022&.cmvr" +
|
||||||
"api.UpdateParamsCommand.Request\032&.cmvr.a" +
|
".api.GetDeviceListCommand.Request\032\'.cmvr" +
|
||||||
"pi.UpdateParamsCommand.Feedback\"\000\022P\n\007Sto" +
|
".api.GetDeviceListCommand.Feedback\"\000\022_\n\014" +
|
||||||
"pAll\022 .cmvr.api.StopAllCommand.Request\032!" +
|
"UpdateParams\022%.cmvr.api.UpdateParamsComm" +
|
||||||
".cmvr.api.StopAllCommand.Feedback\"\000b\006pro" +
|
"and.Request\032&.cmvr.api.UpdateParamsComma" +
|
||||||
"to3"
|
"nd.Feedback\"\000\022P\n\007StopAll\022 .cmvr.api.Stop" +
|
||||||
|
"AllCommand.Request\032!.cmvr.api.StopAllCom" +
|
||||||
|
"mand.Feedback\"\000b\006proto3"
|
||||||
};
|
};
|
||||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
.internalBuildGeneratedFileFrom(descriptorData,
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
|
|||||||
@ -0,0 +1,280 @@
|
|||||||
|
package cmvr.api.armteleop.v1;
|
||||||
|
|
||||||
|
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* Versioned, session-oriented protocol for wired arm teleoperation. Existing
|
||||||
|
* unary ArmService RPCs intentionally remain unchanged.
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@javax.annotation.Generated(
|
||||||
|
value = "by gRPC proto compiler (version 1.52.0)",
|
||||||
|
comments = "Source: cmvr/api/arm_teleop_v1.proto")
|
||||||
|
@io.grpc.stub.annotations.GrpcGenerated
|
||||||
|
public final class ArmTeleopServiceGrpc {
|
||||||
|
|
||||||
|
private ArmTeleopServiceGrpc() {}
|
||||||
|
|
||||||
|
public static final String SERVICE_NAME = "cmvr.api.armteleop.v1.ArmTeleopService";
|
||||||
|
|
||||||
|
// Static method descriptors that strictly reflect the proto.
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.armteleop.v1.ArmTeleopV1.ClientFrame,
|
||||||
|
cmvr.api.armteleop.v1.ArmTeleopV1.ServerFrame> getTeleoperateMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "Teleoperate",
|
||||||
|
requestType = cmvr.api.armteleop.v1.ArmTeleopV1.ClientFrame.class,
|
||||||
|
responseType = cmvr.api.armteleop.v1.ArmTeleopV1.ServerFrame.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.armteleop.v1.ArmTeleopV1.ClientFrame,
|
||||||
|
cmvr.api.armteleop.v1.ArmTeleopV1.ServerFrame> getTeleoperateMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.armteleop.v1.ArmTeleopV1.ClientFrame, cmvr.api.armteleop.v1.ArmTeleopV1.ServerFrame> getTeleoperateMethod;
|
||||||
|
if ((getTeleoperateMethod = ArmTeleopServiceGrpc.getTeleoperateMethod) == null) {
|
||||||
|
synchronized (ArmTeleopServiceGrpc.class) {
|
||||||
|
if ((getTeleoperateMethod = ArmTeleopServiceGrpc.getTeleoperateMethod) == null) {
|
||||||
|
ArmTeleopServiceGrpc.getTeleoperateMethod = getTeleoperateMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.armteleop.v1.ArmTeleopV1.ClientFrame, cmvr.api.armteleop.v1.ArmTeleopV1.ServerFrame>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "Teleoperate"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.armteleop.v1.ArmTeleopV1.ClientFrame.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.armteleop.v1.ArmTeleopV1.ServerFrame.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new ArmTeleopServiceMethodDescriptorSupplier("Teleoperate"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getTeleoperateMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new async stub that supports all call types for the service
|
||||||
|
*/
|
||||||
|
public static ArmTeleopServiceStub newStub(io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<ArmTeleopServiceStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<ArmTeleopServiceStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public ArmTeleopServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new ArmTeleopServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return ArmTeleopServiceStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
|
||||||
|
*/
|
||||||
|
public static ArmTeleopServiceBlockingStub newBlockingStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<ArmTeleopServiceBlockingStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<ArmTeleopServiceBlockingStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public ArmTeleopServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new ArmTeleopServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return ArmTeleopServiceBlockingStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new ListenableFuture-style stub that supports unary calls on the service
|
||||||
|
*/
|
||||||
|
public static ArmTeleopServiceFutureStub newFutureStub(
|
||||||
|
io.grpc.Channel channel) {
|
||||||
|
io.grpc.stub.AbstractStub.StubFactory<ArmTeleopServiceFutureStub> factory =
|
||||||
|
new io.grpc.stub.AbstractStub.StubFactory<ArmTeleopServiceFutureStub>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public ArmTeleopServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new ArmTeleopServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return ArmTeleopServiceFutureStub.newStub(factory, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* Versioned, session-oriented protocol for wired arm teleoperation. Existing
|
||||||
|
* unary ArmService RPCs intentionally remain unchanged.
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public static abstract class ArmTeleopServiceImplBase implements io.grpc.BindableService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.armteleop.v1.ArmTeleopV1.ClientFrame> teleoperate(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.armteleop.v1.ArmTeleopV1.ServerFrame> responseObserver) {
|
||||||
|
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getTeleoperateMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||||||
|
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||||||
|
.addMethod(
|
||||||
|
getTeleoperateMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.armteleop.v1.ArmTeleopV1.ClientFrame,
|
||||||
|
cmvr.api.armteleop.v1.ArmTeleopV1.ServerFrame>(
|
||||||
|
this, METHODID_TELEOPERATE)))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* Versioned, session-oriented protocol for wired arm teleoperation. Existing
|
||||||
|
* unary ArmService RPCs intentionally remain unchanged.
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public static final class ArmTeleopServiceStub extends io.grpc.stub.AbstractAsyncStub<ArmTeleopServiceStub> {
|
||||||
|
private ArmTeleopServiceStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected ArmTeleopServiceStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new ArmTeleopServiceStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public io.grpc.stub.StreamObserver<cmvr.api.armteleop.v1.ArmTeleopV1.ClientFrame> teleoperate(
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.armteleop.v1.ArmTeleopV1.ServerFrame> responseObserver) {
|
||||||
|
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
|
||||||
|
getChannel().newCall(getTeleoperateMethod(), getCallOptions()), responseObserver);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* Versioned, session-oriented protocol for wired arm teleoperation. Existing
|
||||||
|
* unary ArmService RPCs intentionally remain unchanged.
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public static final class ArmTeleopServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<ArmTeleopServiceBlockingStub> {
|
||||||
|
private ArmTeleopServiceBlockingStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected ArmTeleopServiceBlockingStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new ArmTeleopServiceBlockingStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* Versioned, session-oriented protocol for wired arm teleoperation. Existing
|
||||||
|
* unary ArmService RPCs intentionally remain unchanged.
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public static final class ArmTeleopServiceFutureStub extends io.grpc.stub.AbstractFutureStub<ArmTeleopServiceFutureStub> {
|
||||||
|
private ArmTeleopServiceFutureStub(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
super(channel, callOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected ArmTeleopServiceFutureStub build(
|
||||||
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||||||
|
return new ArmTeleopServiceFutureStub(channel, callOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final int METHODID_TELEOPERATE = 0;
|
||||||
|
|
||||||
|
private static final class MethodHandlers<Req, Resp> implements
|
||||||
|
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
|
||||||
|
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
|
||||||
|
private final ArmTeleopServiceImplBase serviceImpl;
|
||||||
|
private final int methodId;
|
||||||
|
|
||||||
|
MethodHandlers(ArmTeleopServiceImplBase serviceImpl, int methodId) {
|
||||||
|
this.serviceImpl = serviceImpl;
|
||||||
|
this.methodId = methodId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.SuppressWarnings("unchecked")
|
||||||
|
public io.grpc.stub.StreamObserver<Req> invoke(
|
||||||
|
io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||||
|
switch (methodId) {
|
||||||
|
case METHODID_TELEOPERATE:
|
||||||
|
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.teleoperate(
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.armteleop.v1.ArmTeleopV1.ServerFrame>) responseObserver);
|
||||||
|
default:
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static abstract class ArmTeleopServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
|
||||||
|
ArmTeleopServiceBaseDescriptorSupplier() {}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
|
||||||
|
return cmvr.api.armteleop.v1.ArmTeleopV1.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
return getFileDescriptor().findServiceByName("ArmTeleopService");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class ArmTeleopServiceFileDescriptorSupplier
|
||||||
|
extends ArmTeleopServiceBaseDescriptorSupplier {
|
||||||
|
ArmTeleopServiceFileDescriptorSupplier() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class ArmTeleopServiceMethodDescriptorSupplier
|
||||||
|
extends ArmTeleopServiceBaseDescriptorSupplier
|
||||||
|
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
|
||||||
|
private final String methodName;
|
||||||
|
|
||||||
|
ArmTeleopServiceMethodDescriptorSupplier(String methodName) {
|
||||||
|
this.methodName = methodName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
|
||||||
|
return getServiceDescriptor().findMethodByName(methodName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||||
|
|
||||||
|
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||||
|
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
synchronized (ArmTeleopServiceGrpc.class) {
|
||||||
|
result = serviceDescriptor;
|
||||||
|
if (result == null) {
|
||||||
|
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
|
||||||
|
.setSchemaDescriptor(new ArmTeleopServiceFileDescriptorSupplier())
|
||||||
|
.addMethod(getTeleoperateMethod())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,586 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: cmvr/msgs/cia402.proto
|
||||||
|
|
||||||
|
package cmvr.msgs;
|
||||||
|
|
||||||
|
public final class Cia402 {
|
||||||
|
private Cia402() {}
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistry registry) {
|
||||||
|
registerAllExtensions(
|
||||||
|
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* CiA402 object dictionary indexes shared by CANopen and EtherCAT CoE drives.
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* Protobuf enum {@code cmvr.msgs.Cia402ObjectIndex}
|
||||||
|
*/
|
||||||
|
public enum Cia402ObjectIndex
|
||||||
|
implements com.google.protobuf.ProtocolMessageEnum {
|
||||||
|
/**
|
||||||
|
* <code>CIA402_OBJECT_INDEX_ZERO = 0;</code>
|
||||||
|
*/
|
||||||
|
CIA402_OBJECT_INDEX_ZERO(0),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_ERROR_CODE_603F = 24639;</code>
|
||||||
|
*/
|
||||||
|
CIA402_ERROR_CODE_603F(24639),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_CONTROL_WORD_6040 = 24640;</code>
|
||||||
|
*/
|
||||||
|
CIA402_CONTROL_WORD_6040(24640),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_STATUS_WORD_6041 = 24641;</code>
|
||||||
|
*/
|
||||||
|
CIA402_STATUS_WORD_6041(24641),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_QUICK_STOP_OPTION_605A = 24666;</code>
|
||||||
|
*/
|
||||||
|
CIA402_QUICK_STOP_OPTION_605A(24666),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_SHUTDOWN_OPTION_605B = 24667;</code>
|
||||||
|
*/
|
||||||
|
CIA402_SHUTDOWN_OPTION_605B(24667),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_DISABLE_OPERATION_OPTION_605C = 24668;</code>
|
||||||
|
*/
|
||||||
|
CIA402_DISABLE_OPERATION_OPTION_605C(24668),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_HALT_OPTION_605D = 24669;</code>
|
||||||
|
*/
|
||||||
|
CIA402_HALT_OPTION_605D(24669),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_FAULT_REACTION_OPTION_605E = 24670;</code>
|
||||||
|
*/
|
||||||
|
CIA402_FAULT_REACTION_OPTION_605E(24670),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_OPERATION_MODE_6060 = 24672;</code>
|
||||||
|
*/
|
||||||
|
CIA402_OPERATION_MODE_6060(24672),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_MODE_DISPLAY_6061 = 24673;</code>
|
||||||
|
*/
|
||||||
|
CIA402_MODE_DISPLAY_6061(24673),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_POSITION_DEMAND_VALUE_6062 = 24674;</code>
|
||||||
|
*/
|
||||||
|
CIA402_POSITION_DEMAND_VALUE_6062(24674),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_ACTUAL_POSITION_6064 = 24676;</code>
|
||||||
|
*/
|
||||||
|
CIA402_ACTUAL_POSITION_6064(24676),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_MAX_FOLLOWING_ERROR_6065 = 24677;</code>
|
||||||
|
*/
|
||||||
|
CIA402_MAX_FOLLOWING_ERROR_6065(24677),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_POSITION_WINDOW_6067 = 24679;</code>
|
||||||
|
*/
|
||||||
|
CIA402_POSITION_WINDOW_6067(24679),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_POSITION_WINDOW_TIME_6068 = 24680;</code>
|
||||||
|
*/
|
||||||
|
CIA402_POSITION_WINDOW_TIME_6068(24680),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_VELOCITY_DEMAND_VALUE_606B = 24683;</code>
|
||||||
|
*/
|
||||||
|
CIA402_VELOCITY_DEMAND_VALUE_606B(24683),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_ACTUAL_VELOCITY_606C = 24684;</code>
|
||||||
|
*/
|
||||||
|
CIA402_ACTUAL_VELOCITY_606C(24684),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_VELOCITY_WINDOW_606D = 24685;</code>
|
||||||
|
*/
|
||||||
|
CIA402_VELOCITY_WINDOW_606D(24685),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_VELOCITY_WINDOW_TIME_606E = 24686;</code>
|
||||||
|
*/
|
||||||
|
CIA402_VELOCITY_WINDOW_TIME_606E(24686),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_VELOCITY_THRESHOLD_606F = 24687;</code>
|
||||||
|
*/
|
||||||
|
CIA402_VELOCITY_THRESHOLD_606F(24687),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_VELOCITY_THRESHOLD_TIME_6070 = 24688;</code>
|
||||||
|
*/
|
||||||
|
CIA402_VELOCITY_THRESHOLD_TIME_6070(24688),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_TARGET_TORQUE_6071 = 24689;</code>
|
||||||
|
*/
|
||||||
|
CIA402_TARGET_TORQUE_6071(24689),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_MAX_TORQUE_6072 = 24690;</code>
|
||||||
|
*/
|
||||||
|
CIA402_MAX_TORQUE_6072(24690),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_TORQUE_DEMAND_VALUE_6074 = 24692;</code>
|
||||||
|
*/
|
||||||
|
CIA402_TORQUE_DEMAND_VALUE_6074(24692),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_MOTOR_RATED_TORQUE_6076 = 24694;</code>
|
||||||
|
*/
|
||||||
|
CIA402_MOTOR_RATED_TORQUE_6076(24694),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_ACTUAL_TORQUE_6077 = 24695;</code>
|
||||||
|
*/
|
||||||
|
CIA402_ACTUAL_TORQUE_6077(24695),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_ACTUAL_CURRENT_6078 = 24696;</code>
|
||||||
|
*/
|
||||||
|
CIA402_ACTUAL_CURRENT_6078(24696),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_DC_LINK_VOLTAGE_6079 = 24697;</code>
|
||||||
|
*/
|
||||||
|
CIA402_DC_LINK_VOLTAGE_6079(24697),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_TARGET_POSITION_607A = 24698;</code>
|
||||||
|
*/
|
||||||
|
CIA402_TARGET_POSITION_607A(24698),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_HOME_OFFSET_607C = 24700;</code>
|
||||||
|
*/
|
||||||
|
CIA402_HOME_OFFSET_607C(24700),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_SOFTWARE_POSITION_LIMIT_607D = 24701;</code>
|
||||||
|
*/
|
||||||
|
CIA402_SOFTWARE_POSITION_LIMIT_607D(24701),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_MAX_PROFILE_VELOCITY_607F = 24703;</code>
|
||||||
|
*/
|
||||||
|
CIA402_MAX_PROFILE_VELOCITY_607F(24703),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_PROFILE_VELOCITY_6081 = 24705;</code>
|
||||||
|
*/
|
||||||
|
CIA402_PROFILE_VELOCITY_6081(24705),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_PROFILE_ACCELERATION_6083 = 24707;</code>
|
||||||
|
*/
|
||||||
|
CIA402_PROFILE_ACCELERATION_6083(24707),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_PROFILE_DECELERATION_6084 = 24708;</code>
|
||||||
|
*/
|
||||||
|
CIA402_PROFILE_DECELERATION_6084(24708),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_QUICK_STOP_DECELERATION_6085 = 24709;</code>
|
||||||
|
*/
|
||||||
|
CIA402_QUICK_STOP_DECELERATION_6085(24709),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_TORQUE_SLOPE_6087 = 24711;</code>
|
||||||
|
*/
|
||||||
|
CIA402_TORQUE_SLOPE_6087(24711),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_GEAR_RATIO_6091 = 24721;</code>
|
||||||
|
*/
|
||||||
|
CIA402_GEAR_RATIO_6091(24721),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_VELOCITY_OFFSET_60B1 = 24753;</code>
|
||||||
|
*/
|
||||||
|
CIA402_VELOCITY_OFFSET_60B1(24753),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_TORQUE_OFFSET_60B2 = 24754;</code>
|
||||||
|
*/
|
||||||
|
CIA402_TORQUE_OFFSET_60B2(24754),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_INTERPOLATION_DATA_RECORD_60C1 = 24769;</code>
|
||||||
|
*/
|
||||||
|
CIA402_INTERPOLATION_DATA_RECORD_60C1(24769),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_INTERPOLATION_TIME_PERIOD_60C2 = 24770;</code>
|
||||||
|
*/
|
||||||
|
CIA402_INTERPOLATION_TIME_PERIOD_60C2(24770),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_FOLLOWING_ERROR_ACTUAL_VALUE_60F4 = 24820;</code>
|
||||||
|
*/
|
||||||
|
CIA402_FOLLOWING_ERROR_ACTUAL_VALUE_60F4(24820),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_TARGET_VELOCITY_60FF = 24831;</code>
|
||||||
|
*/
|
||||||
|
CIA402_TARGET_VELOCITY_60FF(24831),
|
||||||
|
/**
|
||||||
|
* <code>CIA402_SUPPORTED_DRIVE_MODES_6502 = 25858;</code>
|
||||||
|
*/
|
||||||
|
CIA402_SUPPORTED_DRIVE_MODES_6502(25858),
|
||||||
|
UNRECOGNIZED(-1),
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>CIA402_OBJECT_INDEX_ZERO = 0;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_OBJECT_INDEX_ZERO_VALUE = 0;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_ERROR_CODE_603F = 24639;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_ERROR_CODE_603F_VALUE = 24639;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_CONTROL_WORD_6040 = 24640;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_CONTROL_WORD_6040_VALUE = 24640;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_STATUS_WORD_6041 = 24641;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_STATUS_WORD_6041_VALUE = 24641;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_QUICK_STOP_OPTION_605A = 24666;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_QUICK_STOP_OPTION_605A_VALUE = 24666;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_SHUTDOWN_OPTION_605B = 24667;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_SHUTDOWN_OPTION_605B_VALUE = 24667;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_DISABLE_OPERATION_OPTION_605C = 24668;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_DISABLE_OPERATION_OPTION_605C_VALUE = 24668;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_HALT_OPTION_605D = 24669;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_HALT_OPTION_605D_VALUE = 24669;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_FAULT_REACTION_OPTION_605E = 24670;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_FAULT_REACTION_OPTION_605E_VALUE = 24670;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_OPERATION_MODE_6060 = 24672;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_OPERATION_MODE_6060_VALUE = 24672;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_MODE_DISPLAY_6061 = 24673;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_MODE_DISPLAY_6061_VALUE = 24673;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_POSITION_DEMAND_VALUE_6062 = 24674;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_POSITION_DEMAND_VALUE_6062_VALUE = 24674;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_ACTUAL_POSITION_6064 = 24676;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_ACTUAL_POSITION_6064_VALUE = 24676;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_MAX_FOLLOWING_ERROR_6065 = 24677;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_MAX_FOLLOWING_ERROR_6065_VALUE = 24677;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_POSITION_WINDOW_6067 = 24679;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_POSITION_WINDOW_6067_VALUE = 24679;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_POSITION_WINDOW_TIME_6068 = 24680;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_POSITION_WINDOW_TIME_6068_VALUE = 24680;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_VELOCITY_DEMAND_VALUE_606B = 24683;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_VELOCITY_DEMAND_VALUE_606B_VALUE = 24683;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_ACTUAL_VELOCITY_606C = 24684;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_ACTUAL_VELOCITY_606C_VALUE = 24684;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_VELOCITY_WINDOW_606D = 24685;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_VELOCITY_WINDOW_606D_VALUE = 24685;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_VELOCITY_WINDOW_TIME_606E = 24686;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_VELOCITY_WINDOW_TIME_606E_VALUE = 24686;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_VELOCITY_THRESHOLD_606F = 24687;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_VELOCITY_THRESHOLD_606F_VALUE = 24687;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_VELOCITY_THRESHOLD_TIME_6070 = 24688;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_VELOCITY_THRESHOLD_TIME_6070_VALUE = 24688;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_TARGET_TORQUE_6071 = 24689;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_TARGET_TORQUE_6071_VALUE = 24689;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_MAX_TORQUE_6072 = 24690;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_MAX_TORQUE_6072_VALUE = 24690;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_TORQUE_DEMAND_VALUE_6074 = 24692;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_TORQUE_DEMAND_VALUE_6074_VALUE = 24692;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_MOTOR_RATED_TORQUE_6076 = 24694;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_MOTOR_RATED_TORQUE_6076_VALUE = 24694;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_ACTUAL_TORQUE_6077 = 24695;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_ACTUAL_TORQUE_6077_VALUE = 24695;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_ACTUAL_CURRENT_6078 = 24696;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_ACTUAL_CURRENT_6078_VALUE = 24696;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_DC_LINK_VOLTAGE_6079 = 24697;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_DC_LINK_VOLTAGE_6079_VALUE = 24697;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_TARGET_POSITION_607A = 24698;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_TARGET_POSITION_607A_VALUE = 24698;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_HOME_OFFSET_607C = 24700;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_HOME_OFFSET_607C_VALUE = 24700;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_SOFTWARE_POSITION_LIMIT_607D = 24701;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_SOFTWARE_POSITION_LIMIT_607D_VALUE = 24701;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_MAX_PROFILE_VELOCITY_607F = 24703;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_MAX_PROFILE_VELOCITY_607F_VALUE = 24703;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_PROFILE_VELOCITY_6081 = 24705;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_PROFILE_VELOCITY_6081_VALUE = 24705;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_PROFILE_ACCELERATION_6083 = 24707;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_PROFILE_ACCELERATION_6083_VALUE = 24707;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_PROFILE_DECELERATION_6084 = 24708;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_PROFILE_DECELERATION_6084_VALUE = 24708;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_QUICK_STOP_DECELERATION_6085 = 24709;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_QUICK_STOP_DECELERATION_6085_VALUE = 24709;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_TORQUE_SLOPE_6087 = 24711;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_TORQUE_SLOPE_6087_VALUE = 24711;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_GEAR_RATIO_6091 = 24721;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_GEAR_RATIO_6091_VALUE = 24721;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_VELOCITY_OFFSET_60B1 = 24753;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_VELOCITY_OFFSET_60B1_VALUE = 24753;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_TORQUE_OFFSET_60B2 = 24754;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_TORQUE_OFFSET_60B2_VALUE = 24754;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_INTERPOLATION_DATA_RECORD_60C1 = 24769;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_INTERPOLATION_DATA_RECORD_60C1_VALUE = 24769;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_INTERPOLATION_TIME_PERIOD_60C2 = 24770;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_INTERPOLATION_TIME_PERIOD_60C2_VALUE = 24770;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_FOLLOWING_ERROR_ACTUAL_VALUE_60F4 = 24820;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_FOLLOWING_ERROR_ACTUAL_VALUE_60F4_VALUE = 24820;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_TARGET_VELOCITY_60FF = 24831;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_TARGET_VELOCITY_60FF_VALUE = 24831;
|
||||||
|
/**
|
||||||
|
* <code>CIA402_SUPPORTED_DRIVE_MODES_6502 = 25858;</code>
|
||||||
|
*/
|
||||||
|
public static final int CIA402_SUPPORTED_DRIVE_MODES_6502_VALUE = 25858;
|
||||||
|
|
||||||
|
|
||||||
|
public final int getNumber() {
|
||||||
|
if (this == UNRECOGNIZED) {
|
||||||
|
throw new java.lang.IllegalArgumentException(
|
||||||
|
"Can't get the number of an unknown enum value.");
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param value The numeric wire value of the corresponding enum entry.
|
||||||
|
* @return The enum associated with the given numeric wire value.
|
||||||
|
* @deprecated Use {@link #forNumber(int)} instead.
|
||||||
|
*/
|
||||||
|
@java.lang.Deprecated
|
||||||
|
public static Cia402ObjectIndex valueOf(int value) {
|
||||||
|
return forNumber(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param value The numeric wire value of the corresponding enum entry.
|
||||||
|
* @return The enum associated with the given numeric wire value.
|
||||||
|
*/
|
||||||
|
public static Cia402ObjectIndex forNumber(int value) {
|
||||||
|
switch (value) {
|
||||||
|
case 0: return CIA402_OBJECT_INDEX_ZERO;
|
||||||
|
case 24639: return CIA402_ERROR_CODE_603F;
|
||||||
|
case 24640: return CIA402_CONTROL_WORD_6040;
|
||||||
|
case 24641: return CIA402_STATUS_WORD_6041;
|
||||||
|
case 24666: return CIA402_QUICK_STOP_OPTION_605A;
|
||||||
|
case 24667: return CIA402_SHUTDOWN_OPTION_605B;
|
||||||
|
case 24668: return CIA402_DISABLE_OPERATION_OPTION_605C;
|
||||||
|
case 24669: return CIA402_HALT_OPTION_605D;
|
||||||
|
case 24670: return CIA402_FAULT_REACTION_OPTION_605E;
|
||||||
|
case 24672: return CIA402_OPERATION_MODE_6060;
|
||||||
|
case 24673: return CIA402_MODE_DISPLAY_6061;
|
||||||
|
case 24674: return CIA402_POSITION_DEMAND_VALUE_6062;
|
||||||
|
case 24676: return CIA402_ACTUAL_POSITION_6064;
|
||||||
|
case 24677: return CIA402_MAX_FOLLOWING_ERROR_6065;
|
||||||
|
case 24679: return CIA402_POSITION_WINDOW_6067;
|
||||||
|
case 24680: return CIA402_POSITION_WINDOW_TIME_6068;
|
||||||
|
case 24683: return CIA402_VELOCITY_DEMAND_VALUE_606B;
|
||||||
|
case 24684: return CIA402_ACTUAL_VELOCITY_606C;
|
||||||
|
case 24685: return CIA402_VELOCITY_WINDOW_606D;
|
||||||
|
case 24686: return CIA402_VELOCITY_WINDOW_TIME_606E;
|
||||||
|
case 24687: return CIA402_VELOCITY_THRESHOLD_606F;
|
||||||
|
case 24688: return CIA402_VELOCITY_THRESHOLD_TIME_6070;
|
||||||
|
case 24689: return CIA402_TARGET_TORQUE_6071;
|
||||||
|
case 24690: return CIA402_MAX_TORQUE_6072;
|
||||||
|
case 24692: return CIA402_TORQUE_DEMAND_VALUE_6074;
|
||||||
|
case 24694: return CIA402_MOTOR_RATED_TORQUE_6076;
|
||||||
|
case 24695: return CIA402_ACTUAL_TORQUE_6077;
|
||||||
|
case 24696: return CIA402_ACTUAL_CURRENT_6078;
|
||||||
|
case 24697: return CIA402_DC_LINK_VOLTAGE_6079;
|
||||||
|
case 24698: return CIA402_TARGET_POSITION_607A;
|
||||||
|
case 24700: return CIA402_HOME_OFFSET_607C;
|
||||||
|
case 24701: return CIA402_SOFTWARE_POSITION_LIMIT_607D;
|
||||||
|
case 24703: return CIA402_MAX_PROFILE_VELOCITY_607F;
|
||||||
|
case 24705: return CIA402_PROFILE_VELOCITY_6081;
|
||||||
|
case 24707: return CIA402_PROFILE_ACCELERATION_6083;
|
||||||
|
case 24708: return CIA402_PROFILE_DECELERATION_6084;
|
||||||
|
case 24709: return CIA402_QUICK_STOP_DECELERATION_6085;
|
||||||
|
case 24711: return CIA402_TORQUE_SLOPE_6087;
|
||||||
|
case 24721: return CIA402_GEAR_RATIO_6091;
|
||||||
|
case 24753: return CIA402_VELOCITY_OFFSET_60B1;
|
||||||
|
case 24754: return CIA402_TORQUE_OFFSET_60B2;
|
||||||
|
case 24769: return CIA402_INTERPOLATION_DATA_RECORD_60C1;
|
||||||
|
case 24770: return CIA402_INTERPOLATION_TIME_PERIOD_60C2;
|
||||||
|
case 24820: return CIA402_FOLLOWING_ERROR_ACTUAL_VALUE_60F4;
|
||||||
|
case 24831: return CIA402_TARGET_VELOCITY_60FF;
|
||||||
|
case 25858: return CIA402_SUPPORTED_DRIVE_MODES_6502;
|
||||||
|
default: return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static com.google.protobuf.Internal.EnumLiteMap<Cia402ObjectIndex>
|
||||||
|
internalGetValueMap() {
|
||||||
|
return internalValueMap;
|
||||||
|
}
|
||||||
|
private static final com.google.protobuf.Internal.EnumLiteMap<
|
||||||
|
Cia402ObjectIndex> internalValueMap =
|
||||||
|
new com.google.protobuf.Internal.EnumLiteMap<Cia402ObjectIndex>() {
|
||||||
|
public Cia402ObjectIndex findValueByNumber(int number) {
|
||||||
|
return Cia402ObjectIndex.forNumber(number);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public final com.google.protobuf.Descriptors.EnumValueDescriptor
|
||||||
|
getValueDescriptor() {
|
||||||
|
if (this == UNRECOGNIZED) {
|
||||||
|
throw new java.lang.IllegalStateException(
|
||||||
|
"Can't get the descriptor of an unrecognized enum value.");
|
||||||
|
}
|
||||||
|
return getDescriptor().getValues().get(ordinal());
|
||||||
|
}
|
||||||
|
public final com.google.protobuf.Descriptors.EnumDescriptor
|
||||||
|
getDescriptorForType() {
|
||||||
|
return getDescriptor();
|
||||||
|
}
|
||||||
|
public static final com.google.protobuf.Descriptors.EnumDescriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return cmvr.msgs.Cia402.getDescriptor().getEnumTypes().get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Cia402ObjectIndex[] VALUES = values();
|
||||||
|
|
||||||
|
public static Cia402ObjectIndex valueOf(
|
||||||
|
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
|
||||||
|
if (desc.getType() != getDescriptor()) {
|
||||||
|
throw new java.lang.IllegalArgumentException(
|
||||||
|
"EnumValueDescriptor is not for this type.");
|
||||||
|
}
|
||||||
|
if (desc.getIndex() == -1) {
|
||||||
|
return UNRECOGNIZED;
|
||||||
|
}
|
||||||
|
return VALUES[desc.getIndex()];
|
||||||
|
}
|
||||||
|
|
||||||
|
private final int value;
|
||||||
|
|
||||||
|
private Cia402ObjectIndex(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(enum_scope:cmvr.msgs.Cia402ObjectIndex)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return descriptor;
|
||||||
|
}
|
||||||
|
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
descriptor;
|
||||||
|
static {
|
||||||
|
java.lang.String[] descriptorData = {
|
||||||
|
"\n\026cmvr/msgs/cia402.proto\022\tcmvr.msgs*\260\r\n\021" +
|
||||||
|
"Cia402ObjectIndex\022\034\n\030CIA402_OBJECT_INDEX" +
|
||||||
|
"_ZERO\020\000\022\034\n\026CIA402_ERROR_CODE_603F\020\277\300\001\022\036\n" +
|
||||||
|
"\030CIA402_CONTROL_WORD_6040\020\300\300\001\022\035\n\027CIA402_" +
|
||||||
|
"STATUS_WORD_6041\020\301\300\001\022#\n\035CIA402_QUICK_STO" +
|
||||||
|
"P_OPTION_605A\020\332\300\001\022!\n\033CIA402_SHUTDOWN_OPT" +
|
||||||
|
"ION_605B\020\333\300\001\022*\n$CIA402_DISABLE_OPERATION" +
|
||||||
|
"_OPTION_605C\020\334\300\001\022\035\n\027CIA402_HALT_OPTION_6" +
|
||||||
|
"05D\020\335\300\001\022\'\n!CIA402_FAULT_REACTION_OPTION_" +
|
||||||
|
"605E\020\336\300\001\022 \n\032CIA402_OPERATION_MODE_6060\020\340" +
|
||||||
|
"\300\001\022\036\n\030CIA402_MODE_DISPLAY_6061\020\341\300\001\022\'\n!CI" +
|
||||||
|
"A402_POSITION_DEMAND_VALUE_6062\020\342\300\001\022!\n\033C" +
|
||||||
|
"IA402_ACTUAL_POSITION_6064\020\344\300\001\022%\n\037CIA402" +
|
||||||
|
"_MAX_FOLLOWING_ERROR_6065\020\345\300\001\022!\n\033CIA402_" +
|
||||||
|
"POSITION_WINDOW_6067\020\347\300\001\022&\n CIA402_POSIT" +
|
||||||
|
"ION_WINDOW_TIME_6068\020\350\300\001\022\'\n!CIA402_VELOC" +
|
||||||
|
"ITY_DEMAND_VALUE_606B\020\353\300\001\022!\n\033CIA402_ACTU" +
|
||||||
|
"AL_VELOCITY_606C\020\354\300\001\022!\n\033CIA402_VELOCITY_" +
|
||||||
|
"WINDOW_606D\020\355\300\001\022&\n CIA402_VELOCITY_WINDO" +
|
||||||
|
"W_TIME_606E\020\356\300\001\022$\n\036CIA402_VELOCITY_THRES" +
|
||||||
|
"HOLD_606F\020\357\300\001\022)\n#CIA402_VELOCITY_THRESHO" +
|
||||||
|
"LD_TIME_6070\020\360\300\001\022\037\n\031CIA402_TARGET_TORQUE" +
|
||||||
|
"_6071\020\361\300\001\022\034\n\026CIA402_MAX_TORQUE_6072\020\362\300\001\022" +
|
||||||
|
"%\n\037CIA402_TORQUE_DEMAND_VALUE_6074\020\364\300\001\022$" +
|
||||||
|
"\n\036CIA402_MOTOR_RATED_TORQUE_6076\020\366\300\001\022\037\n\031" +
|
||||||
|
"CIA402_ACTUAL_TORQUE_6077\020\367\300\001\022 \n\032CIA402_" +
|
||||||
|
"ACTUAL_CURRENT_6078\020\370\300\001\022!\n\033CIA402_DC_LIN" +
|
||||||
|
"K_VOLTAGE_6079\020\371\300\001\022!\n\033CIA402_TARGET_POSI" +
|
||||||
|
"TION_607A\020\372\300\001\022\035\n\027CIA402_HOME_OFFSET_607C" +
|
||||||
|
"\020\374\300\001\022)\n#CIA402_SOFTWARE_POSITION_LIMIT_6" +
|
||||||
|
"07D\020\375\300\001\022&\n CIA402_MAX_PROFILE_VELOCITY_6" +
|
||||||
|
"07F\020\377\300\001\022\"\n\034CIA402_PROFILE_VELOCITY_6081\020" +
|
||||||
|
"\201\301\001\022&\n CIA402_PROFILE_ACCELERATION_6083\020" +
|
||||||
|
"\203\301\001\022&\n CIA402_PROFILE_DECELERATION_6084\020" +
|
||||||
|
"\204\301\001\022)\n#CIA402_QUICK_STOP_DECELERATION_60" +
|
||||||
|
"85\020\205\301\001\022\036\n\030CIA402_TORQUE_SLOPE_6087\020\207\301\001\022\034" +
|
||||||
|
"\n\026CIA402_GEAR_RATIO_6091\020\221\301\001\022!\n\033CIA402_V" +
|
||||||
|
"ELOCITY_OFFSET_60B1\020\261\301\001\022\037\n\031CIA402_TORQUE" +
|
||||||
|
"_OFFSET_60B2\020\262\301\001\022+\n%CIA402_INTERPOLATION" +
|
||||||
|
"_DATA_RECORD_60C1\020\301\301\001\022+\n%CIA402_INTERPOL" +
|
||||||
|
"ATION_TIME_PERIOD_60C2\020\302\301\001\022.\n(CIA402_FOL" +
|
||||||
|
"LOWING_ERROR_ACTUAL_VALUE_60F4\020\364\301\001\022!\n\033CI" +
|
||||||
|
"A402_TARGET_VELOCITY_60FF\020\377\301\001\022\'\n!CIA402_" +
|
||||||
|
"SUPPORTED_DRIVE_MODES_6502\020\202\312\001b\006proto3"
|
||||||
|
};
|
||||||
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
|
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(outer_class_scope)
|
||||||
|
}
|
||||||
@ -0,0 +1,909 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: cmvr/msgs/error_code.proto
|
||||||
|
|
||||||
|
package cmvr.msgs;
|
||||||
|
|
||||||
|
public final class ErrorCodeOuterClass {
|
||||||
|
private ErrorCodeOuterClass() {}
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistry registry) {
|
||||||
|
registerAllExtensions(
|
||||||
|
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* Error codes enum for API's categorized by modules.
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* Protobuf enum {@code cmvr.msgs.ErrorCode}
|
||||||
|
*/
|
||||||
|
public enum ErrorCode
|
||||||
|
implements com.google.protobuf.ProtocolMessageEnum {
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* No error, returns on success.
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>OK = 0;</code>
|
||||||
|
*/
|
||||||
|
OK(0),
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* Canbus module error codes start from here.
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>CANBUS_ERROR = 2000;</code>
|
||||||
|
*/
|
||||||
|
CANBUS_ERROR(2000),
|
||||||
|
/**
|
||||||
|
* <code>CAN_CLIENT_ERROR_BASE = 2100;</code>
|
||||||
|
*/
|
||||||
|
CAN_CLIENT_ERROR_BASE(2100),
|
||||||
|
/**
|
||||||
|
* <code>CAN_CLIENT_ERROR_OPEN_DEVICE_FAILED = 2101;</code>
|
||||||
|
*/
|
||||||
|
CAN_CLIENT_ERROR_OPEN_DEVICE_FAILED(2101),
|
||||||
|
/**
|
||||||
|
* <code>CAN_CLIENT_ERROR_FRAME_NUM = 2102;</code>
|
||||||
|
*/
|
||||||
|
CAN_CLIENT_ERROR_FRAME_NUM(2102),
|
||||||
|
/**
|
||||||
|
* <code>CAN_CLIENT_ERROR_SEND_FAILED = 2103;</code>
|
||||||
|
*/
|
||||||
|
CAN_CLIENT_ERROR_SEND_FAILED(2103),
|
||||||
|
/**
|
||||||
|
* <code>CAN_CLIENT_ERROR_RECV_FAILED = 2104;</code>
|
||||||
|
*/
|
||||||
|
CAN_CLIENT_ERROR_RECV_FAILED(2104),
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* motor
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>MOTOR_ERROR = 3000;</code>
|
||||||
|
*/
|
||||||
|
MOTOR_ERROR(3000),
|
||||||
|
/**
|
||||||
|
* <code>MOTOR_ERROR_SET_ZERO = 3001;</code>
|
||||||
|
*/
|
||||||
|
MOTOR_ERROR_SET_ZERO(3001),
|
||||||
|
UNRECOGNIZED(-1),
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* No error, returns on success.
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>OK = 0;</code>
|
||||||
|
*/
|
||||||
|
public static final int OK_VALUE = 0;
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* Canbus module error codes start from here.
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>CANBUS_ERROR = 2000;</code>
|
||||||
|
*/
|
||||||
|
public static final int CANBUS_ERROR_VALUE = 2000;
|
||||||
|
/**
|
||||||
|
* <code>CAN_CLIENT_ERROR_BASE = 2100;</code>
|
||||||
|
*/
|
||||||
|
public static final int CAN_CLIENT_ERROR_BASE_VALUE = 2100;
|
||||||
|
/**
|
||||||
|
* <code>CAN_CLIENT_ERROR_OPEN_DEVICE_FAILED = 2101;</code>
|
||||||
|
*/
|
||||||
|
public static final int CAN_CLIENT_ERROR_OPEN_DEVICE_FAILED_VALUE = 2101;
|
||||||
|
/**
|
||||||
|
* <code>CAN_CLIENT_ERROR_FRAME_NUM = 2102;</code>
|
||||||
|
*/
|
||||||
|
public static final int CAN_CLIENT_ERROR_FRAME_NUM_VALUE = 2102;
|
||||||
|
/**
|
||||||
|
* <code>CAN_CLIENT_ERROR_SEND_FAILED = 2103;</code>
|
||||||
|
*/
|
||||||
|
public static final int CAN_CLIENT_ERROR_SEND_FAILED_VALUE = 2103;
|
||||||
|
/**
|
||||||
|
* <code>CAN_CLIENT_ERROR_RECV_FAILED = 2104;</code>
|
||||||
|
*/
|
||||||
|
public static final int CAN_CLIENT_ERROR_RECV_FAILED_VALUE = 2104;
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* motor
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>MOTOR_ERROR = 3000;</code>
|
||||||
|
*/
|
||||||
|
public static final int MOTOR_ERROR_VALUE = 3000;
|
||||||
|
/**
|
||||||
|
* <code>MOTOR_ERROR_SET_ZERO = 3001;</code>
|
||||||
|
*/
|
||||||
|
public static final int MOTOR_ERROR_SET_ZERO_VALUE = 3001;
|
||||||
|
|
||||||
|
|
||||||
|
public final int getNumber() {
|
||||||
|
if (this == UNRECOGNIZED) {
|
||||||
|
throw new java.lang.IllegalArgumentException(
|
||||||
|
"Can't get the number of an unknown enum value.");
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param value The numeric wire value of the corresponding enum entry.
|
||||||
|
* @return The enum associated with the given numeric wire value.
|
||||||
|
* @deprecated Use {@link #forNumber(int)} instead.
|
||||||
|
*/
|
||||||
|
@java.lang.Deprecated
|
||||||
|
public static ErrorCode valueOf(int value) {
|
||||||
|
return forNumber(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param value The numeric wire value of the corresponding enum entry.
|
||||||
|
* @return The enum associated with the given numeric wire value.
|
||||||
|
*/
|
||||||
|
public static ErrorCode forNumber(int value) {
|
||||||
|
switch (value) {
|
||||||
|
case 0: return OK;
|
||||||
|
case 2000: return CANBUS_ERROR;
|
||||||
|
case 2100: return CAN_CLIENT_ERROR_BASE;
|
||||||
|
case 2101: return CAN_CLIENT_ERROR_OPEN_DEVICE_FAILED;
|
||||||
|
case 2102: return CAN_CLIENT_ERROR_FRAME_NUM;
|
||||||
|
case 2103: return CAN_CLIENT_ERROR_SEND_FAILED;
|
||||||
|
case 2104: return CAN_CLIENT_ERROR_RECV_FAILED;
|
||||||
|
case 3000: return MOTOR_ERROR;
|
||||||
|
case 3001: return MOTOR_ERROR_SET_ZERO;
|
||||||
|
default: return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static com.google.protobuf.Internal.EnumLiteMap<ErrorCode>
|
||||||
|
internalGetValueMap() {
|
||||||
|
return internalValueMap;
|
||||||
|
}
|
||||||
|
private static final com.google.protobuf.Internal.EnumLiteMap<
|
||||||
|
ErrorCode> internalValueMap =
|
||||||
|
new com.google.protobuf.Internal.EnumLiteMap<ErrorCode>() {
|
||||||
|
public ErrorCode findValueByNumber(int number) {
|
||||||
|
return ErrorCode.forNumber(number);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public final com.google.protobuf.Descriptors.EnumValueDescriptor
|
||||||
|
getValueDescriptor() {
|
||||||
|
if (this == UNRECOGNIZED) {
|
||||||
|
throw new java.lang.IllegalStateException(
|
||||||
|
"Can't get the descriptor of an unrecognized enum value.");
|
||||||
|
}
|
||||||
|
return getDescriptor().getValues().get(ordinal());
|
||||||
|
}
|
||||||
|
public final com.google.protobuf.Descriptors.EnumDescriptor
|
||||||
|
getDescriptorForType() {
|
||||||
|
return getDescriptor();
|
||||||
|
}
|
||||||
|
public static final com.google.protobuf.Descriptors.EnumDescriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return cmvr.msgs.ErrorCodeOuterClass.getDescriptor().getEnumTypes().get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final ErrorCode[] VALUES = values();
|
||||||
|
|
||||||
|
public static ErrorCode valueOf(
|
||||||
|
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
|
||||||
|
if (desc.getType() != getDescriptor()) {
|
||||||
|
throw new java.lang.IllegalArgumentException(
|
||||||
|
"EnumValueDescriptor is not for this type.");
|
||||||
|
}
|
||||||
|
if (desc.getIndex() == -1) {
|
||||||
|
return UNRECOGNIZED;
|
||||||
|
}
|
||||||
|
return VALUES[desc.getIndex()];
|
||||||
|
}
|
||||||
|
|
||||||
|
private final int value;
|
||||||
|
|
||||||
|
private ErrorCode(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(enum_scope:cmvr.msgs.ErrorCode)
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface StatusPbOrBuilder extends
|
||||||
|
// @@protoc_insertion_point(interface_extends:cmvr.msgs.StatusPb)
|
||||||
|
com.google.protobuf.MessageOrBuilder {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>.cmvr.msgs.ErrorCode error_code = 1;</code>
|
||||||
|
* @return The enum numeric value on the wire for errorCode.
|
||||||
|
*/
|
||||||
|
int getErrorCodeValue();
|
||||||
|
/**
|
||||||
|
* <code>.cmvr.msgs.ErrorCode error_code = 1;</code>
|
||||||
|
* @return The errorCode.
|
||||||
|
*/
|
||||||
|
cmvr.msgs.ErrorCodeOuterClass.ErrorCode getErrorCode();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>string msg = 2;</code>
|
||||||
|
* @return The msg.
|
||||||
|
*/
|
||||||
|
java.lang.String getMsg();
|
||||||
|
/**
|
||||||
|
* <code>string msg = 2;</code>
|
||||||
|
* @return The bytes for msg.
|
||||||
|
*/
|
||||||
|
com.google.protobuf.ByteString
|
||||||
|
getMsgBytes();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Protobuf type {@code cmvr.msgs.StatusPb}
|
||||||
|
*/
|
||||||
|
public static final class StatusPb extends
|
||||||
|
com.google.protobuf.GeneratedMessageV3 implements
|
||||||
|
// @@protoc_insertion_point(message_implements:cmvr.msgs.StatusPb)
|
||||||
|
StatusPbOrBuilder {
|
||||||
|
private static final long serialVersionUID = 0L;
|
||||||
|
// Use StatusPb.newBuilder() to construct.
|
||||||
|
private StatusPb(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||||
|
super(builder);
|
||||||
|
}
|
||||||
|
private StatusPb() {
|
||||||
|
errorCode_ = 0;
|
||||||
|
msg_ = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@SuppressWarnings({"unused"})
|
||||||
|
protected java.lang.Object newInstance(
|
||||||
|
UnusedPrivateParameter unused) {
|
||||||
|
return new StatusPb();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public final com.google.protobuf.UnknownFieldSet
|
||||||
|
getUnknownFields() {
|
||||||
|
return this.unknownFields;
|
||||||
|
}
|
||||||
|
public static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return cmvr.msgs.ErrorCodeOuterClass.internal_static_cmvr_msgs_StatusPb_descriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internalGetFieldAccessorTable() {
|
||||||
|
return cmvr.msgs.ErrorCodeOuterClass.internal_static_cmvr_msgs_StatusPb_fieldAccessorTable
|
||||||
|
.ensureFieldAccessorsInitialized(
|
||||||
|
cmvr.msgs.ErrorCodeOuterClass.StatusPb.class, cmvr.msgs.ErrorCodeOuterClass.StatusPb.Builder.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final int ERROR_CODE_FIELD_NUMBER = 1;
|
||||||
|
private int errorCode_;
|
||||||
|
/**
|
||||||
|
* <code>.cmvr.msgs.ErrorCode error_code = 1;</code>
|
||||||
|
* @return The enum numeric value on the wire for errorCode.
|
||||||
|
*/
|
||||||
|
@java.lang.Override public int getErrorCodeValue() {
|
||||||
|
return errorCode_;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>.cmvr.msgs.ErrorCode error_code = 1;</code>
|
||||||
|
* @return The errorCode.
|
||||||
|
*/
|
||||||
|
@java.lang.Override public cmvr.msgs.ErrorCodeOuterClass.ErrorCode getErrorCode() {
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
cmvr.msgs.ErrorCodeOuterClass.ErrorCode result = cmvr.msgs.ErrorCodeOuterClass.ErrorCode.valueOf(errorCode_);
|
||||||
|
return result == null ? cmvr.msgs.ErrorCodeOuterClass.ErrorCode.UNRECOGNIZED : result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final int MSG_FIELD_NUMBER = 2;
|
||||||
|
private volatile java.lang.Object msg_;
|
||||||
|
/**
|
||||||
|
* <code>string msg = 2;</code>
|
||||||
|
* @return The msg.
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
public java.lang.String getMsg() {
|
||||||
|
java.lang.Object ref = msg_;
|
||||||
|
if (ref instanceof java.lang.String) {
|
||||||
|
return (java.lang.String) ref;
|
||||||
|
} else {
|
||||||
|
com.google.protobuf.ByteString bs =
|
||||||
|
(com.google.protobuf.ByteString) ref;
|
||||||
|
java.lang.String s = bs.toStringUtf8();
|
||||||
|
msg_ = s;
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>string msg = 2;</code>
|
||||||
|
* @return The bytes for msg.
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.ByteString
|
||||||
|
getMsgBytes() {
|
||||||
|
java.lang.Object ref = msg_;
|
||||||
|
if (ref instanceof java.lang.String) {
|
||||||
|
com.google.protobuf.ByteString b =
|
||||||
|
com.google.protobuf.ByteString.copyFromUtf8(
|
||||||
|
(java.lang.String) ref);
|
||||||
|
msg_ = b;
|
||||||
|
return b;
|
||||||
|
} else {
|
||||||
|
return (com.google.protobuf.ByteString) ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte memoizedIsInitialized = -1;
|
||||||
|
@java.lang.Override
|
||||||
|
public final boolean isInitialized() {
|
||||||
|
byte isInitialized = memoizedIsInitialized;
|
||||||
|
if (isInitialized == 1) return true;
|
||||||
|
if (isInitialized == 0) return false;
|
||||||
|
|
||||||
|
memoizedIsInitialized = 1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||||
|
throws java.io.IOException {
|
||||||
|
if (errorCode_ != cmvr.msgs.ErrorCodeOuterClass.ErrorCode.OK.getNumber()) {
|
||||||
|
output.writeEnum(1, errorCode_);
|
||||||
|
}
|
||||||
|
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msg_)) {
|
||||||
|
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, msg_);
|
||||||
|
}
|
||||||
|
getUnknownFields().writeTo(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public int getSerializedSize() {
|
||||||
|
int size = memoizedSize;
|
||||||
|
if (size != -1) return size;
|
||||||
|
|
||||||
|
size = 0;
|
||||||
|
if (errorCode_ != cmvr.msgs.ErrorCodeOuterClass.ErrorCode.OK.getNumber()) {
|
||||||
|
size += com.google.protobuf.CodedOutputStream
|
||||||
|
.computeEnumSize(1, errorCode_);
|
||||||
|
}
|
||||||
|
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msg_)) {
|
||||||
|
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, msg_);
|
||||||
|
}
|
||||||
|
size += getUnknownFields().getSerializedSize();
|
||||||
|
memoizedSize = size;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public boolean equals(final java.lang.Object obj) {
|
||||||
|
if (obj == this) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof cmvr.msgs.ErrorCodeOuterClass.StatusPb)) {
|
||||||
|
return super.equals(obj);
|
||||||
|
}
|
||||||
|
cmvr.msgs.ErrorCodeOuterClass.StatusPb other = (cmvr.msgs.ErrorCodeOuterClass.StatusPb) obj;
|
||||||
|
|
||||||
|
if (errorCode_ != other.errorCode_) return false;
|
||||||
|
if (!getMsg()
|
||||||
|
.equals(other.getMsg())) return false;
|
||||||
|
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public int hashCode() {
|
||||||
|
if (memoizedHashCode != 0) {
|
||||||
|
return memoizedHashCode;
|
||||||
|
}
|
||||||
|
int hash = 41;
|
||||||
|
hash = (19 * hash) + getDescriptor().hashCode();
|
||||||
|
hash = (37 * hash) + ERROR_CODE_FIELD_NUMBER;
|
||||||
|
hash = (53 * hash) + errorCode_;
|
||||||
|
hash = (37 * hash) + MSG_FIELD_NUMBER;
|
||||||
|
hash = (53 * hash) + getMsg().hashCode();
|
||||||
|
hash = (29 * hash) + getUnknownFields().hashCode();
|
||||||
|
memoizedHashCode = hash;
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static cmvr.msgs.ErrorCodeOuterClass.StatusPb parseFrom(
|
||||||
|
java.nio.ByteBuffer data)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.ErrorCodeOuterClass.StatusPb parseFrom(
|
||||||
|
java.nio.ByteBuffer data,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.ErrorCodeOuterClass.StatusPb parseFrom(
|
||||||
|
com.google.protobuf.ByteString data)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.ErrorCodeOuterClass.StatusPb parseFrom(
|
||||||
|
com.google.protobuf.ByteString data,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.ErrorCodeOuterClass.StatusPb parseFrom(byte[] data)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.ErrorCodeOuterClass.StatusPb parseFrom(
|
||||||
|
byte[] data,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.ErrorCodeOuterClass.StatusPb parseFrom(java.io.InputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.ErrorCodeOuterClass.StatusPb parseFrom(
|
||||||
|
java.io.InputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.ErrorCodeOuterClass.StatusPb parseDelimitedFrom(java.io.InputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseDelimitedWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.ErrorCodeOuterClass.StatusPb parseDelimitedFrom(
|
||||||
|
java.io.InputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.ErrorCodeOuterClass.StatusPb parseFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.ErrorCodeOuterClass.StatusPb parseFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder newBuilderForType() { return newBuilder(); }
|
||||||
|
public static Builder newBuilder() {
|
||||||
|
return DEFAULT_INSTANCE.toBuilder();
|
||||||
|
}
|
||||||
|
public static Builder newBuilder(cmvr.msgs.ErrorCodeOuterClass.StatusPb prototype) {
|
||||||
|
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder toBuilder() {
|
||||||
|
return this == DEFAULT_INSTANCE
|
||||||
|
? new Builder() : new Builder().mergeFrom(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected Builder newBuilderForType(
|
||||||
|
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||||
|
Builder builder = new Builder(parent);
|
||||||
|
return builder;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Protobuf type {@code cmvr.msgs.StatusPb}
|
||||||
|
*/
|
||||||
|
public static final class Builder extends
|
||||||
|
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
||||||
|
// @@protoc_insertion_point(builder_implements:cmvr.msgs.StatusPb)
|
||||||
|
cmvr.msgs.ErrorCodeOuterClass.StatusPbOrBuilder {
|
||||||
|
public static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return cmvr.msgs.ErrorCodeOuterClass.internal_static_cmvr_msgs_StatusPb_descriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internalGetFieldAccessorTable() {
|
||||||
|
return cmvr.msgs.ErrorCodeOuterClass.internal_static_cmvr_msgs_StatusPb_fieldAccessorTable
|
||||||
|
.ensureFieldAccessorsInitialized(
|
||||||
|
cmvr.msgs.ErrorCodeOuterClass.StatusPb.class, cmvr.msgs.ErrorCodeOuterClass.StatusPb.Builder.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Construct using cmvr.msgs.ErrorCodeOuterClass.StatusPb.newBuilder()
|
||||||
|
private Builder() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private Builder(
|
||||||
|
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||||
|
super(parent);
|
||||||
|
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clear() {
|
||||||
|
super.clear();
|
||||||
|
errorCode_ = 0;
|
||||||
|
|
||||||
|
msg_ = "";
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.Descriptor
|
||||||
|
getDescriptorForType() {
|
||||||
|
return cmvr.msgs.ErrorCodeOuterClass.internal_static_cmvr_msgs_StatusPb_descriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public cmvr.msgs.ErrorCodeOuterClass.StatusPb getDefaultInstanceForType() {
|
||||||
|
return cmvr.msgs.ErrorCodeOuterClass.StatusPb.getDefaultInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public cmvr.msgs.ErrorCodeOuterClass.StatusPb build() {
|
||||||
|
cmvr.msgs.ErrorCodeOuterClass.StatusPb result = buildPartial();
|
||||||
|
if (!result.isInitialized()) {
|
||||||
|
throw newUninitializedMessageException(result);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public cmvr.msgs.ErrorCodeOuterClass.StatusPb buildPartial() {
|
||||||
|
cmvr.msgs.ErrorCodeOuterClass.StatusPb result = new cmvr.msgs.ErrorCodeOuterClass.StatusPb(this);
|
||||||
|
result.errorCode_ = errorCode_;
|
||||||
|
result.msg_ = msg_;
|
||||||
|
onBuilt();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clone() {
|
||||||
|
return super.clone();
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder setField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
|
java.lang.Object value) {
|
||||||
|
return super.setField(field, value);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clearField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field) {
|
||||||
|
return super.clearField(field);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clearOneof(
|
||||||
|
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
|
||||||
|
return super.clearOneof(oneof);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder setRepeatedField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
|
int index, java.lang.Object value) {
|
||||||
|
return super.setRepeatedField(field, index, value);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder addRepeatedField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
|
java.lang.Object value) {
|
||||||
|
return super.addRepeatedField(field, value);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||||
|
if (other instanceof cmvr.msgs.ErrorCodeOuterClass.StatusPb) {
|
||||||
|
return mergeFrom((cmvr.msgs.ErrorCodeOuterClass.StatusPb)other);
|
||||||
|
} else {
|
||||||
|
super.mergeFrom(other);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder mergeFrom(cmvr.msgs.ErrorCodeOuterClass.StatusPb other) {
|
||||||
|
if (other == cmvr.msgs.ErrorCodeOuterClass.StatusPb.getDefaultInstance()) return this;
|
||||||
|
if (other.errorCode_ != 0) {
|
||||||
|
setErrorCodeValue(other.getErrorCodeValue());
|
||||||
|
}
|
||||||
|
if (!other.getMsg().isEmpty()) {
|
||||||
|
msg_ = other.msg_;
|
||||||
|
onChanged();
|
||||||
|
}
|
||||||
|
this.mergeUnknownFields(other.getUnknownFields());
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public final boolean isInitialized() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder mergeFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
if (extensionRegistry == null) {
|
||||||
|
throw new java.lang.NullPointerException();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
boolean done = false;
|
||||||
|
while (!done) {
|
||||||
|
int tag = input.readTag();
|
||||||
|
switch (tag) {
|
||||||
|
case 0:
|
||||||
|
done = true;
|
||||||
|
break;
|
||||||
|
case 8: {
|
||||||
|
errorCode_ = input.readEnum();
|
||||||
|
|
||||||
|
break;
|
||||||
|
} // case 8
|
||||||
|
case 18: {
|
||||||
|
msg_ = input.readStringRequireUtf8();
|
||||||
|
|
||||||
|
break;
|
||||||
|
} // case 18
|
||||||
|
default: {
|
||||||
|
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
|
||||||
|
done = true; // was an endgroup tag
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
} // default:
|
||||||
|
} // switch (tag)
|
||||||
|
} // while (!done)
|
||||||
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||||
|
throw e.unwrapIOException();
|
||||||
|
} finally {
|
||||||
|
onChanged();
|
||||||
|
} // finally
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int errorCode_ = 0;
|
||||||
|
/**
|
||||||
|
* <code>.cmvr.msgs.ErrorCode error_code = 1;</code>
|
||||||
|
* @return The enum numeric value on the wire for errorCode.
|
||||||
|
*/
|
||||||
|
@java.lang.Override public int getErrorCodeValue() {
|
||||||
|
return errorCode_;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>.cmvr.msgs.ErrorCode error_code = 1;</code>
|
||||||
|
* @param value The enum numeric value on the wire for errorCode to set.
|
||||||
|
* @return This builder for chaining.
|
||||||
|
*/
|
||||||
|
public Builder setErrorCodeValue(int value) {
|
||||||
|
|
||||||
|
errorCode_ = value;
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>.cmvr.msgs.ErrorCode error_code = 1;</code>
|
||||||
|
* @return The errorCode.
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
public cmvr.msgs.ErrorCodeOuterClass.ErrorCode getErrorCode() {
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
cmvr.msgs.ErrorCodeOuterClass.ErrorCode result = cmvr.msgs.ErrorCodeOuterClass.ErrorCode.valueOf(errorCode_);
|
||||||
|
return result == null ? cmvr.msgs.ErrorCodeOuterClass.ErrorCode.UNRECOGNIZED : result;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>.cmvr.msgs.ErrorCode error_code = 1;</code>
|
||||||
|
* @param value The errorCode to set.
|
||||||
|
* @return This builder for chaining.
|
||||||
|
*/
|
||||||
|
public Builder setErrorCode(cmvr.msgs.ErrorCodeOuterClass.ErrorCode value) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
|
||||||
|
errorCode_ = value.getNumber();
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>.cmvr.msgs.ErrorCode error_code = 1;</code>
|
||||||
|
* @return This builder for chaining.
|
||||||
|
*/
|
||||||
|
public Builder clearErrorCode() {
|
||||||
|
|
||||||
|
errorCode_ = 0;
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private java.lang.Object msg_ = "";
|
||||||
|
/**
|
||||||
|
* <code>string msg = 2;</code>
|
||||||
|
* @return The msg.
|
||||||
|
*/
|
||||||
|
public java.lang.String getMsg() {
|
||||||
|
java.lang.Object ref = msg_;
|
||||||
|
if (!(ref instanceof java.lang.String)) {
|
||||||
|
com.google.protobuf.ByteString bs =
|
||||||
|
(com.google.protobuf.ByteString) ref;
|
||||||
|
java.lang.String s = bs.toStringUtf8();
|
||||||
|
msg_ = s;
|
||||||
|
return s;
|
||||||
|
} else {
|
||||||
|
return (java.lang.String) ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>string msg = 2;</code>
|
||||||
|
* @return The bytes for msg.
|
||||||
|
*/
|
||||||
|
public com.google.protobuf.ByteString
|
||||||
|
getMsgBytes() {
|
||||||
|
java.lang.Object ref = msg_;
|
||||||
|
if (ref instanceof String) {
|
||||||
|
com.google.protobuf.ByteString b =
|
||||||
|
com.google.protobuf.ByteString.copyFromUtf8(
|
||||||
|
(java.lang.String) ref);
|
||||||
|
msg_ = b;
|
||||||
|
return b;
|
||||||
|
} else {
|
||||||
|
return (com.google.protobuf.ByteString) ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>string msg = 2;</code>
|
||||||
|
* @param value The msg to set.
|
||||||
|
* @return This builder for chaining.
|
||||||
|
*/
|
||||||
|
public Builder setMsg(
|
||||||
|
java.lang.String value) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
|
||||||
|
msg_ = value;
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>string msg = 2;</code>
|
||||||
|
* @return This builder for chaining.
|
||||||
|
*/
|
||||||
|
public Builder clearMsg() {
|
||||||
|
|
||||||
|
msg_ = getDefaultInstance().getMsg();
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>string msg = 2;</code>
|
||||||
|
* @param value The bytes for msg to set.
|
||||||
|
* @return This builder for chaining.
|
||||||
|
*/
|
||||||
|
public Builder setMsgBytes(
|
||||||
|
com.google.protobuf.ByteString value) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
checkByteStringIsUtf8(value);
|
||||||
|
|
||||||
|
msg_ = value;
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public final Builder setUnknownFields(
|
||||||
|
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||||
|
return super.setUnknownFields(unknownFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public final Builder mergeUnknownFields(
|
||||||
|
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||||
|
return super.mergeUnknownFields(unknownFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(builder_scope:cmvr.msgs.StatusPb)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(class_scope:cmvr.msgs.StatusPb)
|
||||||
|
private static final cmvr.msgs.ErrorCodeOuterClass.StatusPb DEFAULT_INSTANCE;
|
||||||
|
static {
|
||||||
|
DEFAULT_INSTANCE = new cmvr.msgs.ErrorCodeOuterClass.StatusPb();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static cmvr.msgs.ErrorCodeOuterClass.StatusPb getDefaultInstance() {
|
||||||
|
return DEFAULT_INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final com.google.protobuf.Parser<StatusPb>
|
||||||
|
PARSER = new com.google.protobuf.AbstractParser<StatusPb>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public StatusPb parsePartialFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
Builder builder = newBuilder();
|
||||||
|
try {
|
||||||
|
builder.mergeFrom(input, extensionRegistry);
|
||||||
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||||
|
throw e.setUnfinishedMessage(builder.buildPartial());
|
||||||
|
} catch (com.google.protobuf.UninitializedMessageException e) {
|
||||||
|
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
|
||||||
|
} catch (java.io.IOException e) {
|
||||||
|
throw new com.google.protobuf.InvalidProtocolBufferException(e)
|
||||||
|
.setUnfinishedMessage(builder.buildPartial());
|
||||||
|
}
|
||||||
|
return builder.buildPartial();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public static com.google.protobuf.Parser<StatusPb> parser() {
|
||||||
|
return PARSER;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Parser<StatusPb> getParserForType() {
|
||||||
|
return PARSER;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public cmvr.msgs.ErrorCodeOuterClass.StatusPb getDefaultInstanceForType() {
|
||||||
|
return DEFAULT_INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
internal_static_cmvr_msgs_StatusPb_descriptor;
|
||||||
|
private static final
|
||||||
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internal_static_cmvr_msgs_StatusPb_fieldAccessorTable;
|
||||||
|
|
||||||
|
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return descriptor;
|
||||||
|
}
|
||||||
|
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
descriptor;
|
||||||
|
static {
|
||||||
|
java.lang.String[] descriptorData = {
|
||||||
|
"\n\032cmvr/msgs/error_code.proto\022\tcmvr.msgs\"" +
|
||||||
|
"A\n\010StatusPb\022(\n\nerror_code\030\001 \001(\0162\024.cmvr.m" +
|
||||||
|
"sgs.ErrorCode\022\013\n\003msg\030\002 \001(\t*\200\002\n\tErrorCode" +
|
||||||
|
"\022\006\n\002OK\020\000\022\021\n\014CANBUS_ERROR\020\320\017\022\032\n\025CAN_CLIEN" +
|
||||||
|
"T_ERROR_BASE\020\264\020\022(\n#CAN_CLIENT_ERROR_OPEN" +
|
||||||
|
"_DEVICE_FAILED\020\265\020\022\037\n\032CAN_CLIENT_ERROR_FR" +
|
||||||
|
"AME_NUM\020\266\020\022!\n\034CAN_CLIENT_ERROR_SEND_FAIL" +
|
||||||
|
"ED\020\267\020\022!\n\034CAN_CLIENT_ERROR_RECV_FAILED\020\270\020" +
|
||||||
|
"\022\020\n\013MOTOR_ERROR\020\270\027\022\031\n\024MOTOR_ERROR_SET_ZE" +
|
||||||
|
"RO\020\271\027b\006proto3"
|
||||||
|
};
|
||||||
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
|
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||||
|
});
|
||||||
|
internal_static_cmvr_msgs_StatusPb_descriptor =
|
||||||
|
getDescriptor().getMessageTypes().get(0);
|
||||||
|
internal_static_cmvr_msgs_StatusPb_fieldAccessorTable = new
|
||||||
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||||
|
internal_static_cmvr_msgs_StatusPb_descriptor,
|
||||||
|
new java.lang.String[] { "ErrorCode", "Msg", });
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(outer_class_scope)
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,847 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: cmvr/msgs/robot_detail.proto
|
||||||
|
|
||||||
|
package cmvr.msgs;
|
||||||
|
|
||||||
|
public final class RobotDetailOuterClass {
|
||||||
|
private RobotDetailOuterClass() {}
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistry registry) {
|
||||||
|
registerAllExtensions(
|
||||||
|
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||||
|
}
|
||||||
|
public interface RobotDetailOrBuilder extends
|
||||||
|
// @@protoc_insertion_point(interface_extends:cmvr.msgs.RobotDetail)
|
||||||
|
com.google.protobuf.MessageOrBuilder {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
int getMotorsCount();
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
boolean containsMotors(
|
||||||
|
int key);
|
||||||
|
/**
|
||||||
|
* Use {@link #getMotorsMap()} instead.
|
||||||
|
*/
|
||||||
|
@java.lang.Deprecated
|
||||||
|
java.util.Map<java.lang.Integer, cmvr.msgs.Motor.MotorStatus>
|
||||||
|
getMotors();
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
java.util.Map<java.lang.Integer, cmvr.msgs.Motor.MotorStatus>
|
||||||
|
getMotorsMap();
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* nullable */
|
||||||
|
cmvr.msgs.Motor.MotorStatus getMotorsOrDefault(
|
||||||
|
int key,
|
||||||
|
/* nullable */
|
||||||
|
cmvr.msgs.Motor.MotorStatus defaultValue);
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
|
||||||
|
cmvr.msgs.Motor.MotorStatus getMotorsOrThrow(
|
||||||
|
int key);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Protobuf type {@code cmvr.msgs.RobotDetail}
|
||||||
|
*/
|
||||||
|
public static final class RobotDetail extends
|
||||||
|
com.google.protobuf.GeneratedMessageV3 implements
|
||||||
|
// @@protoc_insertion_point(message_implements:cmvr.msgs.RobotDetail)
|
||||||
|
RobotDetailOrBuilder {
|
||||||
|
private static final long serialVersionUID = 0L;
|
||||||
|
// Use RobotDetail.newBuilder() to construct.
|
||||||
|
private RobotDetail(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||||
|
super(builder);
|
||||||
|
}
|
||||||
|
private RobotDetail() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@SuppressWarnings({"unused"})
|
||||||
|
protected java.lang.Object newInstance(
|
||||||
|
UnusedPrivateParameter unused) {
|
||||||
|
return new RobotDetail();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public final com.google.protobuf.UnknownFieldSet
|
||||||
|
getUnknownFields() {
|
||||||
|
return this.unknownFields;
|
||||||
|
}
|
||||||
|
public static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return cmvr.msgs.RobotDetailOuterClass.internal_static_cmvr_msgs_RobotDetail_descriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings({"rawtypes"})
|
||||||
|
@java.lang.Override
|
||||||
|
protected com.google.protobuf.MapField internalGetMapField(
|
||||||
|
int number) {
|
||||||
|
switch (number) {
|
||||||
|
case 1:
|
||||||
|
return internalGetMotors();
|
||||||
|
default:
|
||||||
|
throw new RuntimeException(
|
||||||
|
"Invalid map field number: " + number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internalGetFieldAccessorTable() {
|
||||||
|
return cmvr.msgs.RobotDetailOuterClass.internal_static_cmvr_msgs_RobotDetail_fieldAccessorTable
|
||||||
|
.ensureFieldAccessorsInitialized(
|
||||||
|
cmvr.msgs.RobotDetailOuterClass.RobotDetail.class, cmvr.msgs.RobotDetailOuterClass.RobotDetail.Builder.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final int MOTORS_FIELD_NUMBER = 1;
|
||||||
|
private static final class MotorsDefaultEntryHolder {
|
||||||
|
static final com.google.protobuf.MapEntry<
|
||||||
|
java.lang.Integer, cmvr.msgs.Motor.MotorStatus> defaultEntry =
|
||||||
|
com.google.protobuf.MapEntry
|
||||||
|
.<java.lang.Integer, cmvr.msgs.Motor.MotorStatus>newDefaultInstance(
|
||||||
|
cmvr.msgs.RobotDetailOuterClass.internal_static_cmvr_msgs_RobotDetail_MotorsEntry_descriptor,
|
||||||
|
com.google.protobuf.WireFormat.FieldType.UINT32,
|
||||||
|
0,
|
||||||
|
com.google.protobuf.WireFormat.FieldType.MESSAGE,
|
||||||
|
cmvr.msgs.Motor.MotorStatus.getDefaultInstance());
|
||||||
|
}
|
||||||
|
private com.google.protobuf.MapField<
|
||||||
|
java.lang.Integer, cmvr.msgs.Motor.MotorStatus> motors_;
|
||||||
|
private com.google.protobuf.MapField<java.lang.Integer, cmvr.msgs.Motor.MotorStatus>
|
||||||
|
internalGetMotors() {
|
||||||
|
if (motors_ == null) {
|
||||||
|
return com.google.protobuf.MapField.emptyMapField(
|
||||||
|
MotorsDefaultEntryHolder.defaultEntry);
|
||||||
|
}
|
||||||
|
return motors_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMotorsCount() {
|
||||||
|
return internalGetMotors().getMap().size();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public boolean containsMotors(
|
||||||
|
int key) {
|
||||||
|
|
||||||
|
return internalGetMotors().getMap().containsKey(key);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Use {@link #getMotorsMap()} instead.
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.Deprecated
|
||||||
|
public java.util.Map<java.lang.Integer, cmvr.msgs.Motor.MotorStatus> getMotors() {
|
||||||
|
return getMotorsMap();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
|
||||||
|
public java.util.Map<java.lang.Integer, cmvr.msgs.Motor.MotorStatus> getMotorsMap() {
|
||||||
|
return internalGetMotors().getMap();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
|
||||||
|
public cmvr.msgs.Motor.MotorStatus getMotorsOrDefault(
|
||||||
|
int key,
|
||||||
|
cmvr.msgs.Motor.MotorStatus defaultValue) {
|
||||||
|
|
||||||
|
java.util.Map<java.lang.Integer, cmvr.msgs.Motor.MotorStatus> map =
|
||||||
|
internalGetMotors().getMap();
|
||||||
|
return map.containsKey(key) ? map.get(key) : defaultValue;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
|
||||||
|
public cmvr.msgs.Motor.MotorStatus getMotorsOrThrow(
|
||||||
|
int key) {
|
||||||
|
|
||||||
|
java.util.Map<java.lang.Integer, cmvr.msgs.Motor.MotorStatus> map =
|
||||||
|
internalGetMotors().getMap();
|
||||||
|
if (!map.containsKey(key)) {
|
||||||
|
throw new java.lang.IllegalArgumentException();
|
||||||
|
}
|
||||||
|
return map.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte memoizedIsInitialized = -1;
|
||||||
|
@java.lang.Override
|
||||||
|
public final boolean isInitialized() {
|
||||||
|
byte isInitialized = memoizedIsInitialized;
|
||||||
|
if (isInitialized == 1) return true;
|
||||||
|
if (isInitialized == 0) return false;
|
||||||
|
|
||||||
|
memoizedIsInitialized = 1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||||
|
throws java.io.IOException {
|
||||||
|
com.google.protobuf.GeneratedMessageV3
|
||||||
|
.serializeIntegerMapTo(
|
||||||
|
output,
|
||||||
|
internalGetMotors(),
|
||||||
|
MotorsDefaultEntryHolder.defaultEntry,
|
||||||
|
1);
|
||||||
|
getUnknownFields().writeTo(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public int getSerializedSize() {
|
||||||
|
int size = memoizedSize;
|
||||||
|
if (size != -1) return size;
|
||||||
|
|
||||||
|
size = 0;
|
||||||
|
for (java.util.Map.Entry<java.lang.Integer, cmvr.msgs.Motor.MotorStatus> entry
|
||||||
|
: internalGetMotors().getMap().entrySet()) {
|
||||||
|
com.google.protobuf.MapEntry<java.lang.Integer, cmvr.msgs.Motor.MotorStatus>
|
||||||
|
motors__ = MotorsDefaultEntryHolder.defaultEntry.newBuilderForType()
|
||||||
|
.setKey(entry.getKey())
|
||||||
|
.setValue(entry.getValue())
|
||||||
|
.build();
|
||||||
|
size += com.google.protobuf.CodedOutputStream
|
||||||
|
.computeMessageSize(1, motors__);
|
||||||
|
}
|
||||||
|
size += getUnknownFields().getSerializedSize();
|
||||||
|
memoizedSize = size;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public boolean equals(final java.lang.Object obj) {
|
||||||
|
if (obj == this) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof cmvr.msgs.RobotDetailOuterClass.RobotDetail)) {
|
||||||
|
return super.equals(obj);
|
||||||
|
}
|
||||||
|
cmvr.msgs.RobotDetailOuterClass.RobotDetail other = (cmvr.msgs.RobotDetailOuterClass.RobotDetail) obj;
|
||||||
|
|
||||||
|
if (!internalGetMotors().equals(
|
||||||
|
other.internalGetMotors())) return false;
|
||||||
|
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public int hashCode() {
|
||||||
|
if (memoizedHashCode != 0) {
|
||||||
|
return memoizedHashCode;
|
||||||
|
}
|
||||||
|
int hash = 41;
|
||||||
|
hash = (19 * hash) + getDescriptor().hashCode();
|
||||||
|
if (!internalGetMotors().getMap().isEmpty()) {
|
||||||
|
hash = (37 * hash) + MOTORS_FIELD_NUMBER;
|
||||||
|
hash = (53 * hash) + internalGetMotors().hashCode();
|
||||||
|
}
|
||||||
|
hash = (29 * hash) + getUnknownFields().hashCode();
|
||||||
|
memoizedHashCode = hash;
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static cmvr.msgs.RobotDetailOuterClass.RobotDetail parseFrom(
|
||||||
|
java.nio.ByteBuffer data)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.RobotDetailOuterClass.RobotDetail parseFrom(
|
||||||
|
java.nio.ByteBuffer data,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.RobotDetailOuterClass.RobotDetail parseFrom(
|
||||||
|
com.google.protobuf.ByteString data)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.RobotDetailOuterClass.RobotDetail parseFrom(
|
||||||
|
com.google.protobuf.ByteString data,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.RobotDetailOuterClass.RobotDetail parseFrom(byte[] data)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.RobotDetailOuterClass.RobotDetail parseFrom(
|
||||||
|
byte[] data,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.RobotDetailOuterClass.RobotDetail parseFrom(java.io.InputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.RobotDetailOuterClass.RobotDetail parseFrom(
|
||||||
|
java.io.InputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.RobotDetailOuterClass.RobotDetail parseDelimitedFrom(java.io.InputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseDelimitedWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.RobotDetailOuterClass.RobotDetail parseDelimitedFrom(
|
||||||
|
java.io.InputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.RobotDetailOuterClass.RobotDetail parseFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
public static cmvr.msgs.RobotDetailOuterClass.RobotDetail parseFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder newBuilderForType() { return newBuilder(); }
|
||||||
|
public static Builder newBuilder() {
|
||||||
|
return DEFAULT_INSTANCE.toBuilder();
|
||||||
|
}
|
||||||
|
public static Builder newBuilder(cmvr.msgs.RobotDetailOuterClass.RobotDetail prototype) {
|
||||||
|
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder toBuilder() {
|
||||||
|
return this == DEFAULT_INSTANCE
|
||||||
|
? new Builder() : new Builder().mergeFrom(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected Builder newBuilderForType(
|
||||||
|
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||||
|
Builder builder = new Builder(parent);
|
||||||
|
return builder;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Protobuf type {@code cmvr.msgs.RobotDetail}
|
||||||
|
*/
|
||||||
|
public static final class Builder extends
|
||||||
|
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
||||||
|
// @@protoc_insertion_point(builder_implements:cmvr.msgs.RobotDetail)
|
||||||
|
cmvr.msgs.RobotDetailOuterClass.RobotDetailOrBuilder {
|
||||||
|
public static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return cmvr.msgs.RobotDetailOuterClass.internal_static_cmvr_msgs_RobotDetail_descriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings({"rawtypes"})
|
||||||
|
protected com.google.protobuf.MapField internalGetMapField(
|
||||||
|
int number) {
|
||||||
|
switch (number) {
|
||||||
|
case 1:
|
||||||
|
return internalGetMotors();
|
||||||
|
default:
|
||||||
|
throw new RuntimeException(
|
||||||
|
"Invalid map field number: " + number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@SuppressWarnings({"rawtypes"})
|
||||||
|
protected com.google.protobuf.MapField internalGetMutableMapField(
|
||||||
|
int number) {
|
||||||
|
switch (number) {
|
||||||
|
case 1:
|
||||||
|
return internalGetMutableMotors();
|
||||||
|
default:
|
||||||
|
throw new RuntimeException(
|
||||||
|
"Invalid map field number: " + number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internalGetFieldAccessorTable() {
|
||||||
|
return cmvr.msgs.RobotDetailOuterClass.internal_static_cmvr_msgs_RobotDetail_fieldAccessorTable
|
||||||
|
.ensureFieldAccessorsInitialized(
|
||||||
|
cmvr.msgs.RobotDetailOuterClass.RobotDetail.class, cmvr.msgs.RobotDetailOuterClass.RobotDetail.Builder.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Construct using cmvr.msgs.RobotDetailOuterClass.RobotDetail.newBuilder()
|
||||||
|
private Builder() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private Builder(
|
||||||
|
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||||
|
super(parent);
|
||||||
|
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clear() {
|
||||||
|
super.clear();
|
||||||
|
internalGetMutableMotors().clear();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.Descriptor
|
||||||
|
getDescriptorForType() {
|
||||||
|
return cmvr.msgs.RobotDetailOuterClass.internal_static_cmvr_msgs_RobotDetail_descriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public cmvr.msgs.RobotDetailOuterClass.RobotDetail getDefaultInstanceForType() {
|
||||||
|
return cmvr.msgs.RobotDetailOuterClass.RobotDetail.getDefaultInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public cmvr.msgs.RobotDetailOuterClass.RobotDetail build() {
|
||||||
|
cmvr.msgs.RobotDetailOuterClass.RobotDetail result = buildPartial();
|
||||||
|
if (!result.isInitialized()) {
|
||||||
|
throw newUninitializedMessageException(result);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public cmvr.msgs.RobotDetailOuterClass.RobotDetail buildPartial() {
|
||||||
|
cmvr.msgs.RobotDetailOuterClass.RobotDetail result = new cmvr.msgs.RobotDetailOuterClass.RobotDetail(this);
|
||||||
|
int from_bitField0_ = bitField0_;
|
||||||
|
result.motors_ = internalGetMotors();
|
||||||
|
result.motors_.makeImmutable();
|
||||||
|
onBuilt();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clone() {
|
||||||
|
return super.clone();
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder setField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
|
java.lang.Object value) {
|
||||||
|
return super.setField(field, value);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clearField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field) {
|
||||||
|
return super.clearField(field);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clearOneof(
|
||||||
|
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
|
||||||
|
return super.clearOneof(oneof);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder setRepeatedField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
|
int index, java.lang.Object value) {
|
||||||
|
return super.setRepeatedField(field, index, value);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder addRepeatedField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
|
java.lang.Object value) {
|
||||||
|
return super.addRepeatedField(field, value);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||||
|
if (other instanceof cmvr.msgs.RobotDetailOuterClass.RobotDetail) {
|
||||||
|
return mergeFrom((cmvr.msgs.RobotDetailOuterClass.RobotDetail)other);
|
||||||
|
} else {
|
||||||
|
super.mergeFrom(other);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder mergeFrom(cmvr.msgs.RobotDetailOuterClass.RobotDetail other) {
|
||||||
|
if (other == cmvr.msgs.RobotDetailOuterClass.RobotDetail.getDefaultInstance()) return this;
|
||||||
|
internalGetMutableMotors().mergeFrom(
|
||||||
|
other.internalGetMotors());
|
||||||
|
this.mergeUnknownFields(other.getUnknownFields());
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public final boolean isInitialized() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder mergeFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
if (extensionRegistry == null) {
|
||||||
|
throw new java.lang.NullPointerException();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
boolean done = false;
|
||||||
|
while (!done) {
|
||||||
|
int tag = input.readTag();
|
||||||
|
switch (tag) {
|
||||||
|
case 0:
|
||||||
|
done = true;
|
||||||
|
break;
|
||||||
|
case 10: {
|
||||||
|
com.google.protobuf.MapEntry<java.lang.Integer, cmvr.msgs.Motor.MotorStatus>
|
||||||
|
motors__ = input.readMessage(
|
||||||
|
MotorsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
|
||||||
|
internalGetMutableMotors().getMutableMap().put(
|
||||||
|
motors__.getKey(), motors__.getValue());
|
||||||
|
break;
|
||||||
|
} // case 10
|
||||||
|
default: {
|
||||||
|
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
|
||||||
|
done = true; // was an endgroup tag
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
} // default:
|
||||||
|
} // switch (tag)
|
||||||
|
} // while (!done)
|
||||||
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||||
|
throw e.unwrapIOException();
|
||||||
|
} finally {
|
||||||
|
onChanged();
|
||||||
|
} // finally
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
private int bitField0_;
|
||||||
|
|
||||||
|
private com.google.protobuf.MapField<
|
||||||
|
java.lang.Integer, cmvr.msgs.Motor.MotorStatus> motors_;
|
||||||
|
private com.google.protobuf.MapField<java.lang.Integer, cmvr.msgs.Motor.MotorStatus>
|
||||||
|
internalGetMotors() {
|
||||||
|
if (motors_ == null) {
|
||||||
|
return com.google.protobuf.MapField.emptyMapField(
|
||||||
|
MotorsDefaultEntryHolder.defaultEntry);
|
||||||
|
}
|
||||||
|
return motors_;
|
||||||
|
}
|
||||||
|
private com.google.protobuf.MapField<java.lang.Integer, cmvr.msgs.Motor.MotorStatus>
|
||||||
|
internalGetMutableMotors() {
|
||||||
|
onChanged();;
|
||||||
|
if (motors_ == null) {
|
||||||
|
motors_ = com.google.protobuf.MapField.newMapField(
|
||||||
|
MotorsDefaultEntryHolder.defaultEntry);
|
||||||
|
}
|
||||||
|
if (!motors_.isMutable()) {
|
||||||
|
motors_ = motors_.copy();
|
||||||
|
}
|
||||||
|
return motors_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMotorsCount() {
|
||||||
|
return internalGetMotors().getMap().size();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public boolean containsMotors(
|
||||||
|
int key) {
|
||||||
|
|
||||||
|
return internalGetMotors().getMap().containsKey(key);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Use {@link #getMotorsMap()} instead.
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
@java.lang.Deprecated
|
||||||
|
public java.util.Map<java.lang.Integer, cmvr.msgs.Motor.MotorStatus> getMotors() {
|
||||||
|
return getMotorsMap();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
|
||||||
|
public java.util.Map<java.lang.Integer, cmvr.msgs.Motor.MotorStatus> getMotorsMap() {
|
||||||
|
return internalGetMotors().getMap();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
|
||||||
|
public cmvr.msgs.Motor.MotorStatus getMotorsOrDefault(
|
||||||
|
int key,
|
||||||
|
cmvr.msgs.Motor.MotorStatus defaultValue) {
|
||||||
|
|
||||||
|
java.util.Map<java.lang.Integer, cmvr.msgs.Motor.MotorStatus> map =
|
||||||
|
internalGetMotors().getMap();
|
||||||
|
return map.containsKey(key) ? map.get(key) : defaultValue;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
|
||||||
|
public cmvr.msgs.Motor.MotorStatus getMotorsOrThrow(
|
||||||
|
int key) {
|
||||||
|
|
||||||
|
java.util.Map<java.lang.Integer, cmvr.msgs.Motor.MotorStatus> map =
|
||||||
|
internalGetMotors().getMap();
|
||||||
|
if (!map.containsKey(key)) {
|
||||||
|
throw new java.lang.IllegalArgumentException();
|
||||||
|
}
|
||||||
|
return map.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder clearMotors() {
|
||||||
|
internalGetMutableMotors().getMutableMap()
|
||||||
|
.clear();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
|
||||||
|
public Builder removeMotors(
|
||||||
|
int key) {
|
||||||
|
|
||||||
|
internalGetMutableMotors().getMutableMap()
|
||||||
|
.remove(key);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Use alternate mutation accessors instead.
|
||||||
|
*/
|
||||||
|
@java.lang.Deprecated
|
||||||
|
public java.util.Map<java.lang.Integer, cmvr.msgs.Motor.MotorStatus>
|
||||||
|
getMutableMotors() {
|
||||||
|
return internalGetMutableMotors().getMutableMap();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
public Builder putMotors(
|
||||||
|
int key,
|
||||||
|
cmvr.msgs.Motor.MotorStatus value) {
|
||||||
|
|
||||||
|
if (value == null) {
|
||||||
|
throw new NullPointerException("map value");
|
||||||
|
}
|
||||||
|
|
||||||
|
internalGetMutableMotors().getMutableMap()
|
||||||
|
.put(key, value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* key 电机 nodeid
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <code>map<uint32, .cmvr.msgs.MotorStatus> motors = 1;</code>
|
||||||
|
*/
|
||||||
|
|
||||||
|
public Builder putAllMotors(
|
||||||
|
java.util.Map<java.lang.Integer, cmvr.msgs.Motor.MotorStatus> values) {
|
||||||
|
internalGetMutableMotors().getMutableMap()
|
||||||
|
.putAll(values);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public final Builder setUnknownFields(
|
||||||
|
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||||
|
return super.setUnknownFields(unknownFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public final Builder mergeUnknownFields(
|
||||||
|
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||||
|
return super.mergeUnknownFields(unknownFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(builder_scope:cmvr.msgs.RobotDetail)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(class_scope:cmvr.msgs.RobotDetail)
|
||||||
|
private static final cmvr.msgs.RobotDetailOuterClass.RobotDetail DEFAULT_INSTANCE;
|
||||||
|
static {
|
||||||
|
DEFAULT_INSTANCE = new cmvr.msgs.RobotDetailOuterClass.RobotDetail();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static cmvr.msgs.RobotDetailOuterClass.RobotDetail getDefaultInstance() {
|
||||||
|
return DEFAULT_INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final com.google.protobuf.Parser<RobotDetail>
|
||||||
|
PARSER = new com.google.protobuf.AbstractParser<RobotDetail>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public RobotDetail parsePartialFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
Builder builder = newBuilder();
|
||||||
|
try {
|
||||||
|
builder.mergeFrom(input, extensionRegistry);
|
||||||
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||||
|
throw e.setUnfinishedMessage(builder.buildPartial());
|
||||||
|
} catch (com.google.protobuf.UninitializedMessageException e) {
|
||||||
|
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
|
||||||
|
} catch (java.io.IOException e) {
|
||||||
|
throw new com.google.protobuf.InvalidProtocolBufferException(e)
|
||||||
|
.setUnfinishedMessage(builder.buildPartial());
|
||||||
|
}
|
||||||
|
return builder.buildPartial();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public static com.google.protobuf.Parser<RobotDetail> parser() {
|
||||||
|
return PARSER;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Parser<RobotDetail> getParserForType() {
|
||||||
|
return PARSER;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public cmvr.msgs.RobotDetailOuterClass.RobotDetail getDefaultInstanceForType() {
|
||||||
|
return DEFAULT_INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
internal_static_cmvr_msgs_RobotDetail_descriptor;
|
||||||
|
private static final
|
||||||
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internal_static_cmvr_msgs_RobotDetail_fieldAccessorTable;
|
||||||
|
private static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
internal_static_cmvr_msgs_RobotDetail_MotorsEntry_descriptor;
|
||||||
|
private static final
|
||||||
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internal_static_cmvr_msgs_RobotDetail_MotorsEntry_fieldAccessorTable;
|
||||||
|
|
||||||
|
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return descriptor;
|
||||||
|
}
|
||||||
|
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
descriptor;
|
||||||
|
static {
|
||||||
|
java.lang.String[] descriptorData = {
|
||||||
|
"\n\034cmvr/msgs/robot_detail.proto\022\tcmvr.msg" +
|
||||||
|
"s\032\025cmvr/msgs/motor.proto\"\210\001\n\013RobotDetail" +
|
||||||
|
"\0222\n\006motors\030\001 \003(\0132\".cmvr.msgs.RobotDetail" +
|
||||||
|
".MotorsEntry\032E\n\013MotorsEntry\022\013\n\003key\030\001 \001(\r" +
|
||||||
|
"\022%\n\005value\030\002 \001(\0132\026.cmvr.msgs.MotorStatus:" +
|
||||||
|
"\0028\001b\006proto3"
|
||||||
|
};
|
||||||
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
|
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||||
|
cmvr.msgs.Motor.getDescriptor(),
|
||||||
|
});
|
||||||
|
internal_static_cmvr_msgs_RobotDetail_descriptor =
|
||||||
|
getDescriptor().getMessageTypes().get(0);
|
||||||
|
internal_static_cmvr_msgs_RobotDetail_fieldAccessorTable = new
|
||||||
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||||
|
internal_static_cmvr_msgs_RobotDetail_descriptor,
|
||||||
|
new java.lang.String[] { "Motors", });
|
||||||
|
internal_static_cmvr_msgs_RobotDetail_MotorsEntry_descriptor =
|
||||||
|
internal_static_cmvr_msgs_RobotDetail_descriptor.getNestedTypes().get(0);
|
||||||
|
internal_static_cmvr_msgs_RobotDetail_MotorsEntry_fieldAccessorTable = new
|
||||||
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||||
|
internal_static_cmvr_msgs_RobotDetail_MotorsEntry_descriptor,
|
||||||
|
new java.lang.String[] { "Key", "Value", });
|
||||||
|
cmvr.msgs.Motor.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(outer_class_scope)
|
||||||
|
}
|
||||||
@ -3,7 +3,7 @@ syntax = "proto3";
|
|||||||
package cmvr.api;
|
package cmvr.api;
|
||||||
|
|
||||||
import "cmvr/api/common.proto";
|
import "cmvr/api/common.proto";
|
||||||
import "cmvr/msgs/agv.proto";
|
import "cmvr/api/agv_utils.proto";
|
||||||
|
|
||||||
// 查询 AGV 运行状态命令。
|
// 查询 AGV 运行状态命令。
|
||||||
message AgvRuntimeStateCommand {
|
message AgvRuntimeStateCommand {
|
||||||
@ -45,7 +45,7 @@ message AgvNavigateToPoseCommand {
|
|||||||
CommandHeader.Request header = 1;
|
CommandHeader.Request header = 1;
|
||||||
// 目标位姿。x/y 单位:米,theta 单位:弧度。
|
// 目标位姿。x/y 单位:米,theta 单位:弧度。
|
||||||
cmvr.msgs.AgvPose2d pose = 2;
|
cmvr.msgs.AgvPose2d pose = 2;
|
||||||
// 通用运动约束和执行选项。
|
// 通用运动约束和执行选项;默认同步阻塞至任务终态并确认停车。
|
||||||
cmvr.msgs.AgvMotionOptions options = 3;
|
cmvr.msgs.AgvMotionOptions options = 3;
|
||||||
// AGV 适配器扩展参数,用于传递厂商特有选项。
|
// AGV 适配器扩展参数,用于传递厂商特有选项。
|
||||||
cmvr.msgs.AgvAdapterParams adapter_params = 4;
|
cmvr.msgs.AgvAdapterParams adapter_params = 4;
|
||||||
@ -65,7 +65,7 @@ message AgvNavigateToStationCommand {
|
|||||||
CommandHeader.Request header = 1;
|
CommandHeader.Request header = 1;
|
||||||
// 目标站点 id。
|
// 目标站点 id。
|
||||||
string station_id = 2;
|
string station_id = 2;
|
||||||
// 通用运动约束和执行选项。
|
// 通用运动约束和执行选项;默认同步阻塞至任务终态并确认停车。
|
||||||
cmvr.msgs.AgvMotionOptions options = 3;
|
cmvr.msgs.AgvMotionOptions options = 3;
|
||||||
// AGV 适配器扩展参数,用于传递厂商特有选项。
|
// AGV 适配器扩展参数,用于传递厂商特有选项。
|
||||||
cmvr.msgs.AgvAdapterParams adapter_params = 4;
|
cmvr.msgs.AgvAdapterParams adapter_params = 4;
|
||||||
@ -85,6 +85,8 @@ message AgvFollowPathCommand {
|
|||||||
CommandHeader.Request header = 1;
|
CommandHeader.Request header = 1;
|
||||||
// 路径段列表。每段包含起点站点 id 和终点站点 id。
|
// 路径段列表。每段包含起点站点 id 和终点站点 id。
|
||||||
repeated cmvr.msgs.AgvPathSegment path = 2;
|
repeated cmvr.msgs.AgvPathSegment path = 2;
|
||||||
|
// 通用执行选项;默认同步阻塞至整条路径终态并确认停车。
|
||||||
|
cmvr.msgs.AgvMotionOptions options = 3;
|
||||||
}
|
}
|
||||||
// 反馈体。
|
// 反馈体。
|
||||||
message Feedback {
|
message Feedback {
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
|
|
||||||
|
// 文件随 AGV API 定义统一放在 cmvr/api 下,但保留 cmvr.msgs package,
|
||||||
|
// 以兼容既有生成代码、消息完整名称和 Any type URL。
|
||||||
package cmvr.msgs;
|
package cmvr.msgs;
|
||||||
|
|
||||||
// AGV 在地图平面坐标系中的二维位姿。
|
// AGV 在地图平面坐标系中的二维位姿。
|
||||||
@ -52,8 +54,14 @@ message AgvMotionOptions {
|
|||||||
double reach_angle = 6;
|
double reach_angle = 6;
|
||||||
// 速度比例,范围通常为 [0, 1];1 表示不降速。
|
// 速度比例,范围通常为 [0, 1];1 表示不降速。
|
||||||
double speed_ratio = 7;
|
double speed_ratio = 7;
|
||||||
// 是否异步执行;true 表示下发任务后立即返回。
|
// 是否异步执行;false(默认)表示到达、失败、取消或遇障停止后才返回,
|
||||||
|
// true 表示任务被控制器接受后立即返回。
|
||||||
bool asynchronous = 8;
|
bool asynchronous = 8;
|
||||||
|
// 同步导航的最大等待时间,单位:毫秒;0 表示使用适配器默认值。
|
||||||
|
// gRPC deadline 应大于该值或预计行程时间,否则服务端会安全取消导航。
|
||||||
|
int32 wait_timeout_ms = 9;
|
||||||
|
// 同步导航的状态轮询周期,单位:毫秒;0 表示使用适配器默认值。
|
||||||
|
int32 poll_interval_ms = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
// AGV 适配器扩展参数。用于传递厂商或控制器特有的参数。
|
// AGV 适配器扩展参数。用于传递厂商或控制器特有的参数。
|
||||||
@ -20,4 +20,7 @@ service ArmService {
|
|||||||
rpc calibrateZeroQ(CalibrateZeroQ.Request) returns (CalibrateZeroQ.Response);
|
rpc calibrateZeroQ(CalibrateZeroQ.Request) returns (CalibrateZeroQ.Response);
|
||||||
rpc getPoseMatrix(GetPoseMatrix.Request) returns (GetPoseMatrix.Response);
|
rpc getPoseMatrix(GetPoseMatrix.Request) returns (GetPoseMatrix.Response);
|
||||||
rpc computeForwardKinematics(ComputeForwardKinematics.Request) returns (ComputeForwardKinematics.Response);
|
rpc computeForwardKinematics(ComputeForwardKinematics.Request) returns (ComputeForwardKinematics.Response);
|
||||||
|
|
||||||
|
// Vendor-specific arm extension currently used for AUBO cabinet IO.
|
||||||
|
rpc ExecuteJsonCommand(JsonDeviceCommand.Request) returns (JsonDeviceCommand.Feedback);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,133 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package cmvr.api.armteleop.v1;
|
||||||
|
|
||||||
|
// Versioned, session-oriented protocol for wired arm teleoperation. Existing
|
||||||
|
// unary ArmService RPCs intentionally remain unchanged.
|
||||||
|
service ArmTeleopService {
|
||||||
|
rpc Teleoperate(stream ClientFrame) returns (stream ServerFrame);
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SessionPhase {
|
||||||
|
SESSION_PHASE_UNSPECIFIED = 0;
|
||||||
|
SESSION_PHASE_OPENED = 1;
|
||||||
|
SESSION_PHASE_READY = 2;
|
||||||
|
SESSION_PHASE_ACTIVE = 3;
|
||||||
|
SESSION_PHASE_HOLDING = 4;
|
||||||
|
SESSION_PHASE_STOPPED = 5;
|
||||||
|
SESSION_PHASE_WATCHDOG_EXPIRED = 6;
|
||||||
|
SESSION_PHASE_LEASE_LOST = 7;
|
||||||
|
SESSION_PHASE_REJECTED = 8;
|
||||||
|
SESSION_PHASE_FAILED = 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum StopReason {
|
||||||
|
STOP_REASON_UNSPECIFIED = 0;
|
||||||
|
STOP_REASON_OPERATOR_REQUEST = 1;
|
||||||
|
STOP_REASON_CLIENT_SHUTDOWN = 2;
|
||||||
|
STOP_REASON_WATCHDOG = 3;
|
||||||
|
STOP_REASON_LEASE_REVOKED = 4;
|
||||||
|
STOP_REASON_ROBOT_FAULT = 5;
|
||||||
|
STOP_REASON_EMERGENCY_STOP = 6;
|
||||||
|
STOP_REASON_PROTOCOL_ERROR = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum EffortSource {
|
||||||
|
EFFORT_SOURCE_UNSPECIFIED = 0;
|
||||||
|
EFFORT_SOURCE_MOTOR_ESTIMATE = 1;
|
||||||
|
EFFORT_SOURCE_JOINT_SENSOR = 2;
|
||||||
|
EFFORT_SOURCE_FORCE_TORQUE_SENSOR = 3;
|
||||||
|
EFFORT_SOURCE_OBSERVER = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RobotManifest {
|
||||||
|
string robot_id = 1;
|
||||||
|
string model_sha256 = 2;
|
||||||
|
string calibration_sha256 = 3;
|
||||||
|
repeated string joint_names = 4;
|
||||||
|
string position_unit = 5;
|
||||||
|
string velocity_unit = 6;
|
||||||
|
string effort_unit = 7;
|
||||||
|
string base_frame = 8;
|
||||||
|
string tool_frame = 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
message OpenSession {
|
||||||
|
uint32 protocol_major = 1;
|
||||||
|
uint32 protocol_minor = 2;
|
||||||
|
string client_instance_id = 3;
|
||||||
|
RobotManifest expected_robot = 4;
|
||||||
|
uint32 requested_command_rate_hz = 5;
|
||||||
|
uint32 requested_state_rate_hz = 6;
|
||||||
|
uint32 watchdog_timeout_ms = 7;
|
||||||
|
uint32 requested_lease_ms = 8;
|
||||||
|
bool request_force_feedback = 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
message JointSetpoint {
|
||||||
|
// Strictly increasing and non-zero within a session.
|
||||||
|
uint64 sequence = 1;
|
||||||
|
repeated double position_rad = 2;
|
||||||
|
repeated double velocity_rad_s = 3;
|
||||||
|
// The receiver computes its deadline from local arrival time plus this
|
||||||
|
// duration. Zero is invalid for an active setpoint.
|
||||||
|
uint32 valid_for_us = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ClientHeartbeat {
|
||||||
|
uint64 sequence = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message StopSession {
|
||||||
|
StopReason reason = 1;
|
||||||
|
string detail = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ClientFrame {
|
||||||
|
oneof payload {
|
||||||
|
OpenSession open = 1;
|
||||||
|
JointSetpoint setpoint = 2;
|
||||||
|
ClientHeartbeat heartbeat = 3;
|
||||||
|
StopSession stop = 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message JointState {
|
||||||
|
uint64 sample_sequence = 1;
|
||||||
|
repeated double position_rad = 2;
|
||||||
|
repeated double velocity_rad_s = 3;
|
||||||
|
repeated double effort_nm = 4;
|
||||||
|
bool position_valid = 5;
|
||||||
|
bool velocity_valid = 6;
|
||||||
|
bool effort_valid = 7;
|
||||||
|
EffortSource effort_source = 8;
|
||||||
|
uint64 sample_age_us = 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SessionStatus {
|
||||||
|
string session_id = 1;
|
||||||
|
SessionPhase phase = 2;
|
||||||
|
uint64 received_sequence = 3;
|
||||||
|
uint64 applied_sequence = 4;
|
||||||
|
uint64 dropped_setpoints = 5;
|
||||||
|
uint64 rejected_setpoints = 6;
|
||||||
|
uint32 negotiated_watchdog_ms = 7;
|
||||||
|
uint32 lease_remaining_ms = 8;
|
||||||
|
StopReason stop_reason = 9;
|
||||||
|
string detail = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RobotSafetyState {
|
||||||
|
bool connected = 1;
|
||||||
|
bool powered_on = 2;
|
||||||
|
bool protective_stopped = 3;
|
||||||
|
bool emergency_stopped = 4;
|
||||||
|
bool fault = 5;
|
||||||
|
string fault_detail = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ServerFrame {
|
||||||
|
SessionStatus status = 1;
|
||||||
|
JointState joint_state = 2;
|
||||||
|
RobotSafetyState safety = 3;
|
||||||
|
}
|
||||||
@ -128,16 +128,16 @@ message SetFacialExpression {
|
|||||||
* 用于连续发送多个面部表情,实现表情动画效果
|
* 用于连续发送多个面部表情,实现表情动画效果
|
||||||
*/
|
*/
|
||||||
message StreamFacialExpression {
|
message StreamFacialExpression {
|
||||||
message Request {
|
message Request {
|
||||||
CommandHeader.Request header = 1; // 通用命令头
|
CommandHeader.Request header = 1; // 通用命令头
|
||||||
FacialExpression expr = 2; // 执行
|
FacialExpression expr = 2; // 执行
|
||||||
bool eof = 3; // 标记是否为流结束
|
bool eof = 3; // 标记是否为流结束
|
||||||
}
|
}
|
||||||
|
|
||||||
message Feedback {
|
message Feedback {
|
||||||
CommandHeader.Feedback header = 1; // 通用反馈头
|
CommandHeader.Feedback header = 1; // 通用反馈头
|
||||||
FacialExpression expr_diff = 2; // 执行误差
|
FacialExpression expr_diff = 2; // 执行误差
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -267,3 +267,4 @@ message ExpressionYawn {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -5,36 +5,43 @@ import "cmvr/api/biohead_command.proto";
|
|||||||
|
|
||||||
// 生物头部机器人服务接口
|
// 生物头部机器人服务接口
|
||||||
service BioHeadService {
|
service BioHeadService {
|
||||||
// 设置面部表情
|
// 设置面部表情
|
||||||
rpc SetExpression(SetFacialExpression.Request) returns (SetFacialExpression.Feedback){};
|
rpc SetExpression(SetFacialExpression.Request) returns (SetFacialExpression.Feedback){};
|
||||||
|
|
||||||
// 流式表情控制
|
// 流式表情控制
|
||||||
//rpc StreamExpression(StreamFacialExpression.Request) returns (StreamFacialExpression.Feedback){};
|
//rpc StreamExpression(StreamFacialExpression.Request) returns (StreamFacialExpression.Feedback){};
|
||||||
|
|
||||||
rpc StreamExpression (stream StreamFacialExpression.Request) returns (stream StreamFacialExpression.Feedback);
|
rpc StreamExpression (stream StreamFacialExpression.Request) returns (stream StreamFacialExpression.Feedback);
|
||||||
|
|
||||||
|
|
||||||
// 获取状态
|
// 获取状态
|
||||||
rpc GetSystemStatus(GetStatus.Request) returns (GetStatus.Feedback){};
|
rpc GetSystemStatus(GetStatus.Request) returns (GetStatus.Feedback){};
|
||||||
|
|
||||||
// 紧急停止
|
// 紧急停止
|
||||||
rpc EmergencyStop(EmergencyStop.Request) returns (EmergencyStop.Feedback){};
|
rpc EmergencyStop(EmergencyStop.Request) returns (EmergencyStop.Feedback){};
|
||||||
|
|
||||||
|
// 开始说话
|
||||||
|
rpc SpeakStart(SpeakStart.Request) returns (SpeakStart.Feedback){};
|
||||||
|
// 停止说话
|
||||||
|
rpc SpeakStop(SpeakStop.Request) returns (SpeakStop.Feedback){};
|
||||||
|
|
||||||
|
rpc Happy(Happy.Request) returns (Happy.Feedback){};
|
||||||
|
|
||||||
|
rpc Surprise(Surprise.Request) returns (Surprise.Feedback){};
|
||||||
|
|
||||||
|
rpc ExpressionTired(ExpressionTired.Request) returns (ExpressionTired.Feedback){};
|
||||||
|
|
||||||
|
rpc ExpressionAngry(ExpressionAngry.Request) returns (ExpressionAngry.Feedback){};
|
||||||
|
|
||||||
|
rpc ExpressionSadness(ExpressionSadness.Request) returns (ExpressionSadness.Feedback){};
|
||||||
|
|
||||||
|
rpc ExpressionYawn(ExpressionYawn.Request) returns (ExpressionYawn.Feedback){};
|
||||||
|
|
||||||
// 开始说话
|
|
||||||
rpc SpeakStart(SpeakStart.Request) returns (SpeakStart.Feedback){};
|
|
||||||
// 停止说话
|
|
||||||
rpc SpeakStop(SpeakStop.Request) returns (SpeakStop.Feedback){};
|
|
||||||
|
|
||||||
rpc Happy(Happy.Request) returns (Happy.Feedback){};
|
|
||||||
|
|
||||||
rpc Surprise(Surprise.Request) returns (Surprise.Feedback){};
|
|
||||||
|
|
||||||
rpc ExpressionTired(ExpressionTired.Request) returns (ExpressionTired.Feedback){};
|
|
||||||
|
|
||||||
rpc ExpressionAngry(ExpressionAngry.Request) returns (ExpressionAngry.Feedback){};
|
|
||||||
|
|
||||||
rpc ExpressionSadness(ExpressionSadness.Request) returns (ExpressionSadness.Feedback){};
|
|
||||||
|
|
||||||
rpc ExpressionYawn(ExpressionYawn.Request) returns (ExpressionYawn.Feedback){};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -19,9 +19,18 @@ message FrameData {
|
|||||||
FrameType type = 4;
|
FrameType type = 4;
|
||||||
string codec = 5;
|
string codec = 5;
|
||||||
bool is_key_frame = 6;
|
bool is_key_frame = 6;
|
||||||
|
// Optional capture and source metadata. Fields 1-6 remain wire-compatible
|
||||||
|
// with existing clients; older clients safely ignore these additions.
|
||||||
|
int64 capture_utc_ns = 7;
|
||||||
|
uint64 source_sequence = 8;
|
||||||
|
int64 pts = 9;
|
||||||
|
int64 dts = 10;
|
||||||
|
uint32 source_fps = 11;
|
||||||
|
uint64 source_timestamp = 12;
|
||||||
|
uint64 source_frame_number = 13;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Rs2Intrinsics {
|
message CameraIntrinsics {
|
||||||
float cx = 1; // 主点水平坐标(从左边缘的像素偏移)
|
float cx = 1; // 主点水平坐标(从左边缘的像素偏移)
|
||||||
float cy = 2; // 主点垂直坐标(从上边缘的像素偏移)
|
float cy = 2; // 主点垂直坐标(从上边缘的像素偏移)
|
||||||
float fx = 3; // x方向焦距(像素宽度的倍数)
|
float fx = 3; // x方向焦距(像素宽度的倍数)
|
||||||
@ -79,7 +88,7 @@ message GetRGBImageCommand {
|
|||||||
message Feedback {
|
message Feedback {
|
||||||
CommandHeader.Feedback header = 1;
|
CommandHeader.Feedback header = 1;
|
||||||
FrameData color_frame = 2;
|
FrameData color_frame = 2;
|
||||||
Rs2Intrinsics intrinsics = 3;
|
CameraIntrinsics intrinsics = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +100,7 @@ message GetDepthImageCommand {
|
|||||||
message Feedback {
|
message Feedback {
|
||||||
CommandHeader.Feedback header = 1;
|
CommandHeader.Feedback header = 1;
|
||||||
FrameData depth_frame = 2;
|
FrameData depth_frame = 2;
|
||||||
Rs2Intrinsics intrinsics = 3;
|
CameraIntrinsics intrinsics = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +113,7 @@ message GetRGBDImagesCommand {
|
|||||||
CommandHeader.Feedback header = 1;
|
CommandHeader.Feedback header = 1;
|
||||||
FrameData color_frame = 2;
|
FrameData color_frame = 2;
|
||||||
FrameData depth_frame = 3;
|
FrameData depth_frame = 3;
|
||||||
Rs2Intrinsics intrinsics = 4;
|
CameraIntrinsics intrinsics = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,6 +137,39 @@ message StopCameraRecordingCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message ControlPtzCommand {
|
||||||
|
enum Command {
|
||||||
|
COMMAND_UNSPECIFIED = 0;
|
||||||
|
TILT_UP = 1;
|
||||||
|
TILT_DOWN = 2;
|
||||||
|
PAN_LEFT = 3;
|
||||||
|
PAN_RIGHT = 4;
|
||||||
|
UP_LEFT = 5;
|
||||||
|
UP_RIGHT = 6;
|
||||||
|
DOWN_LEFT = 7;
|
||||||
|
DOWN_RIGHT = 8;
|
||||||
|
ZOOM_IN = 9;
|
||||||
|
ZOOM_OUT = 10;
|
||||||
|
PAN_AUTO = 11;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Action {
|
||||||
|
START = 0;
|
||||||
|
STOP = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Request {
|
||||||
|
CommandHeader.Request header = 1;
|
||||||
|
Command command = 2;
|
||||||
|
Action action = 3;
|
||||||
|
uint32 speed = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Feedback {
|
||||||
|
CommandHeader.Feedback header = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
message GetRGBImageStreamCommand {
|
message GetRGBImageStreamCommand {
|
||||||
message Request {
|
message Request {
|
||||||
CommandHeader.Request header = 1;
|
CommandHeader.Request header = 1;
|
||||||
@ -137,7 +179,7 @@ message GetRGBImageStreamCommand {
|
|||||||
message Feedback {
|
message Feedback {
|
||||||
CommandHeader.Feedback header = 1;
|
CommandHeader.Feedback header = 1;
|
||||||
FrameData color_frame = 2;
|
FrameData color_frame = 2;
|
||||||
Rs2Intrinsics intrinsics = 3;
|
CameraIntrinsics intrinsics = 3;
|
||||||
int32 seq_no = 4;
|
int32 seq_no = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -151,7 +193,7 @@ message GetDepthImageStreamCommand {
|
|||||||
message Feedback {
|
message Feedback {
|
||||||
CommandHeader.Feedback header = 1;
|
CommandHeader.Feedback header = 1;
|
||||||
FrameData depth_frame = 2;
|
FrameData depth_frame = 2;
|
||||||
Rs2Intrinsics intrinsics = 3;
|
CameraIntrinsics intrinsics = 3;
|
||||||
int32 seq_no = 4;
|
int32 seq_no = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -166,10 +208,9 @@ message GetRGBDImagesStreamCommand {
|
|||||||
CommandHeader.Feedback header = 1;
|
CommandHeader.Feedback header = 1;
|
||||||
FrameData color_frame = 2;
|
FrameData color_frame = 2;
|
||||||
FrameData depth_frame = 3;
|
FrameData depth_frame = 3;
|
||||||
Rs2Intrinsics intrinsics = 4;
|
CameraIntrinsics intrinsics = 4;
|
||||||
int32 seq_no = 5;
|
int32 seq_no = 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,7 @@ service CameraService {
|
|||||||
rpc GetRGBDImages(GetRGBDImagesCommand.Request) returns (GetRGBDImagesCommand.Feedback) {}
|
rpc GetRGBDImages(GetRGBDImagesCommand.Request) returns (GetRGBDImagesCommand.Feedback) {}
|
||||||
rpc StartRecording(StartCameraRecordingCommand.Request) returns (StartCameraRecordingCommand.Feedback) {}
|
rpc StartRecording(StartCameraRecordingCommand.Request) returns (StartCameraRecordingCommand.Feedback) {}
|
||||||
rpc StopRecording(StopCameraRecordingCommand.Request) returns (StopCameraRecordingCommand.Feedback) {}
|
rpc StopRecording(StopCameraRecordingCommand.Request) returns (StopCameraRecordingCommand.Feedback) {}
|
||||||
|
rpc ControlPtz(ControlPtzCommand.Request) returns (ControlPtzCommand.Feedback) {}
|
||||||
|
|
||||||
rpc GetRGBImageStream(stream GetRGBImageStreamCommand.Request) returns (stream GetRGBImageStreamCommand.Feedback) {}
|
rpc GetRGBImageStream(stream GetRGBImageStreamCommand.Request) returns (stream GetRGBImageStreamCommand.Feedback) {}
|
||||||
rpc GetDepthImageStream(stream GetDepthImageStreamCommand.Request) returns (stream GetDepthImageStreamCommand.Feedback) {}
|
rpc GetDepthImageStream(stream GetDepthImageStreamCommand.Request) returns (stream GetDepthImageStreamCommand.Feedback) {}
|
||||||
|
|||||||
@ -35,6 +35,7 @@ message AudioData {
|
|||||||
MP3 = 1;
|
MP3 = 1;
|
||||||
AAC = 2;
|
AAC = 2;
|
||||||
WAV = 3;
|
WAV = 3;
|
||||||
|
OPUS = 4;
|
||||||
}
|
}
|
||||||
bytes data = 1;
|
bytes data = 1;
|
||||||
int32 sample_rate = 2;
|
int32 sample_rate = 2;
|
||||||
@ -57,3 +58,15 @@ message ConfigParam {
|
|||||||
bytes bytes_value = 6; // 二进制数据类型
|
bytes bytes_value = 6; // 二进制数据类型
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message JsonDeviceCommand {
|
||||||
|
message Request {
|
||||||
|
CommandHeader.Request header = 1;
|
||||||
|
string request_json = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Feedback {
|
||||||
|
CommandHeader.Feedback header = 1;
|
||||||
|
string response_json = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@ message FreedomValue {
|
|||||||
float value = 2; // 值 0-1百分比
|
float value = 2; // 值 0-1百分比
|
||||||
}
|
}
|
||||||
|
|
||||||
message RH56DFTPDexHand {
|
message FreedomState {
|
||||||
int32 dof_id = 1; // 自由度ID,唯一标识不同的关节或自由度
|
int32 dof_id = 1; // 自由度ID,唯一标识不同的关节或自由度
|
||||||
int32 angle = 2; // 自由度角度
|
int32 angle = 2; // 自由度角度
|
||||||
int32 speed = 3; // 自由度速度
|
int32 speed = 3; // 自由度速度
|
||||||
@ -57,7 +57,7 @@ message SensorData {
|
|||||||
|
|
||||||
message DexHandState {
|
message DexHandState {
|
||||||
bool is_initialized = 1; // 是否初始化
|
bool is_initialized = 1; // 是否初始化
|
||||||
repeated RH56DFTPDexHand hands = 2; // 包含多个自由度状态
|
repeated FreedomState hands = 2; // 包含多个自由度状态
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetDexHandStateCommand {
|
message GetDexHandStateCommand {
|
||||||
|
|||||||
@ -1,67 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package cmvr.api;
|
|
||||||
|
|
||||||
|
|
||||||
message Vec2 {
|
|
||||||
double x = 1;
|
|
||||||
double y = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Vec3 {
|
|
||||||
double x = 1;
|
|
||||||
double y = 2;
|
|
||||||
double z = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SE2Pose {
|
|
||||||
Vec2 position = 1; // (m)
|
|
||||||
double angle = 2; // (rad)
|
|
||||||
}
|
|
||||||
|
|
||||||
message SE2Velocity {
|
|
||||||
Vec2 linear = 1; // (m/s)
|
|
||||||
double angular = 2; // (rad/s)
|
|
||||||
}
|
|
||||||
|
|
||||||
message Quaternion {
|
|
||||||
double x = 1;
|
|
||||||
double y = 2;
|
|
||||||
double z = 3;
|
|
||||||
double w = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message EulerAngleZYX {
|
|
||||||
double z = 1;
|
|
||||||
double y = 2;
|
|
||||||
double x = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SE3Pose {
|
|
||||||
Vec3 position = 1; // (m)
|
|
||||||
oneof rotation {
|
|
||||||
Quaternion quaternion = 2;
|
|
||||||
EulerAngleZYX euler = 3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
message Inertial {
|
|
||||||
// Mass (kg)
|
|
||||||
double mass = 1;
|
|
||||||
|
|
||||||
// Center of mass (m)
|
|
||||||
Vec3 center_of_mass = 2;
|
|
||||||
|
|
||||||
// Inertia tensor
|
|
||||||
Inertia inertia = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Inertia tensor components (kg*m^2)
|
|
||||||
message Inertia {
|
|
||||||
double ixx = 1;
|
|
||||||
double iyy = 2;
|
|
||||||
double izz = 3;
|
|
||||||
double ixy = 4;
|
|
||||||
double ixz = 5;
|
|
||||||
double iyz = 6;
|
|
||||||
}
|
|
||||||
@ -0,0 +1,151 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package cmvr.api;
|
||||||
|
|
||||||
|
import "cmvr/api/common.proto";
|
||||||
|
import "cmvr/msgs/motor.proto";
|
||||||
|
|
||||||
|
// Selects exactly one motor inside the MotorManager named by header.device_id.
|
||||||
|
message MotorTarget {
|
||||||
|
CommandHeader.Request header = 1;
|
||||||
|
oneof selector {
|
||||||
|
uint32 motor_id = 2;
|
||||||
|
string joint_name = 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message MotorWaitOptions {
|
||||||
|
// Zero selects the server default (30 seconds).
|
||||||
|
uint32 timeout_ms = 1;
|
||||||
|
// Zero selects the server default (10 milliseconds).
|
||||||
|
uint32 poll_period_ms = 2;
|
||||||
|
// Zero selects the server default.
|
||||||
|
double position_tolerance_rad = 3;
|
||||||
|
double velocity_tolerance_rad_s = 4;
|
||||||
|
// Number of consecutive in-tolerance samples. Zero selects the default (3).
|
||||||
|
uint32 settle_sample_count = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum MotorControlType {
|
||||||
|
MOTOR_CONTROL_NONE = 0;
|
||||||
|
MOTOR_CONTROL_SET_ZERO = 1;
|
||||||
|
MOTOR_CONTROL_PROFILE_POSITION = 2;
|
||||||
|
MOTOR_CONTROL_PROFILE_VELOCITY = 3;
|
||||||
|
MOTOR_CONTROL_CYCLIC_POSITION = 4;
|
||||||
|
MOTOR_CONTROL_CYCLIC_VELOCITY = 5;
|
||||||
|
MOTOR_CONTROL_SET_ENABLED = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MotorStatus {
|
||||||
|
uint32 motor_id = 1;
|
||||||
|
string joint_name = 2;
|
||||||
|
cmvr.msgs.RunMode run_mode = 3;
|
||||||
|
double position_rad = 4;
|
||||||
|
double velocity_rad_s = 5;
|
||||||
|
bool target_reached = 6;
|
||||||
|
bool service_busy = 7;
|
||||||
|
MotorControlType active_control = 8;
|
||||||
|
bool emergency_stopped = 9;
|
||||||
|
string last_error = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MotorCommandResponse {
|
||||||
|
CommandHeader.Feedback header = 1;
|
||||||
|
MotorStatus status = 2;
|
||||||
|
uint64 elapsed_ms = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SetMotorZeroRequest {
|
||||||
|
MotorTarget target = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MoveMotorToZeroRequest {
|
||||||
|
MotorTarget target = 1;
|
||||||
|
double max_velocity_rad_s = 2;
|
||||||
|
double acceleration_rad_s2 = 3;
|
||||||
|
MotorWaitOptions wait = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ProfilePositionRequest {
|
||||||
|
MotorTarget target = 1;
|
||||||
|
double target_position_rad = 2;
|
||||||
|
double max_velocity_rad_s = 3;
|
||||||
|
double acceleration_rad_s2 = 4;
|
||||||
|
MotorWaitOptions wait = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ProfileVelocityRequest {
|
||||||
|
MotorTarget target = 1;
|
||||||
|
double target_velocity_rad_s = 2;
|
||||||
|
double acceleration_rad_s2 = 3;
|
||||||
|
MotorWaitOptions wait = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message EmergencyStopRequest {
|
||||||
|
MotorTarget target = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetMotorStatusRequest {
|
||||||
|
MotorTarget target = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetMotorStatusResponse {
|
||||||
|
CommandHeader.Feedback header = 1;
|
||||||
|
MotorStatus status = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SetMotorEnabledRequest {
|
||||||
|
MotorTarget target = 1;
|
||||||
|
bool enabled = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CyclicStreamOpen {
|
||||||
|
MotorTarget target = 1;
|
||||||
|
// The device/driver watchdog is authoritative. This service watchdog prevents a
|
||||||
|
// stalled gRPC client from retaining control indefinitely.
|
||||||
|
uint32 watchdog_timeout_ms = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CyclicPositionSetpoint {
|
||||||
|
uint64 sequence = 1;
|
||||||
|
double target_position_rad = 2;
|
||||||
|
optional double target_velocity_rad_s = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CyclicVelocitySetpoint {
|
||||||
|
uint64 sequence = 1;
|
||||||
|
double target_velocity_rad_s = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CyclicPositionRequest {
|
||||||
|
oneof payload {
|
||||||
|
CyclicStreamOpen open = 1;
|
||||||
|
CyclicPositionSetpoint setpoint = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message CyclicVelocityRequest {
|
||||||
|
oneof payload {
|
||||||
|
CyclicStreamOpen open = 1;
|
||||||
|
CyclicVelocitySetpoint setpoint = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum CyclicStreamPhase {
|
||||||
|
CYCLIC_STREAM_PHASE_UNSPECIFIED = 0;
|
||||||
|
CYCLIC_STREAM_OPENED = 1;
|
||||||
|
CYCLIC_STREAM_APPLIED = 2;
|
||||||
|
CYCLIC_STREAM_STOPPED = 3;
|
||||||
|
CYCLIC_STREAM_WATCHDOG_EXPIRED = 4;
|
||||||
|
CYCLIC_STREAM_FAILED = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CyclicControlResponse {
|
||||||
|
CommandHeader.Feedback header = 1;
|
||||||
|
CyclicStreamPhase phase = 2;
|
||||||
|
uint64 sequence = 3;
|
||||||
|
uint64 dropped_setpoints = 4;
|
||||||
|
// Present for OPENED and terminal responses. APPLIED deliberately omits
|
||||||
|
// live status so one cyclic sample does not trigger extra fieldbus reads.
|
||||||
|
MotorStatus status = 5;
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package cmvr.api;
|
||||||
|
|
||||||
|
import "cmvr/api/motor_command.proto";
|
||||||
|
|
||||||
|
service MotorService {
|
||||||
|
rpc setZero(SetMotorZeroRequest) returns (MotorCommandResponse);
|
||||||
|
rpc moveToZero(MoveMotorToZeroRequest) returns (MotorCommandResponse);
|
||||||
|
rpc profilePosition(ProfilePositionRequest) returns (MotorCommandResponse);
|
||||||
|
rpc profileVelocity(ProfileVelocityRequest) returns (MotorCommandResponse);
|
||||||
|
|
||||||
|
rpc streamCyclicPosition(stream CyclicPositionRequest)
|
||||||
|
returns (stream CyclicControlResponse);
|
||||||
|
rpc streamCyclicVelocity(stream CyclicVelocityRequest)
|
||||||
|
returns (stream CyclicControlResponse);
|
||||||
|
|
||||||
|
rpc emergencyStop(EmergencyStopRequest) returns (MotorCommandResponse);
|
||||||
|
rpc getStatus(GetMotorStatusRequest) returns (GetMotorStatusResponse);
|
||||||
|
rpc setEnabled(SetMotorEnabledRequest) returns (MotorCommandResponse);
|
||||||
|
}
|
||||||
@ -21,6 +21,77 @@ message DeviceList {
|
|||||||
DeviceType device_type = 2;
|
DeviceType device_type = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stable device categories used by GetDeviceList. This intentionally does not
|
||||||
|
// reuse the legacy DeviceType enum above: its zero value is AGV and it does not
|
||||||
|
// cover all DeviceManager categories.
|
||||||
|
enum SystemDeviceType {
|
||||||
|
SYSTEM_DEVICE_TYPE_UNSPECIFIED = 0;
|
||||||
|
SYSTEM_DEVICE_TYPE_AGV = 1;
|
||||||
|
SYSTEM_DEVICE_TYPE_ARM = 2;
|
||||||
|
SYSTEM_DEVICE_TYPE_BATTERY = 3;
|
||||||
|
SYSTEM_DEVICE_TYPE_BIO_HEAD = 4;
|
||||||
|
SYSTEM_DEVICE_TYPE_CAMERA = 5;
|
||||||
|
SYSTEM_DEVICE_TYPE_CAN_BUS = 6;
|
||||||
|
SYSTEM_DEVICE_TYPE_DEX_HAND = 7;
|
||||||
|
SYSTEM_DEVICE_TYPE_GRIPPER = 8;
|
||||||
|
SYSTEM_DEVICE_TYPE_MICROPHONE = 9;
|
||||||
|
SYSTEM_DEVICE_TYPE_MOTOR = 10;
|
||||||
|
SYSTEM_DEVICE_TYPE_MOTOR_SYSTEM = 11;
|
||||||
|
SYSTEM_DEVICE_TYPE_MUJOCO_VIEWER = 12;
|
||||||
|
SYSTEM_DEVICE_TYPE_MUJOCO_WORLD = 13;
|
||||||
|
SYSTEM_DEVICE_TYPE_ROBOT = 14;
|
||||||
|
SYSTEM_DEVICE_TYPE_SPEAKER = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SystemDeviceState {
|
||||||
|
SYSTEM_DEVICE_STATE_UNSPECIFIED = 0;
|
||||||
|
SYSTEM_DEVICE_STATE_DISABLED = 1;
|
||||||
|
SYSTEM_DEVICE_STATE_INITIALIZING = 2;
|
||||||
|
SYSTEM_DEVICE_STATE_REGISTERED = 3;
|
||||||
|
SYSTEM_DEVICE_STATE_READY = 4;
|
||||||
|
SYSTEM_DEVICE_STATE_RUNNING = 5;
|
||||||
|
SYSTEM_DEVICE_STATE_STOPPED = 6;
|
||||||
|
SYSTEM_DEVICE_STATE_ERROR = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SystemDeviceHealth {
|
||||||
|
SYSTEM_DEVICE_HEALTH_UNSPECIFIED = 0;
|
||||||
|
SYSTEM_DEVICE_HEALTH_HEALTHY = 1;
|
||||||
|
SYSTEM_DEVICE_HEALTH_DEGRADED = 2;
|
||||||
|
SYSTEM_DEVICE_HEALTH_FAULT = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SystemDeviceInfo {
|
||||||
|
string device_id = 1;
|
||||||
|
SystemDeviceType device_type = 2;
|
||||||
|
|
||||||
|
// Concrete backend name for display and diagnostics only. Consumers must
|
||||||
|
// use device_type, rather than this free-form string, for decisions.
|
||||||
|
string type_name = 3;
|
||||||
|
|
||||||
|
// GetDeviceList currently publishes only enabled entries. Keep this field
|
||||||
|
// explicit so each row remains self-describing and future-compatible.
|
||||||
|
bool enabled = 4;
|
||||||
|
SystemDeviceState manager_state = 5;
|
||||||
|
SystemDeviceHealth health = 6;
|
||||||
|
bool has_error = 7;
|
||||||
|
string error_message = 8;
|
||||||
|
uint64 status_updated_at_unix_ms = 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetDeviceListCommand {
|
||||||
|
message Request {}
|
||||||
|
|
||||||
|
message Feedback {
|
||||||
|
CommandHeader.Feedback header = 1;
|
||||||
|
string manager_name = 2;
|
||||||
|
string manager_version = 3;
|
||||||
|
string manager_description = 4;
|
||||||
|
repeated SystemDeviceInfo device_list = 5;
|
||||||
|
uint64 sampled_at_unix_ms = 6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
message GetSystemInfoCommand {
|
message GetSystemInfoCommand {
|
||||||
message Request {}
|
message Request {}
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ package cmvr.api;
|
|||||||
service SystemService {
|
service SystemService {
|
||||||
rpc GetSystemInfo(GetSystemInfoCommand.Request) returns (GetSystemInfoCommand.Feedback) {}
|
rpc GetSystemInfo(GetSystemInfoCommand.Request) returns (GetSystemInfoCommand.Feedback) {}
|
||||||
rpc GetSystemStatus(GetSystemStatusCommand.Request) returns (GetSystemStatusCommand.Feedback) {}
|
rpc GetSystemStatus(GetSystemStatusCommand.Request) returns (GetSystemStatusCommand.Feedback) {}
|
||||||
|
rpc GetDeviceList(GetDeviceListCommand.Request) returns (GetDeviceListCommand.Feedback) {}
|
||||||
|
|
||||||
rpc UpdateParams(UpdateParamsCommand.Request) returns (UpdateParamsCommand.Feedback) {}
|
rpc UpdateParams(UpdateParamsCommand.Request) returns (UpdateParamsCommand.Feedback) {}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user