diff --git a/tf2_ros/src/transform_listener.cpp b/tf2_ros/src/transform_listener.cpp index 6f32ac589..f75c3abac 100644 --- a/tf2_ros/src/transform_listener.cpp +++ b/tf2_ros/src/transform_listener.cpp @@ -53,7 +53,7 @@ TransformListener::TransformListener(tf2::BufferCore & buffer, bool spin_thread) sstream << "transform_listener_impl_" << std::hex << reinterpret_cast(this); rclcpp::NodeOptions options; // but specify its name in .arguments to override any __node passed on the command line - options.arguments({"-r", "__node:=" + std::string(sstream.str())}); + options.arguments({"--ros-args", "-r", "__node:=" + std::string(sstream.str())}); options.start_parameter_event_publisher(false); options.start_parameter_services(false); optional_default_node_ = rclcpp::Node::make_shared("_", options);