Skip to content

Commit

Permalink
Merge pull request #30 from ros2/callback-unique-ptr
Browse files Browse the repository at this point in the history
Update to create_subscription
  • Loading branch information
esteve committed Oct 15, 2015
2 parents 23d00bc + cefcefd commit 0fa53d0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion intra_process_demo/src/cyclic_pipeline/cyclic_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct IncrementerPipe : public rclcpp::Node
pub = this->create_publisher<std_msgs::msg::Int32>(out, rmw_qos_profile_default);
std::weak_ptr<std::remove_pointer<decltype(pub.get())>::type> captured_pub = pub;
// Create a subscription on the input topic.
sub = this->create_subscription_with_unique_ptr_callback<std_msgs::msg::Int32>(
sub = this->create_subscription<std_msgs::msg::Int32>(
in, rmw_qos_profile_default,
[captured_pub](std_msgs::msg::Int32::UniquePtr msg) {
auto pub_ptr = captured_pub.lock();
Expand Down
2 changes: 1 addition & 1 deletion intra_process_demo/src/image_pipeline/watermark_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class WatermarkNode : public rclcpp::Node
pub_ = this->create_publisher<sensor_msgs::msg::Image>(output, qos);
std::weak_ptr<std::remove_pointer<decltype(pub_.get())>::type> captured_pub = pub_;
// Create a subscription on the output topic.
sub_ = this->create_subscription_with_unique_ptr_callback<sensor_msgs::msg::Image>(input, qos,
sub_ = this->create_subscription<sensor_msgs::msg::Image>(input, qos,
[captured_pub, text](sensor_msgs::msg::Image::UniquePtr msg) {
auto pub_ptr = captured_pub.lock();
if (!pub_ptr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct Consumer : public rclcpp::Node
: Node(name, true)
{
// Create a subscription on the input topic which prints on receipt of new messages.
sub_ = this->create_subscription_with_unique_ptr_callback<std_msgs::msg::Int32>(
sub_ = this->create_subscription<std_msgs::msg::Int32>(
input, rmw_qos_profile_default, [](std_msgs::msg::Int32::UniquePtr msg) {
printf(" Received message with value: %d, and address: %p\n", msg->data, msg.get());
});
Expand Down

0 comments on commit 0fa53d0

Please sign in to comment.