@ros769974864
解决了,
设置发布方的qos为
auto qos = rclcpp::QoS(
rclcpp::QoSInitialization(RMW_QOS_POLICY_HISTORY_KEEP_LAST, queue_size));
qos.reliability(RMW_QOS_POLICY_RELIABILITY_RELIABLE);
qos.durability(RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL);
订阅方的qos为
auto qos = rclcpp::QoS(
rclcpp::QoSInitialization(RMW_QOS_POLICY_HISTORY_KEEP_LAST, queue_size));
qos.reliability(RMW_QOS_POLICY_RELIABILITY_RELIABLE);
queue_size我设置为帧率的10倍