Skip to content

Commit

Permalink
Bug with qos history
Browse files Browse the repository at this point in the history
Signed-off-by: Juancams <[email protected]>
  • Loading branch information
Juancams committed Oct 4, 2024
1 parent 1a64bb1 commit 7f4aa53
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ InstrumentationConsumer<TopicT>::InstrumentationConsumer(
declare_parameter("topic", std::string(""));
declare_parameter("topic_type", std::string(""));
declare_parameter("type", std::string(""));
declare_parameter("queue_history", std::string("KEEP_LAST"));
declare_parameter("qos_history", std::string("KEEP_LAST"));
declare_parameter("qos_queue", int(10));
declare_parameter("qos_reliability", std::string("REALIABLE"));
declare_parameter("qos_durability", std::string("VOLATILE"));
Expand All @@ -41,14 +41,14 @@ InstrumentationConsumer<TopicT>::InstrumentationConsumer(
get_parameter("type", type_);
get_parameter("topic_name", topic_name_);

std::string queue_history;
get_parameter("queue_history", queue_history);
std::string qos_history;
get_parameter("qos_history", qos_history);

if (queue_history == "KEEP_LAST") {
if (qos_history == "KEEP_LAST") {
int qos_queue;
get_parameter("qos_queue", qos_queue);
qos_profile_ = rclcpp::QoS(rclcpp::KeepLast(qos_queue));
} else if (queue_history == "KEEP_ALL") {
} else if (qos_history == "KEEP_ALL") {
qos_profile_ = rclcpp::QoS(rclcpp::KeepAll());
} else {
RCLCPP_ERROR(get_logger(), "Invalid queue history");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ InstrumentationProducer<TopicT>::InstrumentationProducer(
declare_parameter("topic", std::string(""));
declare_parameter("topic_type", std::string(""));
declare_parameter("type", std::string(""));
declare_parameter("queue_history", std::string("KEEP_LAST"));
declare_parameter("qos_history", std::string("KEEP_LAST"));
declare_parameter("qos_queue", int(10));
declare_parameter("qos_reliability", std::string("RELIABLE"));
declare_parameter("qos_durability", std::string("VOLATILE"));
Expand All @@ -41,14 +41,14 @@ InstrumentationProducer<TopicT>::InstrumentationProducer(
get_parameter("type", type_);
get_parameter("topic_name", topic_name_);

std::string queue_history;
get_parameter("queue_history", queue_history);
std::string qos_history;
get_parameter("qos_history", qos_history);

if (queue_history == "KEEP_LAST") {
if (qos_history == "KEEP_LAST") {
int qos_queue;
get_parameter("qos_queue", qos_queue);
qos_profile_ = rclcpp::QoS(rclcpp::KeepLast(qos_queue));
} else if (queue_history == "KEEP_ALL") {
} else if (qos_history == "KEEP_ALL") {
qos_profile_ = rclcpp::QoS(rclcpp::KeepAll());
} else {
RCLCPP_ERROR(get_logger(), "Invalid queue history");
Expand Down

0 comments on commit 7f4aa53

Please sign in to comment.