fix: 实车调试
This commit is contained in:
parent
9cf4a6f2f9
commit
cdc5d8d222
@ -39,4 +39,17 @@ public class EdgeHumanoidRobotController {
|
|||||||
public AjaxResult status(EdgeCommonVO vo) {
|
public AjaxResult status(EdgeCommonVO vo) {
|
||||||
return AjaxResult.ok(edgeHumanoidRobotService.getJointState(vo));
|
return AjaxResult.ok(edgeHumanoidRobotService.getJointState(vo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("使能开")
|
||||||
|
@GetMapping("/torqueOn")
|
||||||
|
public AjaxResult torqueOn(EdgeCommonVO vo) {
|
||||||
|
return AjaxResult.ok(edgeHumanoidRobotService.torqueOn(vo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("使能关")
|
||||||
|
@GetMapping("/torqueOff")
|
||||||
|
public AjaxResult torqueOff(EdgeCommonVO vo) {
|
||||||
|
return AjaxResult.ok(edgeHumanoidRobotService.torqueOff(vo));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,4 +24,19 @@ public interface EdgeBioHeadService {
|
|||||||
*/
|
*/
|
||||||
public String emergencyStop(EdgeCommonVO edgeCommonVO);
|
public String emergencyStop(EdgeCommonVO edgeCommonVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始说话
|
||||||
|
*/
|
||||||
|
public String speakStart(EdgeCommonVO edgeCommonVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止说话
|
||||||
|
*/
|
||||||
|
public String speakStop(EdgeCommonVO edgeCommonVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表情
|
||||||
|
*/
|
||||||
|
public String specialExpression(String terminalId,String deviceId,Integer expressKey);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,4 +22,14 @@ public interface EdgeHumanoidRobotService {
|
|||||||
* 旋转关节
|
* 旋转关节
|
||||||
*/
|
*/
|
||||||
public String speedJ(EdgeSpeedJVO vo);
|
public String speedJ(EdgeSpeedJVO vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使能开
|
||||||
|
*/
|
||||||
|
public String torqueOn(EdgeCommonVO vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使能关
|
||||||
|
*/
|
||||||
|
public String torqueOff(EdgeCommonVO vo);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import cmvr.api.BioHeadServiceGrpc;
|
|||||||
import cmvr.api.BioheadCommand;
|
import cmvr.api.BioheadCommand;
|
||||||
import cmvr.api.Common;
|
import cmvr.api.Common;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.cmvr.common.exception.GlobalException;
|
||||||
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
import com.cmvr.edge.client.manage.GrpcServiceManager;
|
||||||
import com.cmvr.edge.client.model.EdgeCommonVO;
|
import com.cmvr.edge.client.model.EdgeCommonVO;
|
||||||
import com.cmvr.edge.client.model.biohead.EdgeFacialExpressionVO;
|
import com.cmvr.edge.client.model.biohead.EdgeFacialExpressionVO;
|
||||||
@ -138,4 +139,54 @@ public class EdgeBioHeadServiceImpl implements EdgeBioHeadService {
|
|||||||
BioheadCommand.EmergencyStop.Feedback feedback = stub.emergencyStop(request);
|
BioheadCommand.EmergencyStop.Feedback feedback = stub.emergencyStop(request);
|
||||||
return JSON.toJSONString(feedback.getHeader());
|
return JSON.toJSONString(feedback.getHeader());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String speakStart(EdgeCommonVO edgeCommonVO) {
|
||||||
|
String terminalId = edgeCommonVO.getTerminalId();
|
||||||
|
String deviceId = edgeCommonVO.getDeviceId();
|
||||||
|
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 请求头
|
||||||
|
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
||||||
|
BioheadCommand.SpeakStart.Request request = BioheadCommand.SpeakStart.Request.newBuilder().setHeader(header).build();
|
||||||
|
BioheadCommand.SpeakStart.Feedback feedback = stub.speakStart(request);
|
||||||
|
return JSON.toJSONString(feedback.getHeader());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String speakStop(EdgeCommonVO edgeCommonVO) {
|
||||||
|
String terminalId = edgeCommonVO.getTerminalId();
|
||||||
|
String deviceId = edgeCommonVO.getDeviceId();
|
||||||
|
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 请求头
|
||||||
|
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
||||||
|
BioheadCommand.SpeakStop.Request request = BioheadCommand.SpeakStop.Request.newBuilder().setHeader(header).build();
|
||||||
|
BioheadCommand.SpeakStop.Feedback feedback = stub.speakStop(request);
|
||||||
|
return JSON.toJSONString(feedback.getHeader());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String specialExpression(String terminalId, String deviceId, Integer expressKey) {
|
||||||
|
BioHeadServiceGrpc.BioHeadServiceBlockingStub stub = grpcServiceManager.getGrpcClient(terminalId, BioHeadServiceGrpc.BioHeadServiceBlockingStub.class);
|
||||||
|
|
||||||
|
// 请求头
|
||||||
|
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(deviceId);
|
||||||
|
|
||||||
|
if (expressKey == 1) {
|
||||||
|
BioheadCommand.Happy.Request happy = BioheadCommand.Happy.Request.newBuilder().setHeader(header).build();
|
||||||
|
BioheadCommand.Happy.Feedback happyBack = stub.happy(happy);
|
||||||
|
return JSON.toJSONString(happyBack.getHeader());
|
||||||
|
}else if (expressKey == 2) {
|
||||||
|
BioheadCommand.Surprise.Request surprise = BioheadCommand.Surprise.Request.newBuilder().setHeader(header).build();
|
||||||
|
BioheadCommand.Surprise.Feedback surpriseBack = stub.surprise(surprise);
|
||||||
|
return JSON.toJSONString(surpriseBack.getHeader());
|
||||||
|
} else if (expressKey == 3) {
|
||||||
|
BioheadCommand.ExpressionTired.Request tired = BioheadCommand.ExpressionTired.Request.newBuilder().setHeader(header).build();
|
||||||
|
BioheadCommand.ExpressionTired.Feedback tiredBack = stub.expressionTired(tired);
|
||||||
|
return JSON.toJSONString(tiredBack.getHeader());
|
||||||
|
}else {
|
||||||
|
throw new GlobalException("错误的传参,1:高兴,2:惊讶,3:疲惫");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,4 +76,24 @@ public class EdgeHumanoidRobotServiceImpl implements EdgeHumanoidRobotService {
|
|||||||
HumanoidRobotCommand.SpeedJ.Response response = stub.speedJ(request);
|
HumanoidRobotCommand.SpeedJ.Response response = stub.speedJ(request);
|
||||||
return JSON.toJSONString(response.getHeader());
|
return JSON.toJSONString(response.getHeader());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String torqueOn(EdgeCommonVO vo) {
|
||||||
|
HumanoidRobotServiceGrpc.HumanoidRobotServiceBlockingStub stub =
|
||||||
|
grpcServiceManager.getGrpcClient(vo.getTerminalId(), HumanoidRobotServiceGrpc.HumanoidRobotServiceBlockingStub.class);
|
||||||
|
|
||||||
|
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(vo.getDeviceId());
|
||||||
|
Common.CommandHeader.Feedback response = stub.torqueOn(header);
|
||||||
|
return JSON.toJSONString(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String torqueOff(EdgeCommonVO vo) {
|
||||||
|
HumanoidRobotServiceGrpc.HumanoidRobotServiceBlockingStub stub =
|
||||||
|
grpcServiceManager.getGrpcClient(vo.getTerminalId(), HumanoidRobotServiceGrpc.HumanoidRobotServiceBlockingStub.class);
|
||||||
|
|
||||||
|
Common.CommandHeader.Request header = EdgeCommonUtil.buildRequest(vo.getDeviceId());
|
||||||
|
Common.CommandHeader.Feedback response = stub.torqueOff(header);
|
||||||
|
return JSON.toJSONString(response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -142,6 +142,161 @@ public final class BioHeadServiceGrpc {
|
|||||||
return getEmergencyStopMethod;
|
return getEmergencyStopMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.SpeakStart.Request,
|
||||||
|
cmvr.api.BioheadCommand.SpeakStart.Feedback> getSpeakStartMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "SpeakStart",
|
||||||
|
requestType = cmvr.api.BioheadCommand.SpeakStart.Request.class,
|
||||||
|
responseType = cmvr.api.BioheadCommand.SpeakStart.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.SpeakStart.Request,
|
||||||
|
cmvr.api.BioheadCommand.SpeakStart.Feedback> getSpeakStartMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.SpeakStart.Request, cmvr.api.BioheadCommand.SpeakStart.Feedback> getSpeakStartMethod;
|
||||||
|
if ((getSpeakStartMethod = BioHeadServiceGrpc.getSpeakStartMethod) == null) {
|
||||||
|
synchronized (BioHeadServiceGrpc.class) {
|
||||||
|
if ((getSpeakStartMethod = BioHeadServiceGrpc.getSpeakStartMethod) == null) {
|
||||||
|
BioHeadServiceGrpc.getSpeakStartMethod = getSpeakStartMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.BioheadCommand.SpeakStart.Request, cmvr.api.BioheadCommand.SpeakStart.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SpeakStart"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.SpeakStart.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.SpeakStart.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new BioHeadServiceMethodDescriptorSupplier("SpeakStart"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getSpeakStartMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.SpeakStop.Request,
|
||||||
|
cmvr.api.BioheadCommand.SpeakStop.Feedback> getSpeakStopMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "SpeakStop",
|
||||||
|
requestType = cmvr.api.BioheadCommand.SpeakStop.Request.class,
|
||||||
|
responseType = cmvr.api.BioheadCommand.SpeakStop.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.SpeakStop.Request,
|
||||||
|
cmvr.api.BioheadCommand.SpeakStop.Feedback> getSpeakStopMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.SpeakStop.Request, cmvr.api.BioheadCommand.SpeakStop.Feedback> getSpeakStopMethod;
|
||||||
|
if ((getSpeakStopMethod = BioHeadServiceGrpc.getSpeakStopMethod) == null) {
|
||||||
|
synchronized (BioHeadServiceGrpc.class) {
|
||||||
|
if ((getSpeakStopMethod = BioHeadServiceGrpc.getSpeakStopMethod) == null) {
|
||||||
|
BioHeadServiceGrpc.getSpeakStopMethod = getSpeakStopMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.BioheadCommand.SpeakStop.Request, cmvr.api.BioheadCommand.SpeakStop.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SpeakStop"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.SpeakStop.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.SpeakStop.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new BioHeadServiceMethodDescriptorSupplier("SpeakStop"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getSpeakStopMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.Happy.Request,
|
||||||
|
cmvr.api.BioheadCommand.Happy.Feedback> getHappyMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "Happy",
|
||||||
|
requestType = cmvr.api.BioheadCommand.Happy.Request.class,
|
||||||
|
responseType = cmvr.api.BioheadCommand.Happy.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.Happy.Request,
|
||||||
|
cmvr.api.BioheadCommand.Happy.Feedback> getHappyMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.Happy.Request, cmvr.api.BioheadCommand.Happy.Feedback> getHappyMethod;
|
||||||
|
if ((getHappyMethod = BioHeadServiceGrpc.getHappyMethod) == null) {
|
||||||
|
synchronized (BioHeadServiceGrpc.class) {
|
||||||
|
if ((getHappyMethod = BioHeadServiceGrpc.getHappyMethod) == null) {
|
||||||
|
BioHeadServiceGrpc.getHappyMethod = getHappyMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.BioheadCommand.Happy.Request, cmvr.api.BioheadCommand.Happy.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "Happy"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.Happy.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.Happy.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new BioHeadServiceMethodDescriptorSupplier("Happy"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getHappyMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.Surprise.Request,
|
||||||
|
cmvr.api.BioheadCommand.Surprise.Feedback> getSurpriseMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "Surprise",
|
||||||
|
requestType = cmvr.api.BioheadCommand.Surprise.Request.class,
|
||||||
|
responseType = cmvr.api.BioheadCommand.Surprise.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.Surprise.Request,
|
||||||
|
cmvr.api.BioheadCommand.Surprise.Feedback> getSurpriseMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.Surprise.Request, cmvr.api.BioheadCommand.Surprise.Feedback> getSurpriseMethod;
|
||||||
|
if ((getSurpriseMethod = BioHeadServiceGrpc.getSurpriseMethod) == null) {
|
||||||
|
synchronized (BioHeadServiceGrpc.class) {
|
||||||
|
if ((getSurpriseMethod = BioHeadServiceGrpc.getSurpriseMethod) == null) {
|
||||||
|
BioHeadServiceGrpc.getSurpriseMethod = getSurpriseMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.BioheadCommand.Surprise.Request, cmvr.api.BioheadCommand.Surprise.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "Surprise"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.Surprise.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.Surprise.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new BioHeadServiceMethodDescriptorSupplier("Surprise"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getSurpriseMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.ExpressionTired.Request,
|
||||||
|
cmvr.api.BioheadCommand.ExpressionTired.Feedback> getExpressionTiredMethod;
|
||||||
|
|
||||||
|
@io.grpc.stub.annotations.RpcMethod(
|
||||||
|
fullMethodName = SERVICE_NAME + '/' + "ExpressionTired",
|
||||||
|
requestType = cmvr.api.BioheadCommand.ExpressionTired.Request.class,
|
||||||
|
responseType = cmvr.api.BioheadCommand.ExpressionTired.Feedback.class,
|
||||||
|
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
public static io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.ExpressionTired.Request,
|
||||||
|
cmvr.api.BioheadCommand.ExpressionTired.Feedback> getExpressionTiredMethod() {
|
||||||
|
io.grpc.MethodDescriptor<cmvr.api.BioheadCommand.ExpressionTired.Request, cmvr.api.BioheadCommand.ExpressionTired.Feedback> getExpressionTiredMethod;
|
||||||
|
if ((getExpressionTiredMethod = BioHeadServiceGrpc.getExpressionTiredMethod) == null) {
|
||||||
|
synchronized (BioHeadServiceGrpc.class) {
|
||||||
|
if ((getExpressionTiredMethod = BioHeadServiceGrpc.getExpressionTiredMethod) == null) {
|
||||||
|
BioHeadServiceGrpc.getExpressionTiredMethod = getExpressionTiredMethod =
|
||||||
|
io.grpc.MethodDescriptor.<cmvr.api.BioheadCommand.ExpressionTired.Request, cmvr.api.BioheadCommand.ExpressionTired.Feedback>newBuilder()
|
||||||
|
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||||
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "ExpressionTired"))
|
||||||
|
.setSampledToLocalTracing(true)
|
||||||
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.ExpressionTired.Request.getDefaultInstance()))
|
||||||
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||||
|
cmvr.api.BioheadCommand.ExpressionTired.Feedback.getDefaultInstance()))
|
||||||
|
.setSchemaDescriptor(new BioHeadServiceMethodDescriptorSupplier("ExpressionTired"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getExpressionTiredMethod;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
*/
|
*/
|
||||||
@ -230,6 +385,47 @@ public final class BioHeadServiceGrpc {
|
|||||||
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEmergencyStopMethod(), responseObserver);
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEmergencyStopMethod(), responseObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 开始说话
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void speakStart(cmvr.api.BioheadCommand.SpeakStart.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.SpeakStart.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSpeakStartMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 停止说话
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void speakStop(cmvr.api.BioheadCommand.SpeakStop.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.SpeakStop.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSpeakStopMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void happy(cmvr.api.BioheadCommand.Happy.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.Happy.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getHappyMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void surprise(cmvr.api.BioheadCommand.Surprise.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.Surprise.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSurpriseMethod(), responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void expressionTired(cmvr.api.BioheadCommand.ExpressionTired.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.ExpressionTired.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExpressionTiredMethod(), 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(
|
||||||
@ -260,6 +456,41 @@ public final class BioHeadServiceGrpc {
|
|||||||
cmvr.api.BioheadCommand.EmergencyStop.Request,
|
cmvr.api.BioheadCommand.EmergencyStop.Request,
|
||||||
cmvr.api.BioheadCommand.EmergencyStop.Feedback>(
|
cmvr.api.BioheadCommand.EmergencyStop.Feedback>(
|
||||||
this, METHODID_EMERGENCY_STOP)))
|
this, METHODID_EMERGENCY_STOP)))
|
||||||
|
.addMethod(
|
||||||
|
getSpeakStartMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.BioheadCommand.SpeakStart.Request,
|
||||||
|
cmvr.api.BioheadCommand.SpeakStart.Feedback>(
|
||||||
|
this, METHODID_SPEAK_START)))
|
||||||
|
.addMethod(
|
||||||
|
getSpeakStopMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.BioheadCommand.SpeakStop.Request,
|
||||||
|
cmvr.api.BioheadCommand.SpeakStop.Feedback>(
|
||||||
|
this, METHODID_SPEAK_STOP)))
|
||||||
|
.addMethod(
|
||||||
|
getHappyMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.BioheadCommand.Happy.Request,
|
||||||
|
cmvr.api.BioheadCommand.Happy.Feedback>(
|
||||||
|
this, METHODID_HAPPY)))
|
||||||
|
.addMethod(
|
||||||
|
getSurpriseMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.BioheadCommand.Surprise.Request,
|
||||||
|
cmvr.api.BioheadCommand.Surprise.Feedback>(
|
||||||
|
this, METHODID_SURPRISE)))
|
||||||
|
.addMethod(
|
||||||
|
getExpressionTiredMethod(),
|
||||||
|
io.grpc.stub.ServerCalls.asyncUnaryCall(
|
||||||
|
new MethodHandlers<
|
||||||
|
cmvr.api.BioheadCommand.ExpressionTired.Request,
|
||||||
|
cmvr.api.BioheadCommand.ExpressionTired.Feedback>(
|
||||||
|
this, METHODID_EXPRESSION_TIRED)))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -321,6 +552,52 @@ public final class BioHeadServiceGrpc {
|
|||||||
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
getChannel().newCall(getEmergencyStopMethod(), getCallOptions()), request, responseObserver);
|
getChannel().newCall(getEmergencyStopMethod(), getCallOptions()), request, responseObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 开始说话
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void speakStart(cmvr.api.BioheadCommand.SpeakStart.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.SpeakStart.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getSpeakStartMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 停止说话
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public void speakStop(cmvr.api.BioheadCommand.SpeakStop.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.SpeakStop.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getSpeakStopMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void happy(cmvr.api.BioheadCommand.Happy.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.Happy.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getHappyMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void surprise(cmvr.api.BioheadCommand.Surprise.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.Surprise.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getSurpriseMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public void expressionTired(cmvr.api.BioheadCommand.ExpressionTired.Request request,
|
||||||
|
io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.ExpressionTired.Feedback> responseObserver) {
|
||||||
|
io.grpc.stub.ClientCalls.asyncUnaryCall(
|
||||||
|
getChannel().newCall(getExpressionTiredMethod(), getCallOptions()), request, responseObserver);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -369,6 +646,47 @@ public final class BioHeadServiceGrpc {
|
|||||||
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
getChannel(), getEmergencyStopMethod(), getCallOptions(), request);
|
getChannel(), getEmergencyStopMethod(), getCallOptions(), request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 开始说话
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public cmvr.api.BioheadCommand.SpeakStart.Feedback speakStart(cmvr.api.BioheadCommand.SpeakStart.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getSpeakStartMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 停止说话
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public cmvr.api.BioheadCommand.SpeakStop.Feedback speakStop(cmvr.api.BioheadCommand.SpeakStop.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getSpeakStopMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.BioheadCommand.Happy.Feedback happy(cmvr.api.BioheadCommand.Happy.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getHappyMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.BioheadCommand.Surprise.Feedback surprise(cmvr.api.BioheadCommand.Surprise.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getSurpriseMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public cmvr.api.BioheadCommand.ExpressionTired.Feedback expressionTired(cmvr.api.BioheadCommand.ExpressionTired.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.blockingUnaryCall(
|
||||||
|
getChannel(), getExpressionTiredMethod(), getCallOptions(), request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -420,12 +738,63 @@ public final class BioHeadServiceGrpc {
|
|||||||
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
getChannel().newCall(getEmergencyStopMethod(), getCallOptions()), request);
|
getChannel().newCall(getEmergencyStopMethod(), getCallOptions()), request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 开始说话
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.BioheadCommand.SpeakStart.Feedback> speakStart(
|
||||||
|
cmvr.api.BioheadCommand.SpeakStart.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getSpeakStartMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 停止说话
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.BioheadCommand.SpeakStop.Feedback> speakStop(
|
||||||
|
cmvr.api.BioheadCommand.SpeakStop.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getSpeakStopMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.BioheadCommand.Happy.Feedback> happy(
|
||||||
|
cmvr.api.BioheadCommand.Happy.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getHappyMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.BioheadCommand.Surprise.Feedback> surprise(
|
||||||
|
cmvr.api.BioheadCommand.Surprise.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getSurpriseMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public com.google.common.util.concurrent.ListenableFuture<cmvr.api.BioheadCommand.ExpressionTired.Feedback> expressionTired(
|
||||||
|
cmvr.api.BioheadCommand.ExpressionTired.Request request) {
|
||||||
|
return io.grpc.stub.ClientCalls.futureUnaryCall(
|
||||||
|
getChannel().newCall(getExpressionTiredMethod(), getCallOptions()), request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int METHODID_SET_EXPRESSION = 0;
|
private static final int METHODID_SET_EXPRESSION = 0;
|
||||||
private static final int METHODID_GET_SYSTEM_STATUS = 1;
|
private static final int METHODID_GET_SYSTEM_STATUS = 1;
|
||||||
private static final int METHODID_EMERGENCY_STOP = 2;
|
private static final int METHODID_EMERGENCY_STOP = 2;
|
||||||
private static final int METHODID_STREAM_EXPRESSION = 3;
|
private static final int METHODID_SPEAK_START = 3;
|
||||||
|
private static final int METHODID_SPEAK_STOP = 4;
|
||||||
|
private static final int METHODID_HAPPY = 5;
|
||||||
|
private static final int METHODID_SURPRISE = 6;
|
||||||
|
private static final int METHODID_EXPRESSION_TIRED = 7;
|
||||||
|
private static final int METHODID_STREAM_EXPRESSION = 8;
|
||||||
|
|
||||||
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>,
|
||||||
@ -456,6 +825,26 @@ public final class BioHeadServiceGrpc {
|
|||||||
serviceImpl.emergencyStop((cmvr.api.BioheadCommand.EmergencyStop.Request) request,
|
serviceImpl.emergencyStop((cmvr.api.BioheadCommand.EmergencyStop.Request) request,
|
||||||
(io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.EmergencyStop.Feedback>) responseObserver);
|
(io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.EmergencyStop.Feedback>) responseObserver);
|
||||||
break;
|
break;
|
||||||
|
case METHODID_SPEAK_START:
|
||||||
|
serviceImpl.speakStart((cmvr.api.BioheadCommand.SpeakStart.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.SpeakStart.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_SPEAK_STOP:
|
||||||
|
serviceImpl.speakStop((cmvr.api.BioheadCommand.SpeakStop.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.SpeakStop.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_HAPPY:
|
||||||
|
serviceImpl.happy((cmvr.api.BioheadCommand.Happy.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.Happy.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_SURPRISE:
|
||||||
|
serviceImpl.surprise((cmvr.api.BioheadCommand.Surprise.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.Surprise.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
|
case METHODID_EXPRESSION_TIRED:
|
||||||
|
serviceImpl.expressionTired((cmvr.api.BioheadCommand.ExpressionTired.Request) request,
|
||||||
|
(io.grpc.stub.StreamObserver<cmvr.api.BioheadCommand.ExpressionTired.Feedback>) responseObserver);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new AssertionError();
|
throw new AssertionError();
|
||||||
}
|
}
|
||||||
@ -524,6 +913,11 @@ public final class BioHeadServiceGrpc {
|
|||||||
.addMethod(getStreamExpressionMethod())
|
.addMethod(getStreamExpressionMethod())
|
||||||
.addMethod(getGetSystemStatusMethod())
|
.addMethod(getGetSystemStatusMethod())
|
||||||
.addMethod(getEmergencyStopMethod())
|
.addMethod(getEmergencyStopMethod())
|
||||||
|
.addMethod(getSpeakStartMethod())
|
||||||
|
.addMethod(getSpeakStopMethod())
|
||||||
|
.addMethod(getHappyMethod())
|
||||||
|
.addMethod(getSurpriseMethod())
|
||||||
|
.addMethod(getExpressionTiredMethod())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -24,17 +24,27 @@ public final class BioheadService {
|
|||||||
static {
|
static {
|
||||||
java.lang.String[] descriptorData = {
|
java.lang.String[] descriptorData = {
|
||||||
"\n\036cmvr/api/biohead_service.proto\022\010cmvr.a" +
|
"\n\036cmvr/api/biohead_service.proto\022\010cmvr.a" +
|
||||||
"pi\032\036cmvr/api/biohead_command.proto2\207\003\n\016B" +
|
"pi\032\036cmvr/api/biohead_command.proto2\375\005\n\016B" +
|
||||||
"ioHeadService\022`\n\rSetExpression\022%.cmvr.ap" +
|
"ioHeadService\022`\n\rSetExpression\022%.cmvr.ap" +
|
||||||
"i.SetFacialExpression.Request\032&.cmvr.api" +
|
"i.SetFacialExpression.Request\032&.cmvr.api" +
|
||||||
".SetFacialExpression.Feedback\"\000\022m\n\020Strea" +
|
".SetFacialExpression.Feedback\"\000\022k\n\020Strea" +
|
||||||
"mExpression\022(.cmvr.api.StreamFacialExpre" +
|
"mExpression\022(.cmvr.api.StreamFacialExpre" +
|
||||||
"ssion.Request\032).cmvr.api.StreamFacialExp" +
|
"ssion.Request\032).cmvr.api.StreamFacialExp" +
|
||||||
"ression.Feedback\"\000(\0010\001\022N\n\017GetSystemStatu" +
|
"ression.Feedback(\0010\001\022N\n\017GetSystemStatus\022" +
|
||||||
"s\022\033.cmvr.api.GetStatus.Request\032\034.cmvr.ap" +
|
"\033.cmvr.api.GetStatus.Request\032\034.cmvr.api." +
|
||||||
"i.GetStatus.Feedback\"\000\022T\n\rEmergencyStop\022" +
|
"GetStatus.Feedback\"\000\022T\n\rEmergencyStop\022\037." +
|
||||||
"\037.cmvr.api.EmergencyStop.Request\032 .cmvr." +
|
"cmvr.api.EmergencyStop.Request\032 .cmvr.ap" +
|
||||||
"api.EmergencyStop.Feedback\"\000b\006proto3"
|
"i.EmergencyStop.Feedback\"\000\022K\n\nSpeakStart" +
|
||||||
|
"\022\034.cmvr.api.SpeakStart.Request\032\035.cmvr.ap" +
|
||||||
|
"i.SpeakStart.Feedback\"\000\022H\n\tSpeakStop\022\033.c" +
|
||||||
|
"mvr.api.SpeakStop.Request\032\034.cmvr.api.Spe" +
|
||||||
|
"akStop.Feedback\"\000\022<\n\005Happy\022\027.cmvr.api.Ha" +
|
||||||
|
"ppy.Request\032\030.cmvr.api.Happy.Feedback\"\000\022" +
|
||||||
|
"E\n\010Surprise\022\032.cmvr.api.Surprise.Request\032" +
|
||||||
|
"\033.cmvr.api.Surprise.Feedback\"\000\022Z\n\017Expres" +
|
||||||
|
"sionTired\022!.cmvr.api.ExpressionTired.Req" +
|
||||||
|
"uest\032\".cmvr.api.ExpressionTired.Feedback" +
|
||||||
|
"\"\000b\006proto3"
|
||||||
};
|
};
|
||||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
.internalBuildGeneratedFileFrom(descriptorData,
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
|
|||||||
@ -9,17 +9,17 @@ package cmvr.api;
|
|||||||
* 包含生物头部机器人面部各部位的运动参数,用于精确控制面部表情
|
* 包含生物头部机器人面部各部位的运动参数,用于精确控制面部表情
|
||||||
*/
|
*/
|
||||||
message FacialExpression {
|
message FacialExpression {
|
||||||
/**
|
/**
|
||||||
* 眉毛控制参数
|
* 眉毛控制参数
|
||||||
* 左右眉毛的内外侧垂直位置(0.0-1.0标准化值)
|
* 左右眉毛的内外侧垂直位置(0.0-1.0标准化值)
|
||||||
*/
|
*/
|
||||||
message Eyebrow {
|
message Eyebrow {
|
||||||
float left_outside_y = 1; // 左眉外侧垂直位置
|
float left_outside_y = 1; // 左眉外侧垂直位置
|
||||||
float left_inside_y = 2; // 左眉内侧垂直位置
|
float left_inside_y = 2; // 左眉内侧垂直位置
|
||||||
float right_outside_y = 3; // 右眉外侧垂直位置
|
float right_outside_y = 3; // 右眉外侧垂直位置
|
||||||
float right_inside_y = 4; // 右眉内侧垂直位置
|
float right_inside_y = 4; // 右眉内侧垂直位置
|
||||||
}
|
}
|
||||||
Eyebrow eyebrow = 3; // 眉毛参数封装
|
Eyebrow eyebrow = 3; // 眉毛参数封装
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 眼睑控制参数
|
* 眼睑控制参数
|
||||||
@ -111,16 +111,16 @@ message FacialExpression {
|
|||||||
* 用于单次设置生物头部的面部表情
|
* 用于单次设置生物头部的面部表情
|
||||||
*/
|
*/
|
||||||
message SetFacialExpression {
|
message SetFacialExpression {
|
||||||
message Request {
|
message Request {
|
||||||
CommandHeader.Request header = 1; // 通用命令头,包含设备ID和时间戳
|
CommandHeader.Request header = 1; // 通用命令头,包含设备ID和时间戳
|
||||||
FacialExpression expression = 2; // 具体面部表情参数
|
FacialExpression expression = 2; // 具体面部表情参数
|
||||||
}
|
}
|
||||||
|
|
||||||
message Feedback {
|
message Feedback {
|
||||||
CommandHeader.Feedback header = 1; // 通用反馈头,包含操作状态和时间戳
|
CommandHeader.Feedback header = 1; // 通用反馈头,包含操作状态和时间戳
|
||||||
string execution_id = 2; // 表情执行任务ID
|
string execution_id = 2; // 表情执行任务ID
|
||||||
float execution_time_ms = 3; // 表情执行耗时(毫秒)
|
float execution_time_ms = 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; // 执行误差
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -145,18 +145,18 @@ message StreamFacialExpression {
|
|||||||
* 用于查询当前头部各部位的状态和位置
|
* 用于查询当前头部各部位的状态和位置
|
||||||
*/
|
*/
|
||||||
message GetStatus {
|
message GetStatus {
|
||||||
message Request {
|
message Request {
|
||||||
CommandHeader.Request header = 1; // 通用命令头
|
CommandHeader.Request header = 1; // 通用命令头
|
||||||
}
|
}
|
||||||
|
|
||||||
message Feedback {
|
message Feedback {
|
||||||
CommandHeader.Feedback header = 1; // 通用反馈头
|
CommandHeader.Feedback header = 1; // 通用反馈头
|
||||||
bool is_moving = 2; // 是否有部位在移动
|
bool is_moving = 2; // 是否有部位在移动
|
||||||
string last_request_id = 3; // 上一次请求的ID
|
string last_request_id = 3; // 上一次请求的ID
|
||||||
repeated float current_positions = 4; // 当前各部位位置参数
|
repeated float current_positions = 4; // 当前各部位位置参数
|
||||||
bool camera_recording = 5; // 相机是否在录制
|
bool camera_recording = 5; // 相机是否在录制
|
||||||
string active_recording_id = 6; // 活跃录制任务的ID
|
string active_recording_id = 6; // 活跃录制任务的ID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -164,12 +164,69 @@ message GetStatus {
|
|||||||
* 用于立即停止所有面部动作
|
* 用于立即停止所有面部动作
|
||||||
*/
|
*/
|
||||||
message EmergencyStop {
|
message EmergencyStop {
|
||||||
message Request {
|
message Request {
|
||||||
CommandHeader.Request header = 1; // 通用命令头
|
CommandHeader.Request header = 1; // 通用命令头
|
||||||
}
|
}
|
||||||
|
|
||||||
message Feedback {
|
message Feedback {
|
||||||
CommandHeader.Feedback header = 1; // 通用反馈头
|
CommandHeader.Feedback header = 1; // 通用反馈头
|
||||||
string stopped_processes = 2; // 已停止的进程列表
|
string stopped_processes = 2; // 已停止的进程列表
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message SpeakStart {
|
||||||
|
message Request {
|
||||||
|
CommandHeader.Request header = 1; // 通用命令头
|
||||||
|
}
|
||||||
|
|
||||||
|
message Feedback {
|
||||||
|
CommandHeader.Feedback header = 1; // 通用反馈头
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message SpeakStop {
|
||||||
|
message Request {
|
||||||
|
CommandHeader.Request header = 1; // 通用命令头
|
||||||
|
}
|
||||||
|
|
||||||
|
message Feedback {
|
||||||
|
CommandHeader.Feedback header = 1; // 通用反馈头
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 表情控制 - 高兴
|
||||||
|
message Happy {
|
||||||
|
message Request {
|
||||||
|
CommandHeader.Request header = 1; // 通用命令头
|
||||||
|
}
|
||||||
|
|
||||||
|
message Feedback {
|
||||||
|
CommandHeader.Feedback header = 1; // 通用反馈头
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 表情控制 - 惊讶
|
||||||
|
message Surprise {
|
||||||
|
message Request {
|
||||||
|
CommandHeader.Request header = 1; // 通用命令头
|
||||||
|
}
|
||||||
|
|
||||||
|
message Feedback {
|
||||||
|
CommandHeader.Feedback header = 1; // 通用反馈头
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
message ExpressionTired {
|
||||||
|
message Request {
|
||||||
|
CommandHeader.Request header = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Feedback {
|
||||||
|
CommandHeader.Feedback header = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -5,18 +5,32 @@ 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 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 GetSystemStatus(GetStatus.Request) returns (GetStatus.Feedback){};
|
|
||||||
|
|
||||||
// 紧急停止
|
|
||||||
rpc EmergencyStop(EmergencyStop.Request) returns (EmergencyStop.Feedback){};
|
|
||||||
}
|
}
|
||||||
@ -46,6 +46,11 @@ public enum ActionEnum {
|
|||||||
// ---------------机械臂---------------
|
// ---------------机械臂---------------
|
||||||
TOUCH("EDGE", "TOUCH", "触控"),
|
TOUCH("EDGE", "TOUCH", "触控"),
|
||||||
|
|
||||||
|
// --------------- 头部 ---------------
|
||||||
|
BIO_HEAD_SPEAK_START("EDGE", "BIO_HEAD_SPEAK_START", "开始说话"),
|
||||||
|
BIO_HEAD_SPEAK_STOP("EDGE", "BIO_HEAD_SPEAK_STOP", "停止说话"),
|
||||||
|
BIO_HEAD_SPECIAL_EXPRESSION("EDGE", "BIO_HEAD_SPECIAL_EXPRESSION", "表情,1:高兴,2:惊讶,3:疲惫"),
|
||||||
|
|
||||||
// 大模型行为
|
// 大模型行为
|
||||||
// ---------------获取触控坐标---------------
|
// ---------------获取触控坐标---------------
|
||||||
TOUCH_COORDINATES("LLM", "TOUCH_COORDINATES", "获取触控坐标"),
|
TOUCH_COORDINATES("LLM", "TOUCH_COORDINATES", "获取触控坐标"),
|
||||||
|
|||||||
@ -0,0 +1,60 @@
|
|||||||
|
package com.cmvr.test.flow.runtime.operator.edge;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.cmvr.common.exception.GlobalException;
|
||||||
|
import com.cmvr.edge.client.model.EdgeCommonVO;
|
||||||
|
import com.cmvr.edge.client.service.EdgeBioHeadService;
|
||||||
|
import com.cmvr.test.enums.ActionEnum;
|
||||||
|
import com.cmvr.test.flow.runtime.message.TaskNodeExecuteMessage;
|
||||||
|
import com.cmvr.test.flow.runtime.message.TaskNodeExecuteResult;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class EdgeHeadOperateService implements EdgeOperateService {
|
||||||
|
|
||||||
|
private final EdgeBioHeadService edgeBioHeadService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supports(ActionEnum action) {
|
||||||
|
return action.name().startsWith("BIO_HEAD_");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TaskNodeExecuteResult execute(TaskNodeExecuteMessage message) {
|
||||||
|
ActionEnum action = message.getAction();
|
||||||
|
JSONObject inputParams = message.getInputParams();
|
||||||
|
String terminalId = message.getTerminalId();
|
||||||
|
String deviceId = inputParams.getString("deviceId");
|
||||||
|
|
||||||
|
switch (action) {
|
||||||
|
case BIO_HEAD_SPEAK_START: {
|
||||||
|
EdgeCommonVO edgeCommonVO = new EdgeCommonVO();
|
||||||
|
edgeCommonVO.setDeviceId(deviceId);
|
||||||
|
edgeCommonVO.setTerminalId(terminalId);
|
||||||
|
edgeBioHeadService.speakStart(edgeCommonVO);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BIO_HEAD_SPEAK_STOP: {
|
||||||
|
EdgeCommonVO edgeCommonVO = new EdgeCommonVO();
|
||||||
|
edgeCommonVO.setDeviceId(deviceId);
|
||||||
|
edgeCommonVO.setTerminalId(terminalId);
|
||||||
|
edgeBioHeadService.speakStop(edgeCommonVO);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BIO_HEAD_SPECIAL_EXPRESSION: {
|
||||||
|
Integer expressKey = inputParams.getInteger("expressKey");
|
||||||
|
edgeBioHeadService.specialExpression(terminalId,deviceId,expressKey);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new GlobalException("不支持的头部操作类型: " + action);
|
||||||
|
}
|
||||||
|
return TaskNodeExecuteResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -12,6 +12,8 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@ -37,6 +39,15 @@ public class EdgeTouchOperateService implements EdgeOperateService {
|
|||||||
EdgeMoveJVO edgeMoveJVO = JSON.parseObject(touchParams, EdgeMoveJVO.class);
|
EdgeMoveJVO edgeMoveJVO = JSON.parseObject(touchParams, EdgeMoveJVO.class);
|
||||||
edgeMoveJVO.setTerminalId(terminalId);
|
edgeMoveJVO.setTerminalId(terminalId);
|
||||||
edgeMoveJVO.setDeviceId(deviceId);
|
edgeMoveJVO.setDeviceId(deviceId);
|
||||||
|
|
||||||
|
edgeMoveJVO.setAcc(6d);
|
||||||
|
edgeMoveJVO.setVel(6d);
|
||||||
|
List<EdgeMoveJVO.JointCmd> cmds = edgeMoveJVO.getCmds();
|
||||||
|
for (EdgeMoveJVO.JointCmd cmd : cmds) {
|
||||||
|
if (cmd.getJointName().equals("R_WRIST_Y")) {
|
||||||
|
cmd.setRad(cmd.getRad() - 0.12d);
|
||||||
|
}
|
||||||
|
}
|
||||||
edgeHumanoidRobotService.moveJ(edgeMoveJVO);
|
edgeHumanoidRobotService.moveJ(edgeMoveJVO);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,8 @@ package com.cmvr.test.flow.runtime.operator.vi;
|
|||||||
import cmvr.api.SpeakerCommand;
|
import cmvr.api.SpeakerCommand;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.cmvr.common.exception.GlobalException;
|
import com.cmvr.common.exception.GlobalException;
|
||||||
|
import com.cmvr.edge.client.model.EdgeCommonVO;
|
||||||
|
import com.cmvr.edge.client.service.EdgeBioHeadService;
|
||||||
import com.cmvr.edge.client.service.EdgeSpeakerService;
|
import com.cmvr.edge.client.service.EdgeSpeakerService;
|
||||||
import com.cmvr.test.enums.ActionEnum;
|
import com.cmvr.test.enums.ActionEnum;
|
||||||
import com.cmvr.test.flow.runtime.message.TaskNodeExecuteMessage;
|
import com.cmvr.test.flow.runtime.message.TaskNodeExecuteMessage;
|
||||||
@ -24,6 +26,7 @@ import java.io.File;
|
|||||||
public class ViPlayOperateService implements VIOperateService {
|
public class ViPlayOperateService implements VIOperateService {
|
||||||
|
|
||||||
private final EdgeSpeakerService edgeSpeakerService;
|
private final EdgeSpeakerService edgeSpeakerService;
|
||||||
|
private final EdgeBioHeadService edgeBioHeadService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supports(ActionEnum action) {
|
public boolean supports(ActionEnum action) {
|
||||||
@ -41,6 +44,11 @@ public class ViPlayOperateService implements VIOperateService {
|
|||||||
String audioPath = inputParams.getString("audioPath");
|
String audioPath = inputParams.getString("audioPath");
|
||||||
String terminalId = message.getTerminalId();
|
String terminalId = message.getTerminalId();
|
||||||
log.info("播放语料成功,deviceId={},audioPath={},terminalId={}", deviceId, audioPath, terminalId);
|
log.info("播放语料成功,deviceId={},audioPath={},terminalId={}", deviceId, audioPath, terminalId);
|
||||||
|
// 播放前调用张嘴
|
||||||
|
EdgeCommonVO edgeCommonVO = new EdgeCommonVO();
|
||||||
|
edgeCommonVO.setDeviceId(deviceId);
|
||||||
|
edgeCommonVO.setTerminalId(terminalId);
|
||||||
|
edgeBioHeadService.speakStart(edgeCommonVO);
|
||||||
edgeSpeakerService.playAudio(terminalId, deviceId, audioPath);
|
edgeSpeakerService.playAudio(terminalId, deviceId, audioPath);
|
||||||
// 等待播放完成
|
// 等待播放完成
|
||||||
while (true) {
|
while (true) {
|
||||||
@ -55,7 +63,8 @@ public class ViPlayOperateService implements VIOperateService {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 播放完成调用闭嘴
|
||||||
|
edgeBioHeadService.speakStop(edgeCommonVO);
|
||||||
// todo 本机测试播放
|
// todo 本机测试播放
|
||||||
// playAudio(audioPath);
|
// playAudio(audioPath);
|
||||||
return TaskNodeExecuteResult.success();
|
return TaskNodeExecuteResult.success();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user