Skip to content

铁蛋ROS 2软件架构 | ROS 2 Software Architecture of CyberDog

Homalozoa X edited this page Sep 27, 2021 · 5 revisions

中文 | English

中文

  • 通用类

    • cyberdog_bringup: 启动系统相关, 我们在ROS 2的Launch启动系统上设计了更简约的启动项管理, 对启动脚本(Python3)和启动内容进行了隔离. 通过简单的参数配置, 新的节点或新的进程便可被添加到启动项, 而无需修改脚本内容. 同时也支持参数管理、调试和开关等功能.
    • cyberdog_grpc: 机器人与外部通讯的媒介, 目前与手机App进行连接是基于GRPC的. 在未来将支持多机识别和多机通讯.
    • cyberdog_utils: 本项目的通用功能仓, 包括基于cascade_lifecycle修改的LifecycleNode基类, 和传感器相关节点共用的基类等.
    • grpc_vendor: GRPC的桥接包.
    • lcm_vendor: LCM的桥接包.
    • sdl2main_vendor: SDL2的桥接包.
    • sdl2mixer_vendor: SDL2_Mixer的桥接包.
    • toml11_vendor: toml11的桥接包.
  • 感知类

    • cyberdog_bms: CyberDog上的电池管理模块, 主要负责电池信息的接收与分发.
    • cyberdog_body_state:该模块实现了整机运动状态的感知功能, 并通过BodyState上报posequat和speed_vector两种message的数据(posequat表示整机姿态四元数;speed_vector表示整机运动的瞬时速度, 单位:m/s).
    • cyberdog_lightsensor: 该模块创建了机器人感知系统中Light Sensor的service和publisher, 当机器人需要感知周围环境光的强度时, 可通过上层决策层启动该service和publisher, 获取环境光照度信息.
    • cyberdog_obstacledetection: 该模块创建了机器人感知系统中Ultrasonic Sensor的service和publisher.
    • cyberdog_scenedetection: 该模块为机器人提供场景检测功能, 通过定位芯片获取当前位置信息, 同时通过卫星信号质量判断机器人当前处于室内或室外.
  • 交互类

    • cyberdog_audio
      • audio_assistant: 该模块集成了小米小爱SDK的功能, 并作为ROS 2节点桥接了这部分功能.
      • audio_base: 该模块提供播放多段或单段不定长PCM音频数据和wav格式音频文件的方法, 其底层实现为SDL2与SDL_mixer.
      • audio_interaction: 该模块实现了整个音频模块的交互部分, 主要包括与其它模块之间关于通用播放的交互、语音助手相关控制与交互功能和与APP(grpc)之间关于音量调解的交互功能.
      • cyberdog_audio: 音频功能包的完整包, 负责整合所有功能.
      • xiaoai_sdk_vendor: 该模块提供了小爱SDK的完整打包, 并集成ROS 2的编译体系.
    • cyberdog_camera
      • cyberdog_camera: 该模块基于NVIDIA Argus和ROS 2实现了相机的基础功能, 包括拍照和录像等, 并为其他模块(视觉SDK、图传等)提供调用接口.
      • cyberdog_vision: 该模块集成了小米AI视觉的功能, 包括人脸、人体和手势识别, 并编译成库供使用.
      • vision_sdk_vendor: 该模块提供了小米AI视觉SDK的完整打包, 并集成ROS 2的编译体系.
    • cyberdog_led: 该模块用于统一决策系统所有的LED灯效请求, 基于ROS2 Service以及sensor_utils类实现, 通过定义不同client的LED消息优先级以及timeout来实现对CyberDog头灯和尾灯的控制显示功能.
    • cyberdog_livestream: 图传模块的库.
    • cyberdog_touch: 该模块提供了topic为TouchState的publisher, 继承于cyberdog_utils::LifecycleNode. 目前支持单指单击报 LPWG_SINGLETAP_DETECTED 和单指长按3s报LPWG_TOUCHANDHOLD_DETECTED事件.
    • cyberdog_wireless
      • bluetooth: 该模块实现了:注册蓝牙GATT service, 发送BLE广播, 等待手机APP连接成功后, 接收APP发送的Wifi信息, 实现Wifi的联网操作, 并返回联网结果, 以及通过APP提供的命令, 实现蓝牙手柄的扫描, 连接, 达到通过手柄控制CyberDog的目的.
      • wifirssi: 该模块的主要功能是创建定时任务, 实时查询当前已连接Wifi的信号强度, 并通过ros2的topic通讯进行传输.
  • 决策类

    • cyberdog_decisionmaker: 面向业务层, 负责实现具体业务功能. 目前提供了automation_managerception_managerinteraction_managermotion_manager. 分别用于自动化功能、感知功能、人机交互功能和运动功能的管理和决策. 该四个模块均继承cascade_manager, 并在基础上根据业务功能稍作改动.
    • cyberdog_decisionutils: 决策相关功能的基类和工具类集合, 负责实现通用功能. 目前提供了cascade_manager, 该模块继承于cyberdog_utils::LifecycleNode, 具备级联/并联和单点控制的功能, 可以快速管控其作用域下的节点的启动和关闭.
  • 接口类

