Skip to content

Commit

Permalink
add parameter for subscriber transport
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeferguson committed Jan 19, 2024
1 parent 478d8ea commit 29b148a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions image_rotate/include/image_rotate/image_rotate_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ struct ImageRotateConfig
bool use_camera_info;
double max_angular_rate;
double output_image_size;
std::string transport;
};

class ImageRotateNode : public rclcpp::Node
Expand Down
7 changes: 5 additions & 2 deletions image_rotate/src/image_rotate_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ ImageRotateNode::ImageRotateNode(const rclcpp::NodeOptions & options)
config_.max_angular_rate = this->declare_parameter("max_angular_rate", 10.0);
config_.output_image_size = this->declare_parameter("output_image_size", 2.0);

// Allow overriding the SUBSCRIBER transport
config_.transport = this->declare_parameter("image_transport", "raw");

onInit();
}

Expand Down Expand Up @@ -319,7 +322,7 @@ void ImageRotateNode::onInit()
std::bind(
&ImageRotateNode::imageCallbackWithInfo, this,
std::placeholders::_1, std::placeholders::_2),
"raw",
config_.transport,
custom_qos);
} else {
auto custom_qos = rmw_qos_profile_system_default;
Expand All @@ -328,7 +331,7 @@ void ImageRotateNode::onInit()
this,
topic_name,
std::bind(&ImageRotateNode::imageCallback, this, std::placeholders::_1),
"raw",
config_.transport,
custom_qos);
}
}
Expand Down

0 comments on commit 29b148a

Please sign in to comment.