fix: 动作
This commit is contained in:
parent
ac7d5c283c
commit
d955aa2275
@ -10,20 +10,18 @@ public enum FlowiseActionEnum {
|
|||||||
SPEAK("speak", "tts说话"),
|
SPEAK("speak", "tts说话"),
|
||||||
|
|
||||||
// ===== 表情控制 =====
|
// ===== 表情控制 =====
|
||||||
SMILE("smile", "微笑"),
|
SMILE("smile", "高兴"),
|
||||||
SURPRISED("surprised", "惊讶"),
|
SURPRISED("surprised", "惊讶"),
|
||||||
ANGRY("angry", "愤怒"),
|
|
||||||
SAD("sad", "悲伤"),
|
SAD("sad", "悲伤"),
|
||||||
SLEEP("sleep", "睡觉"),
|
TIRED("tired", "疲惫"),
|
||||||
YAWN("yawn", "打哈欠"),
|
|
||||||
|
|
||||||
// ===== 机械臂动作(预留)=====
|
// ===== 动作=====
|
||||||
WAVE("wave", "挥手"),
|
AC_ON("ac_on", "打开空调"),
|
||||||
GRAB("grab", "抓取"),
|
AC_OFF("ac_off", "关闭空调"),
|
||||||
POINT("point", "指向"),
|
MUSIC_ON("music_on", "打开音乐"),
|
||||||
HEART("heart", "比心"),
|
MUSIC_OFF("music_off", "关闭音乐"),
|
||||||
RAISE_HAND("raise_hand", "举手"),
|
DRIVE_MODE_SPORT("drive_mode_sport", "设置驾驶模式为运动模式"),
|
||||||
RESET_ARM("reset_arm", "机械臂归位");
|
DRIVE_MODE_COMFORT("drive_mode_comfort", "设置驾驶模式为舒适模式");
|
||||||
|
|
||||||
private final String action;
|
private final String action;
|
||||||
private final String description;
|
private final String description;
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.cmvr.test.service;
|
package com.cmvr.test.service;
|
||||||
|
|
||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
@ -15,6 +16,7 @@ import com.cmvr.test.enums.FlowiseActionEnum;
|
|||||||
import com.cmvr.test.flow.context.TaskContext;
|
import com.cmvr.test.flow.context.TaskContext;
|
||||||
import com.cmvr.test.flow.context.TaskContextManager;
|
import com.cmvr.test.flow.context.TaskContextManager;
|
||||||
import com.cmvr.test.flow.control.FlowControlService;
|
import com.cmvr.test.flow.control.FlowControlService;
|
||||||
|
import com.cmvr.test.flow.runtime.engine.FlowTaskRuntimeService;
|
||||||
import com.cmvr.test.model.vo.FlowiseActionRequestVO;
|
import com.cmvr.test.model.vo.FlowiseActionRequestVO;
|
||||||
import com.cmvr.test.model.vo.FlowiseChatRequestVO;
|
import com.cmvr.test.model.vo.FlowiseChatRequestVO;
|
||||||
import com.cmvr.test.model.vo.FlowiseStartRequestVO;
|
import com.cmvr.test.model.vo.FlowiseStartRequestVO;
|
||||||
@ -39,6 +41,7 @@ public class FlowiseActionService {
|
|||||||
private final EdgeHumanoidRobotService edgeHumanoidRobotService;
|
private final EdgeHumanoidRobotService edgeHumanoidRobotService;
|
||||||
private final TaskContextManager taskContextManager;
|
private final TaskContextManager taskContextManager;
|
||||||
private final FlowControlService flowControlService;
|
private final FlowControlService flowControlService;
|
||||||
|
private final FlowTaskRuntimeService flowTaskRuntimeService;
|
||||||
|
|
||||||
@Value("${flowise.tts}")
|
@Value("${flowise.tts}")
|
||||||
private String flowiseTts;
|
private String flowiseTts;
|
||||||
@ -132,18 +135,41 @@ public class FlowiseActionService {
|
|||||||
// ==== 表情 ====
|
// ==== 表情 ====
|
||||||
case SMILE:
|
case SMILE:
|
||||||
return edgeBioHeadService.specialExpression(terminalId, bioId, 1);
|
return edgeBioHeadService.specialExpression(terminalId, bioId, 1);
|
||||||
case SURPRISED:
|
|
||||||
return edgeBioHeadService.specialExpression(terminalId, bioId, 2);
|
|
||||||
case ANGRY:
|
|
||||||
return edgeBioHeadService.specialExpression(terminalId, bioId, 3);
|
|
||||||
case SAD:
|
case SAD:
|
||||||
return edgeBioHeadService.specialExpression(terminalId, bioId, 4);
|
return edgeBioHeadService.specialExpression(terminalId, bioId, 4);
|
||||||
case SLEEP:
|
case SURPRISED:
|
||||||
|
return edgeBioHeadService.specialExpression(terminalId, bioId, 2);
|
||||||
|
case TIRED:
|
||||||
return edgeBioHeadService.specialExpression(terminalId, bioId, 5);
|
return edgeBioHeadService.specialExpression(terminalId, bioId, 5);
|
||||||
case YAWN:
|
|
||||||
return edgeBioHeadService.specialExpression(terminalId, bioId, 6);
|
|
||||||
|
|
||||||
// ==== 动作 ====
|
// ==== 动作 ====
|
||||||
|
case AC_ON:
|
||||||
|
// TeTaskExecuteNormalVO teTaskExecuteNormalVO = new TeTaskExecuteNormalVO();
|
||||||
|
// teTaskExecuteNormalVO.setTerminalId(terminalId);
|
||||||
|
// teTaskExecuteNormalVO.setTaskId("bd19174754e6e2b84661a4771d04e212");
|
||||||
|
// flowTaskRuntimeService.executeTask(teTaskExecuteNormalVO);
|
||||||
|
HttpUtil.post("http://192.168.0.131:8000/action/one", "");
|
||||||
|
return "空调打开了";
|
||||||
|
|
||||||
|
case AC_OFF:
|
||||||
|
log.info("空调关闭了");
|
||||||
|
return "空调关闭了";
|
||||||
|
|
||||||
|
case MUSIC_ON:
|
||||||
|
log.info("音乐打开了");
|
||||||
|
return "音乐打开了";
|
||||||
|
|
||||||
|
case MUSIC_OFF:
|
||||||
|
log.info("音乐关闭了");
|
||||||
|
return "音乐关闭了";
|
||||||
|
|
||||||
|
case DRIVE_MODE_SPORT:
|
||||||
|
log.info("驾驶模式已切换为运动模式");
|
||||||
|
return "驾驶模式已切换为运动模式";
|
||||||
|
|
||||||
|
case DRIVE_MODE_COMFORT:
|
||||||
|
log.info("驾驶模式已切换为舒适模式");
|
||||||
|
return "驾驶模式已切换为舒适模式";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new UnsupportedOperationException("未实现的 Flowise Action: " + action);
|
throw new UnsupportedOperationException("未实现的 Flowise Action: " + action);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user