English

  • Common

    • cyberdog_bringup: Startup program. We designed simpler management on the ROS 2 Launch system and isolated the startup script (Python3) and startup content. Through simple parameter configuration, new nodes or processes can be added to the startup item without modifying the script content. It also supports functions such as parameter management, debugging and switching, etc.
    • cyberdog_grpc: The communication agent between the robot and the real world. Currently, the connection with the mobile app is based on GRPC. In the future, it will support multi-device identification and multi-device communication.
    • cyberdog_utils: The general function repository of this project. It contains the base class of LifecycleNode cascade_lifecycle and the base class shared with sensor-related nodes, etc.
    • grpc_vendor: Bridge package of GRPC.
    • lcm_vendor: Bridge package of LCM.
    • sdl2main_vendor: Bridge package of SDL2.
    • sdl2mixer_vendor: Bridge package of SDL2_Mixer.
    • toml11_vendor: Bridge package of toml11.
  • Perception

    • cyberdog_bms: The battery management module on CyberDog. It is mainly responsible for receiving and distributing battery information.
    • cyberdog_body_state: This module realizes the perception function of the whole machine motion state, and reports the data of posequat and speed_vector through BodyState (posequat represents the posture quaternion of the robot; speed_vector represents the instantaneous speed of the robot motion, unit: m/s).
    • cyberdog_lightsensor: This module creates the service and publisher of the Light Sensor in the robot perception system. When the robot needs to perceive the intensity of the ambient light, it can start the service and publisher through the upper decision making layer to obtain the ambient light information.
    • cyberdog_obstacledetection: This module creates the service and publisher of Ultrasonic Sensor in the robot perception system.
    • cyberdog_scenedetection: This module provides a scene detection function for the robot. Obtain the current position information through the position chip. Determine whether the robot is currently indoors or outdoors based on the quality of the satellite signal.
  • Interaction

    • cyberdog_audio
      • audio_assitant: This module integrates the functions of Xiaomi Xiaoai SDK and bridges these functions as a ROS 2 node.
      • audio_base: This module is used to play multi-segment or single-segment variable length PCM audio data, audio files with wav format. Its bottom layer is implemented as SDL2 and SDL_mixer.
      • audio_interaction: This module is used to implement the interactive part of the audio module, which mainly includes the interaction with other modules on common playback, the control and interaction functions of the voice assistant, and the interaction function with APP (grpc) about volume adjustment.
      • cyberdog_audio: The complete package of the audio function package is responsible for integrating all functions.
      • xiaoai_sdk_vendor: This module provides a complete package of Xiaoai SDK and integration the ROS 2 compilation system.
    • cyberdog_camera
      • cyberdog_camera: This module implements the basic functions of the camera based on NVIDIA Argus and ROS 2, including taking pictures and videos, and provides a calling interface for other modules (visual SDK, image transmission, etc.).
      • cyberdog_vision: This module integrates the functions of Xiaomi AI vision, including face, human body and gesture recognition, and is compiled into a library for use.
      • vision_sdk_vendor: This module provides a complete package of Xiaomi AI Vision SDK and integration the ROS 2 compilation system.
    • cyberdog_led: This module is used to unify all the LED lighting requests of the decision-making system. It is based on ROS2 Service and sensor_utils. It realizes the control and display function of CyberDog headlights and taillights by defining the LED message priority and timeout of different clients.
    • cyberdog_livestream: Library of video stream transmission modules.
    • cyberdog_touch: This module provides a publisher of topic TouchState, and is a subclass of cyberdog_utils::LifecycleNode. Currently, it supports to report LPWG_SINGLETAP_DETECTED event with a single finger to single-click and report LPWG_TOUCHANDHOLD_DETECTED event with a single finger to hold for 3 seconds.
    • cyberdog_wireless
      • bluetooth: The module realizes: register Bluetooth GATT service; send BLE broadcast; after waiting for the mobile APP to connect successfully, receive the Wifi information sent by the APP; realize the Wifi networking operation; return the networking results; realize the Bluetooth handle through the commands provided by the APP Scan and connect. Achieve the purpose of controlling CyberDog through the handle.
      • wifirssi: The main function of this module is to create a timed task, query the signal strength of the currently connected Wifi in real time, and transmit it through the topic of ros2.
  • Decision

    • cyberdog_decisionmaker: Towards business layer, responsible for realizing specific business functions. Currently it provides automation_manager, ception_manager, interaction_manager and motion_manager, respectively used for automation functions, perception functions, human-computer interaction functions, management and decision making of motion functions. These four modules all are subclasses of the cascade_manager and make slight changes based on the business functions.
    • cyberdog_decisionutils: A collection of base classes and tool classes for decision making, responsible for implementing general functions. Currently, it provides cascade_manager, which inherits from cyberdog_utils::LifecycleNode and has the functions of cascade/parallel connection and single point of control. It can control the startup and shutdown of nodes under its scope quickly.
  • Interface