diff --git a/src/simple_bridge_1_to_2.cpp b/src/simple_bridge_1_to_2.cpp index def5a569..be334ecb 100644 --- a/src/simple_bridge_1_to_2.cpp +++ b/src/simple_bridge_1_to_2.cpp @@ -14,6 +14,7 @@ #include #include +#include // include ROS 1 #ifdef __clang__ @@ -37,10 +38,10 @@ void chatterCallback(const std_msgs::String::ConstPtr & ros1_msg) { std::cout << "I heard: [" << ros1_msg->data << "]" << std::endl; - auto ros2_msg = std::make_shared(); + auto ros2_msg = std::make_unique(); ros2_msg->data = ros1_msg->data; std::cout << "Passing along: [" << ros2_msg->data << "]" << std::endl; - pub->publish(ros2_msg); + pub->publish(std::move(ros2_msg)); } int main(int argc, char * argv[])