From b8be03d9687c8ad4d72ad9deff861ea66e74adb9 Mon Sep 17 00:00:00 2001 From: "M. M" Date: Mon, 15 Apr 2019 17:43:57 -0700 Subject: [PATCH] Update to be compatible with new rmw_qos_profile_t (#392) * update to be compatible with latest QoS changes Signed-off-by: Miaofei * correct initialization of rmw_qos_profile_t struct instances Signed-off-by: Miaofei --- .../include/rviz_common/ros_topic_display.hpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/rviz_common/include/rviz_common/ros_topic_display.hpp b/rviz_common/include/rviz_common/ros_topic_display.hpp index 7318fdbea..fdfdcbbc7 100644 --- a/rviz_common/include/rviz_common/ros_topic_display.hpp +++ b/rviz_common/include/rviz_common/ros_topic_display.hpp @@ -39,7 +39,7 @@ #endif -#include "rmw/types.h" +#include "rmw/qos_profiles.h" #include "rviz_common/display.hpp" #include "rviz_common/display_context.hpp" @@ -49,14 +49,13 @@ #include "rviz_common/ros_integration/ros_node_abstraction_iface.hpp" #include "rviz_common/visibility_control.hpp" -static const rmw_qos_profile_t display_default = +static constexpr rmw_qos_profile_t display_default_qos_profile() { - RMW_QOS_POLICY_HISTORY_KEEP_LAST, - 5, - RMW_QOS_POLICY_RELIABILITY_RELIABLE, - RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT, - false -}; + rmw_qos_profile_t profile = rmw_qos_profile_default; + profile.depth = 5; + profile.durability = RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT; + return profile; +} namespace rviz_common { @@ -71,7 +70,7 @@ class RVIZ_COMMON_PUBLIC _RosTopicDisplay : public Display public: _RosTopicDisplay() : rviz_ros_node_(), - qos_profile(display_default) + qos_profile(display_default_qos_profile()) { topic_property_ = new properties::RosTopicProperty("Topic", "", "", "", this, SLOT(updateTopic()));