# test_ecal **Repository Path**: posstar/test_ecal ## Basic Information - **Project Name**: test_ecal - **Description**: No description available - **Primary Language**: C++ - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-07 - **Last Updated**: 2026-01-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # test_ecal #### 介绍 Eclipse eCAL 发布/订阅示例项目,演示如何使用 eCAL 进行消息发布和订阅。 #### 软件架构 - **eCAL**: Eclipse eCAL 中间件 - **protobuf**: Google Protocol Buffers 消息序列化 - **conan**: C++ 包管理器 #### 安装教程 ##### 1. 安装 Eclipse eCAL **方法一:APT 安装(推荐)** ```bash # 添加 Eclipse eCAL PPA 源: https://eclipse-ecal.github.io/ecal/stable/getting_started/setup.html sudo add-apt-repository ppa:ecal/ecal-latest sudo apt-get update sudo apt-get install ecal ``` **方法二:从源码编译** ```bash # 安装编译依赖 sudo apt install build-essential cmake git libprotobuf-dev protobuf-compiler libboost-all-dev # 克隆并编译 git clone https://github.com/eclipse-ecal/ecal.git cd ecal mkdir build && cd build cmake .. -DWITH_PROTOBUF=ON -DCMAKE_BUILD_TYPE=Release make -j$(nproc) sudo make install sudo ldconfig ``` ##### 2. 安装 conan ```bash # 使用 pip 安装 pip install conan # 初始化 conan(如果需要) conan profile new default --detect ``` ##### 3. 安装项目依赖 ```bash # 进入项目目录 cd /path/to/test_ecal # 使用 conan 安装依赖 conan install . --output-folder=build --build=missing --settings=build_type=Debug ``` #### 使用说明 ##### 1. 构建项目 ```bash cd build cmake .. -DCMAKE_BUILD_TYPE=Debug cmake --build . --parallel ``` ##### 2. 运行示例 ```bash # 运行字符串发布/订阅示例 ./test-ecal-string [publisher|subscriber|both] [topic_name] # 运行 protobuf 发布/订阅示例 ./test-ecal-protobuf [publisher|subscriber|both] [topic_name] ``` ##### 3. 示例命令 ```bash # 终端1:运行发布者 ./test-ecal-protobuf publisher person_topic # 终端2:运行订阅者 ./test-ecal-protobuf subscriber person_topic # 或者同时运行发布者和订阅者(测试模式) ./test-ecal-protobuf both person_topic ``` #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 依赖 - Eclipse eCAL - Google Protobuf - Boost - glog - CMake >= 3.10 - C++17