https://mp.weixin.qq.com/s/J63fO4c_QIseLGQd5W2fAw
参考以上文档编写qos测试代码,在运行以下代码后
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp #指定中间通信件
ros2 run qos_tests_pkg publisher_custom_minimal_qos_exe -reliability best_effort
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp #指定中间通信件
ros2 run qos_tests_pkg subscriber_custom_minimal_qos_exe
报错如下
[ERROR] [1698719028.893928635] [rcl]:
Error getting RMW implementation identifier / RMW implementation not installed (expected identifier of 'rmw_cyclonedds_cpp'),
with error message 'failed to load shared library 'librmw_cyclonedds_cpp.so' due to dlopen error:
librmw_cyclonedds_cpp.so: cannot open shared object file: No such file or directory, at ./src/shared_library.c:99, at ./src/functions.cpp:65',
exiting with 1., at ./src/rcl/rmw_implementation_identifier_check.c:139
参考链接
https://get-help.robotigniteacademy.com/t/error-getting-rmw-implementation-identifier-error/13982/4
大概率是由于rmw_cyclonedds_cpp没有正确安装
笔者所用的ros版本为humble,相应的版本安装方法推测
sudo apt-get update
sudo apt-get install -y ros-foxy-rmw-cyclonedds-cpp #推测是修改foxy至humble
常用的DDS安装
参考ROS2文档DDS_Implementation https://docs.ros.org/en/humble/Installation/DDS-Implementations.html
The default DDS vendor is eProsima’s Fast DDS.
Working with Eclipse Cyclone DDS explains how to utilize Cyclone DDS.
Working with eProsima Fast DDS explains how to utilize Fast DDS.
Working with GurumNetworks GurumDDS explains how to utilize GurumDDS.
这里使用Eclipse的DDS,参考文档如下
https://docs.ros.org/en/humble/Installation/DDS-Implementations/Working-with-Eclipse-CycloneDDS.html
sudo apt install ros-humble-rmw-cyclonedds-cpp
检查环境变量printenv | grep RMW
这里没有查找到,但是后续可以正常使用了
https://mp.weixin.qq.com/s/J63fO4c_QIseLGQd5W2fAw
运行链接中的Qos质量测试代码,运行顺利通过,弹出RELIABILITY Error
ros2 run example_qos_test qos_test_publisher ✔ │ base 🐍 │ 16:23:46
None
[ERROR] [1698827033.988485802] [publisher_qos_obj]: A subscriber is asking for an INCOMPATIBLE QoS Triggered!!
[ERROR] [1698827033.988969656] [publisher_qos_obj]: rmw_qos_policy_kind_t.RMW_QOS_POLICY_RELIABILITY
[ERROR] [1698827033.989157392] [publisher_qos_obj]: ############################