#1 CyberRT Standalone
CyberRT仓库: https://github.com/minhanghuang/CyberRT
将CyberRT从Apollo拆分,使用Cmake编译, 不依赖Apollo独立运行
#1.1 环境
Ubuntu 18.04
Ubuntu 20.04
Apollo 8.0.0
Cmake
#1.2 使用
- 安装依赖
sudo apt install libpoco-dev
sudo apt install uuid-dev
pip3 install protobuf
- 克隆代码
git clone git@github.com:minhanghuang/CyberRT.git
cd CyberRT
- 加载环境
third party(gflag gtest glog fastrtps fastcdr…)
// 拷贝环境到指定路径, 必须是/opt/cyber/env路径
sudo mkdir /opt/cyber
sudo cp -r env/ /opt/cyber/env
根据自己的终端运行对应的脚本,不知道自己的terminal是bash还是zsh,运行
echo $0
查看输出结果
// 二选一
// bash
source /opt/cyber/env/setup.bash
// zsh
source /opt/cyber/env/setup.zsh
- 生成protobuf文件
/opt/cyber/env/bin/protoc -I=cyber/proto/ --cpp_out=cyber/proto cyber/proto/*.proto
/opt/cyber/env/bin/protoc -I=cyber/examples/proto/ --cpp_out=cyber/examples/proto cyber/examples/proto/*.proto
- 编译
mkdir build && cd build
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
make
- 运行examples
- pub/sub
pub
source setup.bash
./cyber/examples/cyber_example_talker
sub
source setup.bash
./cyber/examples/cyber_example_listener
- server/client
server
source setup.bash
./cyber/examples/cyber_example_server
client
source setup.bash
./cyber/examples/cyber_example_cilent