# kuavo_exhibition_opensource **Repository Path**: leju-robot/kuavo_exhibition_opensource ## Basic Information - **Project Name**: kuavo_exhibition_opensource - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: dev - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 2 - **Created**: 2025-05-26 - **Last Updated**: 2026-04-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Kuavo Exhibition 展厅机器人系统 ## 目录 - [系统概述](#系统概述) - [代码克隆](#代码克隆) - [编译与运行](#编译与运行) - [系统架构](#系统架构) - [工作流程](#工作流程) - [模块功能说明](#模块功能说明) - [接口文档](#接口文档) - [话题接口](#话题接口) - [服务接口](#服务接口) --- ## 系统概述 Kuavo Exhibition 是一个完整的展厅类人形机器人系统,用于展厅导览、迎宾、讲解等场景。系统采用模块化设计,包含以下核心功能: - **语音交互**:语音识别(ASR)、语音合成(TTS)、语音克隆、大模型对话 - **导航控制**:激光导航、路径规划、自动避障、任务点管理 - **视觉感知**:深度摄像头、人员检测、人脸识别、视觉迎宾 - **动作控制**:机械臂轨迹规划、头部运动、LED灯控制 - **通信接口**:WebSocket/ROS Bridge、HTTP文件服务、WebRTC视频流 --- ## 代码克隆 ```bash cd ~ rm -rf ~/kuavo_exhibition ``` ### lejuhub仓库克隆指令(内部仓库) ```bash git clone https://www.lejuhub.com/ros-application-team/kuavo_exhibition.git ``` ### gitee仓库克隆指令(部署请用开源仓库指令) ```bash git clone https://gitee.com/leju-robot/kuavo_exhibition_opensource.git kuavo_exhibition ``` --- ## 编译与运行 ### 编译 ```bash cd ~/kuavo_exhibition catkin build # 或者 catkin_make source devel/setup.bash ``` ### 将环境变量添加进入 `~/.bashrc` ```bash echo "# kuavo_exhibition source ~/kuavo_exhibition/devel/setup.bash --extend" >> ~/.bashrc ``` ### 运行 ```bash roslaunch kuavo_exhibition_start kuavo_new_start.launch ``` ### 设置开机自启动 参考 [展厅版本开机自启动设置](src/kuavo_exhibition_start/readme.md) --- ## 系统架构 ### 代码目录结构 ``` kuavo_exhibition/ ├── config/ # 配置文件目录 │ ├── params.yaml # 全局参数配置 │ └── action_config.yaml # 动作配置文件 ├── src/ │ ├── kuavo_exhibition_msgs/ # 核心消息和服务定义 │ ├── kuavo_exhibition_start/ # 系统启动模块 │ ├── kuavo_exhibition_play_music/ # 语音管理模块 │ ├── kuavo_exhibition_follow/ # UWB跟随模块 │ ├── kuavo_lidar_nav/ # 激光导航模块 │ ├── kuavo_websocket_pkg/ # WebSocket通信模块 │ ├── kuavo_head_led_control/ # LED灯控制模块 │ ├── kuavo_ros_vision/ # 视觉系统模块 │ │ ├── OrbbecSDK_ROS1/ # 深度摄像头驱动 │ │ └── store_welcome/ # 视觉迎宾系统 │ ├── face_recognition_system/ # 人脸识别系统 │ ├── task_nodes_manager/ # 任务节点管理 │ ├── llm_demo/ # 大模型对话系统 │ │ ├── kuavo_large_model/ # 主要大模型服务 │ │ ├── doubao_refactor/ # 豆包模型对接 │ │ ├── doubao/ # 豆包原始版本 │ │ └── kuavo_multimodal/ # 多模态对话 │ ├── local_model/ # 本地模型推理 │ ├── ros_audio/ # 音频处理模块 │ │ ├── kuavo_audio_player/ # 音频播放 │ │ └── kuavo_audio_receiver/ # 麦克风接收 │ ├── dx_nav_common/ # 导航公共消息定义 │ ├── tts_flyos-tts_aiui/ # AIUI TTS实现 │ └── kuavo_launch_demo/ # 演示启动器 └── README.md ``` ### 模块层次结构 ``` ┌─────────────────────────────────────────────────────────────────────────┐ │ 应用层 (Application Layer) │ │ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ ┌──────────────┐ │ │ │ kuavo_exhibition_start │ │ task_nodes_manager │ │ llm_demo │ │ store_welcome │ │ │ └───────────────┘ └───────────────┘ └───────────────┘ └──────────────┘ │ ├─────────────────────────────────────────────────────────────────────────┤ │ 服务层 (Service Layer) │ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌─────────────────┐ │ │ │ voice_manager │ │ kuavo_lidar_nav │ │ audio_player │ │ led_control │ │ │ └──────────────┘ └──────────────┘ └──────────────┘ └─────────────────┘ │ ├─────────────────────────────────────────────────────────────────────────┤ │ 通信层 (Communication Layer) │ │ ┌──────────────────────┐ ┌───────────────┐ ┌──────────────────────────┐ │ │ │ rosbridge_websocket │ │ rosapi │ │ kuavo_websocket_pkg │ │ │ │ (port: 25432) │ │ │ │ (HTTP/WebRTC/UDP) │ │ │ └──────────────────────┘ └───────────────┘ └──────────────────────────┘ │ ├─────────────────────────────────────────────────────────────────────────┤ │ 消息层 (Message Layer) │ │ ┌──────────────────────┐ ┌──────────────────────┐ │ │ │ kuavo_exhibition_msgs │ │ dx_nav_common │ │ │ └──────────────────────┘ └──────────────────────┘ │ └────────────────────────────────────────────────────────────────────────┘ ``` --- ## 工作流程 ### 1. 系统启动流程 ``` kuavo_new_start.launch │ ├─► ROS Bridge 层 │ ├─► rosbridge_websocket (WebSocket通信,端口25432) │ └─► rosapi (ROS API接口) │ ├─► WebSocket 服务层 │ ├─► robot_broadcast (机器人状态广播) │ ├─► app_robot_control (应用控制) │ ├─► cmd_vel_forwarder (速度指令转发) │ ├─► camera_manager (摄像头管理) │ ├─► vr_action_recordings (VR动作录制) │ ├─► wifi_connect_manager (WiFi管理) │ ├─► do_action (动作执行) │ ├─► map_evaluate_control_server (地图评估) │ └─► volume_control_server (音量控制) │ ├─► 语音模块 │ ├─► voice_clone_manager (语音克隆) │ ├─► voice_manager (语音管理服务) │ └─► upload_greeting_text_server (问候文本上传) │ ├─► 音频模块 (仅ROBOT_VERSION=52) │ ├─► audio_stream_player_node (流式音频播放) │ └─► play_music_node (音乐文件播放) │ ├─► 导航模块 │ ├─► kuavo_lidar_nav_node (激光导航) │ ├─► robot_navigation_state_node (导航状态发布) │ └─► kuavo_auto_initpose_node (自动初始化位置) │ ├─► 任务管理模块 | └─► task_nodes_manager_node (任务/轨迹规划) │ ├─► 大模型模块 │ ├─► large_model_control_server (大模型服务控制) │ └─► update_knowledge_base_service (知识库更新) │ └─► 展示启动模块 └─► test (展示程序入口) ``` ### 2. 导览执行流程 ``` 用户触发导览任务 │ ▼ ExecuteTaskById 或 PubSetTask (发布任务点) │ ▼ task_nodes_manager (解析任务配置) │ ├─► 获取任务点位置和动作配置 │ ▼ kuavo_lidar_nav (导航控制) │ ├─► 发布 /srv_set_task 到导航系统 ├─► 监听 /cmd_vel_nav 速度指令 ├─► 低通滤波处理 └─► 转发 /cmd_vel 到底盘 │ ▼ robot_navigation_state (状态反馈) │ ├─► 发布 RobotNavigationState (0-4状态码) │ ▼ 到达任务点 │ ├─► 执行讲解动作 (ExecuteArmAction) ├─► 播放语音 (PlayMusic/TTS) └─► LED灯效 (SetLEDMode) │ ▼ 任务完成 ``` ### 3. 语音对话流程 ``` 用户语音输入 │ ▼ micphone_receiver_node (音频接收) │ ├─► 发布 AudioReceiverData │ ▼ kuavo_large_model (大模型处理) │ ├─► ASR: 语音转文本 (腾讯云ASR) ├─► LLM: 大模型对话 (阿里达摩/豆包) ├─► 动作分析: 解析动作指令 │ ▼ 动作执行 + 语音输出 │ ├─► ExecuteArmAction (执行动作) ├─► TTS: 文本转语音 (讯飞TTS) └─► audio_stream_player (音频播放) │ ▼ 扬声器输出 ``` ### 4. 视觉迎宾流程 ``` 深度摄像头 (Orbbec) │ ▼ OrbbecSDK_ROS1 驱动 │ ├─► /camera/color/image_raw (RGB图像) ├─► /camera/depth/image_raw (深度图像) │ ▼ store_welcome (视觉迎宾系统) │ ├─► unified_detector_node (统一检测器) │ ├─► MediaPipe (人体姿态检测) │ └─► YOLO (物体检测) │ ▼ 检测到人员 │ ├─► 触发迎宾动作 ├─► 播放欢迎语音 └─► 发布 VisionWelcomeStatus ``` --- ## 模块功能说明 ### kuavo_exhibition_msgs - 消息服务定义库 - **功能**: 定义系统所有自定义消息(msg)和服务(srv) - **消息数量**: 22个消息定义,36个服务定义 - **说明**: 所有展厅相关的消息和服务统一在此定义,确保接口一致性 ### kuavo_exhibition_start - 系统启动模块 - **功能**: 系统一键启动,协调各模块初始化 - **主要文件**: - `kuavo_new_start.launch` - 主启动文件 - `test.py` - 展示程序入口 - **配置**: 通过 `config/params.yaml` 加载全局参数 ### kuavo_exhibition_play_music - 语音管理模块 - **功能**: 语音合成、音色管理、问候文本处理 - **节点**: - `voice_manager.py` - 音色设置和管理 - `voice_clone_manager.py` - 语音克隆训练 - `upload_greeting_text_server.py` - 文本转语音上传 - **配置文件**: `voice.json` (音色列表和默认设置) - **服务**: SetVoice, SetVoiceSpeed, UploadGreetingText, VoicePlaybackVoice ### ros_audio - 音频处理模块 - **kuavo_audio_player** (音频播放): - `audio_stream_player.py` - 流式音频播放 - `loundspeaker.py` - 音乐文件播放 - 服务: PlayMusic, audio_status - **kuavo_audio_receiver** (音频接收): - `micphone_receiver_node.py` - 麦克风音频采集 - 发布: AudioReceiverData ### kuavo_lidar_nav - 激光导航模块 - **功能**: 导航控制、速度转发、状态管理 - **节点**: - `kuavo_lidar_nav.py` - 主导航节点 - 低通滤波平滑速度指令 - 停止状态检测 - 任务点发布与执行 - `robot_navigation_state.py` - 导航状态发布 - `kuavo_auto_initpose.py` - 自动初始化位置 - **服务**: PubSetTask, ExecuteTaskById, ControlTask, InterruptControl ### task_nodes_manager - 任务节点管理 - **功能**: 任务配置管理、轨迹规划 - **配置路径**: `~/.config/lejuconfig/config` - **服务**: KuavoTaskEdit, KuavoTaskSort, KuavoTourRoute, KuavoTTSConfig ### kuavo_websocket_pkg - WebSocket通信模块 - **功能**: Web客户端与ROS系统通信桥梁 - **子模块**: - `communication_server/main.py` - 多服务器协调 - `heartbeat_server.py` - 心跳维持 - `http_file_server.py` - 文件传输 - `webrtc_server.py` - 视频流 - `udp_broadcast.py` - UDP广播 - `app_robot_control/app_robot_rl_control.py` - 应用控制 - `cmd_vel_forwarder.py` - 速度指令转发 - `camera_manager/camera_control_server.py` - 摄像头选择 - `do_action/do_action.py` - 动作执行 - `vr_action_recordings/rosbag_to_act_frames.py` - VR动作回放 - `wifi_connect_manager/connect_wifi_server.py` - WiFi配置 - `map_evaluate_server/map_evaluate_server.py` - 地图评估 - `volume_control/volume_server.py` - 音量控制 - **端口**: 25432 (WebSocket) ### kuavo_ros_vision - 视觉系统模块 - **OrbbecSDK_ROS1** (深度摄像头驱动): - 支持Astra、Gemini、Femto等系列 - 输出: RGB图像、深度图像、Camera Info、IMU数据 - **store_welcome** (视觉迎宾系统): - MediaPipe人体姿态检测 - YOLO物体检测 - 统一检测器接口 ### face_recognition_system - 人脸识别系统 - **框架**: InsightFace + FaceNet - **功能**: 实时人脸识别、人脸数据库管理 - **服务**: DetectorControl ### llm_demo - 大模型对话系统 - **kuavo_large_model** (主要大模型): - 唤醒词识别 (IVW) - 多轮对话 - 本地知识库 - 服务: LargeModelControl, UpdateKnowledgeBase - **doubao_refactor** (豆包模型): - 结构化设计 - 动作分析器 - **kuavo_multimodal** (多模态): - 图像+语言理解 ### local_model - 本地模型推理 - **功能**: 本地ASR和TTS推理 - **实现**: Sherpa ASR (语音识别), Ollama (本地LLM) - **服务**: GetPromptInfo, SetPrompt, UserInput, SynthesizeOnce, InterruptModel, InterruptTts ### kuavo_head_led_control - LED控制模块 - **功能**: 头部LED灯模式设置 - **服务**: SetLEDMode (支持10组颜色设置) ### dx_nav_common - 导航公共库 - **功能**: 导航系统消息和服务定义 - **内容**: 37个消息定义,20个服务定义 - **类型**: 底盘信息、电池状态、地图、路线、任务等 ### kuavo_exhibition_follow - UWB跟随模块 - **功能**: 基于UWB的人员跟随 - **服务**: FollowControl - **消息**: UwbData, NuwbData --- ## 接口文档 > **说明**: 展厅版下的话题与服务均增加了 `/kuavo_exhibition` 的前缀 --- ## 话题接口 ### 导航状态 `/kuavo_exhibition/robot_navigation_state` * **话题名**: `/kuavo_exhibition/robot_navigation_state` * **消息类型**: `kuavo_exhibition_msgs/RobotNavigationState` * **消息格式**: ``` uint8 state # 0: 导航失败 (包括未启动,导航出道路) # 1: 导航中 # 2: 导航成功(到达任务点) # 3: 检测到障碍物,尝试重启 # 4: 检测到障碍物,并且停障超过30S(重启失败败,人工协助) ``` * **rosbridge 订阅格式**: ```json { "op": "subscribe", "topic": "/kuavo_exhibition/robot_navigation_state", "type": "kuavo_exhibition_msgs/RobotNavigationState" } ``` * **rosbridge 消息接收格式**: ```json { "op": "publish", "topic": "/kuavo_exhibition/robot_navigation_state", "msg": { "state": 1 } } ``` --- ### 动作执行状态 `/kuavo_exhibition/robot_action_state` * **话题名**: `/kuavo_exhibition/robot_action_state` * **消息类型**: `kuavo_exhibition_msgs/RobotActionState` * **消息格式**: ``` uint8 state # 0: 失败 # 1: 运行中 # 2: 成功 # 注: 0与2只发一次,1在执行时会一直发 ``` * **rosbridge 订阅格式**: ```json { "op": "subscribe", "topic": "/kuavo_exhibition/robot_action_state", "type": "kuavo_exhibition_msgs/RobotActionState" } ``` * **rosbridge 消息接收格式**: ```json { "op": "publish", "topic": "/kuavo_exhibition/robot_action_state", "msg": { "state": 2 } } ``` --- ### 配置文件内容 `/kuavo_exhibition/kuavo_task_config_app` * **话题名**: `/kuavo_exhibition/kuavo_task_config_app` * **消息类型**: `std_msgs/String` * **说明**: JSON格式的任务配置信息 * **rosbridge 订阅格式**: ```json { "op": "subscribe", "topic": "/kuavo_exhibition/kuavo_task_config_app", "type": "std_msgs/String" } ``` --- ### 基础动作列表 `/kuavo_exhibition/kuavo_actions_list` * **话题名**: `/kuavo_exhibition/kuavo_actions_list` * **消息类型**: `std_msgs/String` * **说明**: JSON格式的可用动作列表 * **rosbridge 订阅格式**: ```json { "op": "subscribe", "topic": "/kuavo_exhibition/kuavo_actions_list", "type": "std_msgs/String" } ``` --- ### 地图校准位置 `/kuavo_exhibition/init_pose` * **话题名**: `/kuavo_exhibition/init_pose` * **消息类型**: `geometry_msgs/Pose` * **说明**: 订阅app端拾点的坐标用于地图校准,只需填入 position.x 和 position.y * **rosbridge 发布格式**: ```json { "op": "publish", "topic": "/kuavo_exhibition/init_pose", "msg": { "position": { "x": 1.5, "y": 2.3, "z": 0.0 }, "orientation": { "x": 0.0, "y": 0.0, "z": 0.0, "w": 1.0 } } } ``` --- ### 地图校准结果 `/kuavo_exhibition/state_location` * **话题名**: `/kuavo_exhibition/state_location` * **消息类型**: `std_msgs/Bool` * **说明**: True表示校准成功,False表示校准失败 * **rosbridge 订阅格式**: ```json { "op": "subscribe", "topic": "/kuavo_exhibition/state_location", "type": "std_msgs/Bool" } ``` --- ### 起点位置验证 `/kuavo_exhibition/verify_start_position` * **话题名**: `/kuavo_exhibition/verify_start_position` * **消息类型**: `std_msgs/Bool` * **说明**: True表示在起点附近,False表示未在起点附近 * **rosbridge 订阅格式**: ```json { "op": "subscribe", "topic": "/kuavo_exhibition/verify_start_position", "type": "std_msgs/Bool" } ``` --- ### 语音列表 `/voice_list` * **话题名**: `/voice_list` * **消息类型**: `kuavo_exhibition_msgs/VoiceList` * **消息格式**: ``` kuavo_exhibition_msgs/VoiceInfo[] voices - string voice_id # 音色ID,例如 "x4_lingfeichen_assist" - string gender # 性别,"male" / "female" ``` * **rosbridge 订阅格式**: ```json { "op": "subscribe", "topic": "/voice_list", "type": "kuavo_exhibition_msgs/VoiceList" } ``` --- ### ���前音色 `/current_voice` * **话题名**: `/current_voice` * **消息类型**: `std_msgs/String` * **rosbridge 订阅格式**: ```json { "op": "subscribe", "topic": "/current_voice", "type": "std_msgs/String" } ``` --- ### 当前语速 `/current_speed` * **话题名**: `/current_speed` * **消息类型**: `std_msgs/Float32` * **rosbridge 订阅格式**: ```json { "op": "subscribe", "topic": "/current_speed", "type": "std_msgs/Float32" } ``` --- ### 大模型状态 `/large_model_status` * **话题名**: `/large_model_status` * **消息类型**: `kuavo_exhibition_msgs/LargeModelStatus` * **消息格式**: ``` bool running int32 status_code string message time stamp ``` * **rosbridge 订阅格式**: ```json { "op": "subscribe", "topic": "/large_model_status", "type": "kuavo_exhibition_msgs/LargeModelStatus" } ``` --- ### 音频播放状态 `/audio_playback_status` * **话题名**: `/audio_playback_status` * **消息类型**: `kuavo_exhibition_msgs/AudioPlaybackStatus` * **消息格式**: ``` std_msgs/Header header bool playing # 是否正在播放 string message # 状态信息 int32 buffer_size # 缓冲区大小 ``` * **rosbridge 订阅格式**: ```json { "op": "subscribe", "topic": "/audio_playback_status", "type": "kuavo_exhibition_msgs/AudioPlaybackStatus" } ``` --- ### 视觉迎宾状态 `/vision_welcome_status` * **话题名**: `/vision_welcome_status` * **消息类型**: `kuavo_exhibition_msgs/VisionWelcomeStatus` * **消息格式**: ``` int32 status_code # 0 = 未运行 # 1 = 摄像头已开启 # 2 = 检测程序已开启 # 3 = 摄像头和检测程序都已开启 # -1 = 异常/运行失败 string message # 状态描述 ``` * **rosbridge 订阅格式**: ```json { "op": "subscribe", "topic": "/vision_welcome_status", "type": "kuavo_exhibition_msgs/VisionWelcomeStatus" } ``` --- ### UWB定位数据 `/uwb_data` * **话题名**: `/uwb_data` * **消息类型**: `kuavo_exhibition_msgs/UwbData` * **消息格式**: ``` float32 distance # 距离(米) float32 angle # 角度(度) float32 x # X坐标(米) float32 y # Y坐标(米) uint8 confidence # 置信度(0~100) ``` * **rosbridge 订阅格式**: ```json { "op": "subscribe", "topic": "/uwb_data", "type": "kuavo_exhibition_msgs/UwbData" } ``` --- ## 服务接口 --- ### 单点讲解发布服务 `/kuavo_exhibition/execute_task_by_id` * **服务名**: `/kuavo_exhibition/execute_task_by_id` * **服务类型**: `kuavo_exhibition_msgs/ExecuteTaskById` * **服务格式**: ``` int32 task_id --- bool success string message ``` * **示例调用**: ```bash rosservice call /kuavo_exhibition/execute_task_by_id "{task_id: 3}" ``` * **说明**: 先执行导航到任务点3,然后到达任务点3以后执行讲解动作,结束讲解动作以后原地站立 * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/kuavo_exhibition/execute_task_by_id", "args": { "task_id": 3 } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/kuavo_exhibition/execute_task_by_id", "values": { "success": true, "message": "任务执行成功" }, "result": true } ``` --- ### 任务点发布服务 `/kuavo_exhibition/pub_set_task` * **服务名**: `/kuavo_exhibition/pub_set_task` * **服务类型**: `kuavo_exhibition_msgs/PubSetTask` * **服务格式**: ``` string cmd_attr # 指令类型:New(发布)或 Cancel(取消) int32 task_id # 任务点ID --- string cmd_res # 返回server接收到的命令 int32 state_execute # 命令执行状态: # 0-成功 # 1-机器人当前位姿未知 # 2-当前位姿不在道路内 # 3-目标位姿不在道路内 string info # 反馈信息 ``` * **示例调用**: ```bash rosservice call /kuavo_exhibition/pub_set_task "{cmd_attr: 'New', task_id: 1}" ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/kuavo_exhibition/pub_set_task", "args": { "cmd_attr": "New", "task_id": 1 } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/kuavo_exhibition/pub_set_task", "values": { "cmd_res": "New", "state_execute": 0, "info": "任务发布成功" }, "result": true } ``` --- ### 任务控制服务 `/kuavo_exhibition/control_task` * **服务名**: `/kuavo_exhibition/control_task` * **服务类型**: `kuavo_exhibition_msgs/ControlTask` * **服务格式**: ``` string command # 命令类型: "shutdown", "pause", "resume" --- bool success # 执行是否成功 string message # 返回消息 ``` * **示例调用**: ```bash rosservice call /kuavo_exhibition/control_task "{command: 'pause'}" ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/kuavo_exhibition/control_task", "args": { "command": "pause" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/kuavo_exhibition/control_task", "values": { "success": true, "message": "任务已暂停" }, "result": true } ``` --- ### 导览打断服务 `/kuavo_exhibition/interrupt_control` * **服务名**: `/kuavo_exhibition/interrupt_control` * **服务类型**: `kuavo_exhibition_msgs/InterruptControl` * **服务格式**: ``` string command # 命令类型: "shutdown", "pause", "resume" # shutdown - 终止程序 # pause - 暂停程序 # resume - 恢复程序 --- bool success # 执行是否成功 string message # 返回消息 ``` * **示例调用**: ```bash rosservice call /kuavo_exhibition/interrupt_control "{command: 'shutdown'}" ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/kuavo_exhibition/interrupt_control", "args": { "command": "shutdown" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/kuavo_exhibition/interrupt_control", "values": { "success": true, "message": "程序已终止" }, "result": true } ``` --- ### 播放音乐服务 `/kuavo_exhibition/play_music` * **服务名**: `/kuavo_exhibition/play_music` * **服务类型**: `kuavo_exhibition_msgs/PlayMusic` * **服务格式**: ``` string music_number # 音乐文件名或编号 int64 volume # 音量 (0-100) --- bool success_flag # 播放是否成功 ``` * **示例调用**: ```bash rosservice call /kuavo_exhibition/play_music "{music_number: 'welcome.wav', volume: 80}" ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/kuavo_exhibition/play_music", "args": { "music_number": "welcome.wav", "volume": 80 } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/kuavo_exhibition/play_music", "values": { "success_flag": true }, "result": true } ``` --- ### 执行动作服务 `/kuavo_exhibition/execute_arm_action` * **服务名**: `/kuavo_exhibition/execute_arm_action` * **服务类型**: `kuavo_exhibition_msgs/ExecuteArmAction` * **服务格式**: ``` string action_name # 要执行的动作名称,例如 "welcome" --- bool success # 执行是否成功 string message # 返回的消息 ``` * **说明**: 该服务立即返回,如需知道动作完成情况,请监听 `/kuavo_exhibition/robot_action_state` * **示例调用**: ```bash rosservice call /kuavo_exhibition/execute_arm_action "{action_name: 'welcome'}" ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/kuavo_exhibition/execute_arm_action", "args": { "action_name": "welcome" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/kuavo_exhibition/execute_arm_action", "values": { "success": true, "message": "动作开始执行" }, "result": true } ``` --- ### 设置音色服务 `/set_voice` * **服务名**: `/set_voice` * **服务类型**: `kuavo_exhibition_msgs/SetVoice` * **服务格式**: ``` string voice_id # 音色ID,例如 "x4_lingfeichen_assist" --- bool success # 是否成功 string message # 返回消息 ``` * **示例调用**: ```bash rosservice call /set_voice "{voice_id: 'x4_lingfeichen_assist'}" ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/set_voice", "args": { "voice_id": "x4_lingfeichen_assist" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/set_voice", "values": { "success": true, "message": "音色设置成功" }, "result": true } ``` --- ### 设置语速服务 `/set_voice_speed` * **服务名**: `/set_voice_speed` * **服务类型**: `kuavo_exhibition_msgs/SetVoiceSpeed` * **服务格式**: ``` float32 speed # 语速 (0.5-2.0, 1.0为正常速度) --- bool success string message ``` * **示例调用**: ```bash rosservice call /set_voice_speed "{speed: 1.2}" ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/set_voice_speed", "args": { "speed": 1.2 } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/set_voice_speed", "values": { "success": true, "message": "语速设置成功" }, "result": true } ``` --- ### 上传问候文本服务 `/upload_greeting_text` * **服务名**: `/upload_greeting_text` * **服务类型**: `kuavo_exhibition_msgs/UploadGreetingText` * **服务格式**: ``` string type # 类型: # "welcome" : 欢迎词(保存为 welcome.wav) # "farewell" : 告���词(保存为 farewell.wav) # "walk_talk" : 边走边说解说词(保存为 walk_talk_.wav) # "point_talk": 点位解说词(保存为 point_talk_.wav) string content # 文本内容 int32 id # 边走边说/点位解说时必须提供的ID --- bool success string message string name # 生成的文件名 ``` * **示例调用**: ```bash rosservice call /upload_greeting_text "{type: 'welcome', content: '欢迎来到展厅', id: 0}" ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/upload_greeting_text", "args": { "type": "welcome", "content": "欢迎来到展厅", "id": 0 } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/upload_greeting_text", "values": { "success": true, "message": "文本转语音成功", "name": "welcome.wav" }, "result": true } ``` --- ### 语音回放控制服务 `/voice_playback_voice` * **服务名**: `/voice_playback_voice` * **服务类型**: `kuavo_exhibition_msgs/VoicePlaybackVoice` * **服务格式**: ``` bool enable # true启用,false禁用 --- bool success string message ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/voice_playback_voice", "args": { "enable": true } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/voice_playback_voice", "values": { "success": true, "message": "语音回放已启用" }, "result": true } ``` --- ### 语音录制控制服务 `/voice_record_control` * **服务名**: `/voice_record_control` * **服务类型**: `kuavo_exhibition_msgs/VoiceRecordControl` * **服务格式**: ``` string command # "start" 或 "stop" --- bool success string message ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/voice_record_control", "args": { "command": "start" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/voice_record_control", "values": { "success": true, "message": "录制已开始" }, "result": true } ``` --- ### 保存语音录制服务 `/save_voice_record` * **服务名**: `/save_voice_record` * **服务类型**: `kuavo_exhibition_msgs/SaveVoiceRecord` * **服务格式**: ``` string name # 保存的文件名 --- bool success string message string filepath # 保存的文件路径 ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/save_voice_record", "args": { "name": "my_voice" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/save_voice_record", "values": { "success": true, "message": "录音保存成功", "filepath": "/home/leju_kuavo/.config/lejuconfig/voice_records/my_voice.wav" }, "result": true } ``` --- ### 录制音乐服务 `/record_music` * **服务名**: `/record_music` * **服务类型**: `kuavo_exhibition_msgs/RecordMusic` * **服务格式**: ``` string music_number # 音乐编号 int64 time_out # 超时时间(秒) --- bool success_flag ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/record_music", "args": { "music_number": "001", "time_out": 60 } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/record_music", "values": { "success_flag": true }, "result": true } ``` --- ### 任务配置编辑服务 `/kuavo_exhibition/kuavo_task_edit` * **服务名**: `/kuavo_exhibition/kuavo_task_edit` * **服务类型**: `kuavo_exhibition_msgs/KuavoTaskEdit` * **服务格式**: ``` int32 task_id # 必填,任务ID string[] description_list # 任务描述列表���默认为空 string[] action_list # 动作列表,默认为空 bool led_status # LED状态,默认False bool use_large_model_conversation # 是否使用大模型对话,默认False bool walk_with_music # 是否边走边播放音乐,默认False string[] walk_music # 行走音乐列表,默认为空 --- bool success string message ``` * **示例调用**: ```bash rosservice call /kuavo_exhibition/kuavo_task_edit "{task_id: 1, description_list: ['欢迎词'], action_list: ['welcome'], led_status: true, use_large_model_conversation: false, walk_with_music: true, walk_music: ['walk1.wav']}" ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/kuavo_exhibition/kuavo_task_edit", "args": { "task_id": 1, "description_list": ["欢迎词"], "action_list": ["welcome"], "led_status": true, "use_large_model_conversation": false, "walk_with_music": true, "walk_music": ["walk1.wav"] } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/kuavo_exhibition/kuavo_task_edit", "values": { "success": true, "message": "任务配置更新成功" }, "result": true } ``` --- ### 任务点程序服务 `/kuavo_exhibition/kuavo_task_sort` * **服务名**: `/kuavo_exhibition/kuavo_task_sort` * **服务类型**: `kuavo_exhibition_msgs/KuavoTaskSort` * **服务格式**: ``` int32[] task_ids # 任务ID数组,表示排序顺序 --- bool success string message ``` * **示例调用**: ```bash rosservice call /kuavo_exhibition/kuavo_task_sort "{task_ids: [3, 1, 2, 4]}" ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/kuavo_exhibition/kuavo_task_sort", "args": { "task_ids": [3, 1, 2, 4] } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/kuavo_exhibition/kuavo_task_sort", "values": { "success": true, "message": "任务排序成功" }, "result": true } ``` --- ### 巡游路线管理服务 `/kuavo_tour_route` * **服务名**: `/kuavo_tour_route` * **服务类型**: `kuavo_exhibition_msgs/KuavoTourRoute` * **服务格式**: ``` string operation # 操作类型: "add", "delete", "update", "list" int32 route_id # 路线ID(delete/update时必填) string route_name # 路线名称(add/update时使用) int32[] task_sequence # 任务点顺序(add/update时使用) string description # 描述字段(add/update时使用) --- bool success string message string routes_json # 所有路线的JSON字符串 ``` * **示例调用 - 添加路线**: ```bash rosservice call /kuavo_tour_route "{operation: 'add', route_id: 0, route_name: '展厅A路线', task_sequence: [1, 2, 3, 4], description: '展厅A的导览路线'}" ``` * **rosbridge 服务请求格式 (添加路线)**: ```json { "op": "call_service", "service": "/kuavo_tour_route", "args": { "operation": "add", "route_id": 0, "route_name": "展厅A路线", "task_sequence": [1, 2, 3, 4], "description": "展厅A的导览路线" } } ``` * **rosbridge 服务请求格式 (列出所有路线)**: ```json { "op": "call_service", "service": "/kuavo_tour_route", "args": { "operation": "list", "route_id": 0, "route_name": "", "task_sequence": [], "description": "" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/kuavo_tour_route", "values": { "success": true, "message": "路线添加成功", "routes_json": "[{\"id\": 1, \"name\": \"展厅A路线\", \"tasks\": [1, 2, 3, 4]}]" }, "result": true } ``` --- ### TTS配置服务 `/kuavo_tts_config` * **服务名**: `/kuavo_tts_config` * **服务类型**: `kuavo_exhibition_msgs/KuavoTTSConfig` * **服务格式**: ``` string operation # 操作类型: add, delete, update, update_batch, list, update_greeting, update_farewell int32 task_id # 任务点ID string task_name # 任务点名称 string walk_music # 行走语音 string point_music # 到达任务点语音 string action_name # 动作名称 string greeting_music # 迎宾行走语音(update_greeting时使用) string greeting_action # 迎宾动作名称(update_greeting时使用) string farewell_music # 送客行走语音(update_farewell时使用) string farewell_action # 送客动作名称(update_farewell时使用) string batch_data # 批量更新时的JSON数据 --- bool success string message string data # JSON格式的返回数据 ``` * **rosbridge 服务请求格式 (更新任务点TTS)**: ```json { "op": "call_service", "service": "/kuavo_tts_config", "args": { "operation": "update", "task_id": 1, "task_name": "展区A", "walk_music": "walk_to_a.wav", "point_music": "arrived_a.wav", "action_name": "welcome", "greeting_music": "", "greeting_action": "", "farewell_music": "", "farewell_action": "", "batch_data": "" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/kuavo_tts_config", "values": { "success": true, "message": "TTS配置更新成功", "data": "{\"task_id\": 1, \"task_name\": \"展区A\"}" }, "result": true } ``` --- ### LED灯模式设置服务 `/kuavo_exhibition/set_led_mode` * **服务名**: `/kuavo_exhibition/set_led_mode` * **服务类型**: `kuavo_exhibition_msgs/SetLEDMode` * **服务格式**: ``` uint8 mode # LED模式 uint8[3] color1 # 颜色1 [R, G, B] uint8[3] color2 # 颜色2 [R, G, B] uint8[3] color3 # 颜色3 [R, G, B] uint8[3] color4 # 颜色4 [R, G, B] uint8[3] color5 # 颜色5 [R, G, B] uint8[3] color6 # 颜色6 [R, G, B] uint8[3] color7 # 颜色7 [R, G, B] uint8[3] color8 # 颜色8 [R, G, B] uint8[3] color9 # 颜色9 [R, G, B] uint8[3] color10 # 颜色10 [R, G, B] --- bool success ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/kuavo_exhibition/set_led_mode", "args": { "mode": 1, "color1": [255, 0, 0], "color2": [0, 255, 0], "color3": [0, 0, 255], "color4": [255, 255, 0], "color5": [255, 0, 255], "color6": [0, 255, 255], "color7": [255, 255, 255], "color8": [128, 128, 128], "color9": [64, 64, 64], "color10": [0, 0, 0] } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/kuavo_exhibition/set_led_mode", "values": { "success": true }, "result": true } ``` --- ### 灯带开关控制服务 `/kuavo_exhibition/kuavo_head_led_control` * **服务名**: `/kuavo_exhibition/kuavo_head_led_control` * **服务类型**: `std_srvs/SetBool` * **服务格式**: ``` bool data # true开启,false关闭 --- bool success string message ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/kuavo_exhibition/kuavo_head_led_control", "args": { "data": true } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/kuavo_exhibition/kuavo_head_led_control", "values": { "success": true, "message": "LED已开启" }, "result": true } ``` --- ### 音量控制服务 `/set_volume` * **服务名**: `/set_volume` * **服务类型**: `kuavo_exhibition_msgs/SetVolume` * **服务格式**: ``` int32 volume_value # 0-100的音量数值 --- bool success string message ``` * **示例调用**: ```bash rosservice call /set_volume "{volume_value: 50}" ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/set_volume", "args": { "volume_value": 50 } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/set_volume", "values": { "success": true, "message": "音量设置为50%成功" }, "result": true } ``` --- ### WiFi连接服务 `/connect_wifi` * **服务名**: `/connect_wifi` * **服务类型**: `kuavo_exhibition_msgs/ConnectWifi` * **服务格式**: ``` string ssid # WiFi的SSID string password # WiFi的密码 --- bool success string message ``` * **示例调用**: ```bash rosservice call /connect_wifi "{ssid: 'MyWiFi', password: 'password123'}" ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/connect_wifi", "args": { "ssid": "MyWiFi", "password": "password123" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/connect_wifi", "values": { "success": true, "message": "Wi-Fi连接成功!" }, "result": true } ``` --- ### 二维码WiFi配置服务 `/qr_wifi_config` * **服务名**: `/qr_wifi_config` * **服务类型**: `kuavo_exhibition_msgs/QrWifiConfig` * **服务格式**: ``` string command # "start" 或 "stop" --- bool success string message ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/qr_wifi_config", "args": { "command": "start" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/qr_wifi_config", "values": { "success": true, "message": "二维码WiFi配置已启动" }, "result": true } ``` --- ### 摄像头控制服务 `/camera_control` * **服务名**: `/camera_control` * **服务类型**: `kuavo_exhibition_msgs/CameraControl` * **服务格式**: ``` string command # "start" 或 "stop" --- bool success string message ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/camera_control", "args": { "command": "start" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/camera_control", "values": { "success": true, "message": "摄像头已启动" }, "result": true } ``` --- ### 大模型控制服务 `/large_model_control` * **服务名**: `/large_model_control` * **服务类型**: `kuavo_exhibition_msgs/LargeModelControl` * **服务格式**: ``` string command # "start" 或 "stop" --- bool success string message ``` * **示例调用**: ```bash rosservice call /large_model_control "{command: 'start'}" ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/large_model_control", "args": { "command": "start" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/large_model_control", "values": { "success": true, "message": "大模型服务已启动" }, "result": true } ``` --- ### 更新知识库服务 `/update_knowledge_base` * **服务名**: `/update_knowledge_base` * **服务类型**: `kuavo_large_model/UpdateKnowledgeBase` * **服务格式**: ``` string file_name # 文件路径,默认存储在 /home/leju_kuavo/.config/lejuconfig/knowledge_base 下 --- bool success string message ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/update_knowledge_base", "args": { "file_name": "new_knowledge.txt" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/update_knowledge_base", "values": { "success": true, "message": "知识库更新成功" }, "result": true } ``` --- ### 视觉迎宾控制服务 `/vision_welcome_control` * **服务名**: `/vision_welcome_control` * **服务类型**: `kuavo_exhibition_msgs/VisionWelcomeControl` * **服务格式**: ``` bool enable # true = 开启视觉迎宾, false = 关闭视觉迎宾 --- bool success string message ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/vision_welcome_control", "args": { "enable": true } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/vision_welcome_control", "values": { "success": true, "message": "视觉迎宾已开启" }, "result": true } ``` --- ### 检测器控制服务 `/detector_control` * **服务名**: `/detector_control` * **服务类型**: `kuavo_exhibition_msgs/DetectorControl` * **服务格式**: ``` bool enable # true=启动识别器, false=停止识别器 string command # "start", "stop", "status", "restart" --- bool success # 操作是否成功 bool is_running # 当前识别器运行状态 string message # 状态消息或错误信息 string detector_type # 当前使用的检测器类型 ("yolo"/"mediapipe") ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/detector_control", "args": { "enable": true, "command": "start" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/detector_control", "values": { "success": true, "is_running": true, "message": "检测器已启动", "detector_type": "yolo" }, "result": true } ``` --- ### 地图评估控制服务 `/map_evaluate_control` * **服务名**: `/map_evaluate_control` * **服务类型**: `kuavo_exhibition_msgs/MapEvaluateControl` * **服务格式**: ``` string command # 指令:start/stop --- bool success string message ``` * **rosbridge 服��请求格式**: ```json { "op": "call_service", "service": "/map_evaluate_control", "args": { "command": "start" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/map_evaluate_control", "values": { "success": true, "message": "地图评估已启动" }, "result": true } ``` --- ### 跟随控制服务 `/follow_control` * **服务名**: `/follow_control` * **服务类型**: `kuavo_exhibition_msgs/FollowControl` * **服务格式**: ``` int8 mode # 跟随模式 --- bool success string message ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/follow_control", "args": { "mode": 1 } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/follow_control", "values": { "success": true, "message": "跟随模式已切换" }, "result": true } ``` --- ### 应用控制服务 `/app_control` * **服务名**: `/app_control` * **服务类型**: `kuavo_exhibition_msgs/AppControl` * **服务格式**: ``` string mode # 控制模式 --- bool success string message string current_state # 当前状态 ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/app_control", "args": { "mode": "start" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/app_control", "values": { "success": true, "message": "应用控制成功", "current_state": "running" }, "result": true } ``` --- ### 启动展示程序服务 `/start_exhibition_program` * **服务名**: `/start_exhibition_program` * **服务类型**: `kuavo_exhibition_msgs/StartExhibitionProgram` * **服务格式**: ``` --- bool success string message ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/start_exhibition_program", "args": {} } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/start_exhibition_program", "values": { "success": true, "message": "展示程序已启动" }, "result": true } ``` --- ### 启动/停止脚本服务 `/start_stop_script` * **服务名**: `/start_stop_script` * **服务类型**: `kuavo_exhibition_msgs/StartStopScript` * **服务格式**: ``` string script_path # 脚本路径 bool start # true启动,false停止 --- bool success string message ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/start_stop_script", "args": { "script_path": "/path/to/script.py", "start": true } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/start_stop_script", "values": { "success": true, "message": "脚本已启动" }, "result": true } ``` --- ### VR动作录制服务 `/vr_arm_action_record` * **服务名**: `/vr_arm_action_record` * **服务类型**: `kuavo_exhibition_msgs/VrArmActionRecord` * **服务格式**: ``` string command # 录制命令 --- bool success string message string output_filename # 输出文件名 ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/vr_arm_action_record", "args": { "command": "start" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/vr_arm_action_record", "values": { "success": true, "message": "录制已开始", "output_filename": "action_20240101_120000.bag" }, "result": true } ``` --- ### 设置唤醒词服务 `/set_wake_word` * **服务名**: `/set_wake_word` * **服务类型**: `kuavo_exhibition_msgs/SetWakeWord` * **服务格式**: ``` string wake_word # 新的唤醒词 --- bool success string message ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/set_wake_word", "args": { "wake_word": "夸父夸父" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/set_wake_word", "values": { "success": true, "message": "唤醒词已更新为: 夸父夸父" }, "result": true } ``` --- ### 机械臂控制模式切换服务 `/arm_traj_change_mode` * **服务名**: `/arm_traj_change_mode` * **服务类型**: `kuavo_exhibition_msgs/ChangeArmCtrlModeOcs2` * **服务格式**: ``` int32 control_mode # 0: keep pose, 1: auto_swing_arm, 2: external_control --- bool result int32 mode string message ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/arm_traj_change_mode", "args": { "control_mode": 1 } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/arm_traj_change_mode", "values": { "result": true, "mode": 1, "message": "控制模式已切换为自动摆臂" }, "result": true } ``` --- ### 贝塞尔曲线轨迹规划服务 `/plan_arm_trajectory_bezier_curve` * **服务名**: `/plan_arm_trajectory_bezier_curve` * **服务类型**: `kuavo_exhibition_msgs/PlanArmTrajectoryBezierCurve` * **服务格式**: ``` JointBezierTrajectory[] multi_joint_bezier_trajectory float64 start_frame_time float64 end_frame_time string[] joint_names --- bool success ``` * **rosbridge 服务��求格式**: ```json { "op": "call_service", "service": "/plan_arm_trajectory_bezier_curve", "args": { "multi_joint_bezier_trajectory": [], "start_frame_time": 0.0, "end_frame_time": 5.0, "joint_names": ["joint1", "joint2"] } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/plan_arm_trajectory_bezier_curve", "values": { "success": true }, "result": true } ``` --- ### 三次样条轨迹规划服务 `/plan_arm_trajectory_cubic_spline` * **服务名**: `/plan_arm_trajectory_cubic_spline` * **服务类型**: `kuavo_exhibition_msgs/PlanArmTrajectoryCubicSpline` * **服务格式**: ``` trajectory_msgs/JointTrajectory trajectory --- bool success ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/plan_arm_trajectory_cubic_spline", "args": { "trajectory": { "header": {"stamp": {"secs": 0, "nsecs": 0}, "frame_id": ""}, "joint_names": ["joint1", "joint2"], "points": [] } } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/plan_arm_trajectory_cubic_spline", "values": { "success": true }, "result": true } ``` --- ### 音频状态查询服务 `/audio_status` * **服务名**: `/audio_status` * **服务类型**: `kuavo_audio_player/audio_status` * **服务格式**: ``` --- bool is_playing # true表示正在播放,false表示空闲 ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/audio_status", "args": {} } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/audio_status", "values": { "is_playing": false }, "result": true } ``` --- ### 本地模型 - 获取提示词信息服务 `/get_prompt_info` * **服务名**: `/get_prompt_info` * **服务类型**: `local_model/GetPromptInfo` * **服务格式**: ``` --- string name string exhibition_name string system_prompt string[] action_lists string[] navigation_lists ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/get_prompt_info", "args": {} } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/get_prompt_info", "values": { "name": "夸父", "exhibition_name": "科技展厅", "system_prompt": "你是一个展厅导览机器���...", "action_lists": ["welcome", "wave", "bow"], "navigation_lists": ["展区A", "展区B", "展区C"] }, "result": true } ``` --- ### 本地模型 - 设置提示词服务 `/set_prompt` * **服务名**: `/set_prompt` * **服务类型**: `local_model/SetPrompt` * **服务格式**: ``` string name string exhibition_name string system_prompt string[] action_lists string[] navigation_lists --- bool success ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/set_prompt", "args": { "name": "夸父", "exhibition_name": "科技展厅", "system_prompt": "你是一个展厅导览机器人...", "action_lists": ["welcome", "wave"], "navigation_lists": ["展区A", "展区B"] } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/set_prompt", "values": { "success": true }, "result": true } ``` --- ### 本地模型 - 用户输入服务 `/user_input` * **服务名**: `/user_input` * **服务类型**: `local_model/UserInput` * **服务格式**: ``` string input # 用户输入文本 --- bool success ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/user_input", "args": { "input": "请介绍一下展区A" } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/user_input", "values": { "success": true }, "result": true } ``` --- ### 本地模型 - 单次合成服务 `/synthesize_once` * **服务名**: `/synthesize_once` * **服务类型**: `local_model/SynthesizeOnce` * **服务格式**: ``` string text # 要合成的文本 int32 sid # 说话人ID float32 speed # 语速 --- bool success string message std_msgs/Int16MultiArray audio # 音��数据 ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/synthesize_once", "args": { "text": "欢迎来到展厅", "sid": 0, "speed": 1.0 } } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/synthesize_once", "values": { "success": true, "message": "合成成功", "audio": {"layout": {"dim": [], "data_offset": 0}, "data": []} }, "result": true } ``` --- ### 本地模型 - 中断模型服务 `/interrupt_model` * **服务名**: `/interrupt_model` * **服务类型**: `local_model/InterruptModel` * **服务��式**: ``` --- bool success ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/interrupt_model", "args": {} } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/interrupt_model", "values": { "success": true }, "result": true } ``` --- ### 本地模型 - 中断TTS服务 `/interrupt_tts` * **服务名**: `/interrupt_tts` * **服务类型**: `local_model/InterruptTts` * **服务格式**: ``` --- bool success string message ``` * **rosbridge 服务请求格式**: ```json { "op": "call_service", "service": "/interrupt_tts", "args": {} } ``` * **rosbridge 服务响应格式**: ```json { "op": "service_response", "service": "/interrupt_tts", "values": { "success": true, "message": "TTS已中断" }, "result": true } ``` --- ## 配置文件说明 ### config/params.yaml 主要配置参数: | 参数 | 说明 | 默��值 | |------|------|--------| | `music_directory` | 音乐文件目录 | `~/.config/lejuconfig/music/` | | `action_files_path` | 动作文件目录 | `~/.config/lejuconfig/actions/` | | `camera_color_image_rotate_180` | 彩色相机是否旋转180度 | `false` | | `camera_depth_image_rotate_180` | 深度相机是否旋转180度 | `false` | | `audio_playback_mode` | 音���播放方式 | `ros` | | `init_pose.init_method` | 初始化方式 | `Station` | | `init_pose.station_id` | 初始化站点ID | `4` | ### 用户配置目录 路径: `~/.config/lejuconfig/` ``` ~/.config/lejuconfig/ ├── config/ # 任��配置 ├── musics/ # 音乐文件 ├── actions/ # 动作文件 ├── voice_records/ # 语音录制 └── knowledge_base/ # 知识库文件 ``` --- ## 环境变量 | 变量名 | 说明 | 示例 | |--------|------|------| | `ROBOT_VERSION` | 机器人版本号 | `52` | | `HOME` | 家目录 | `/home/leju_kuavo` | --- ## 常见问题 ### Q: 如何测试服务是否正常? ```bash # 列出所有服务 rosservice list | grep kuavo # 测试单点讲解 rosservice call /kuavo_exhibition/execute_task_by_id "{task_id: 1}" # 测试音乐播放 rosservice call /kuavo_exhibition/play_music "{music_number: 'welcome.wav', volume: 80}" ``` ### Q: WebSocket连接地址是什么? 默认地址: `ws://<机器人IP>:25432` ### Q: 如何查看当前导航状态? ```bash rostopic echo /kuavo_exhibition/robot_navigation_state ``` --- ## 版本信息 - ROS版本: Noetic (ROS1) - 平台: Linux (Tegra) - 更新日期: 2024