ROSProtoLinker
By leveraging C++ SFINAE in template programming, we've modified roscpp_serialization and roscpp_traits. This enables ROSProtoLinker to seamlessly support both native ROS messages and Protobuf messages, enhancing its compatibility and extensibility.
Install / Use
/learn @xiaohuarun/ROSProtoLinkerREADME
ROSProtoLinker
通过利用模板编程中的 C++ SFINAE,我修改了 roscpp_serialization 和 roscpp_traits。这使得 ROSProtoLinker 可以无缝支持 ROS 原生消息和 Protobuf 消息,增强了其兼容性和可扩展性。我是在dorcker中跑的这个代码,如果不使用dorcker也是可以的,你的操作系统需要安装protobuff和ros 20.04,就可以去跑一下我的代码。不过需要注意,我的cmakelist.txt会把message_serialization和message_traits复制到操作系统的ros原本的代码中,这样做我是为了跑一次就可以内置使用protobuff.如果你不需要这样,建议你看一下我的cmakelist.txt文件,并把这部分给注释掉。

使用方法
- 构造docker环境
cd ~/work/ros_protobuf_msg/docker/build docker build --network host -t ros_protobuf:noetic -f ros_x86.dockerfile . - 进入容器
cd ~/work/ros_protobuf_msg/docker/scripts
#启动容器
./ros_docker_run.sh
#进入容器
./ros_docker_into.sh
- 编译源代码
#创建build目录
mkdir build
cd build
cmake ..
make -j6
- 启动测试
cd /work
source devel/setup.bash
roscore &
rosrun myproject pb_talker
cd ~/work/ros_protobuf_msg/docker/scripts
#进入容器
./ros_docker_into.sh
rosrun myproject pb_listener
