diff --git a/msg/templates/urtps/Publisher.cpp.em b/msg/templates/urtps/Publisher.cpp.em index 0ba28d7d96..1733309e37 100644 --- a/msg/templates/urtps/Publisher.cpp.em +++ b/msg/templates/urtps/Publisher.cpp.em @@ -150,55 +150,6 @@ void @(topic)_Publisher::PubListener::onPublicationMatched(Publisher* pub, Match } } -void @(topic)_Publisher::run() -{ - while(m_listener.n_matched == 0) - { -@[if 1.5 <= fastrtpsgen_version <= 1.7]@ - eClock::my_sleep(250); // Sleep 250 ms; -@[else]@ - std::this_thread::sleep_for(std::chrono::milliseconds(250)); // Sleep 250 ms -@[end if]@ - } - - // Publication code -@[if 1.5 <= fastrtpsgen_version <= 1.7]@ -@[ if ros2_distro]@ - @(package)::msg::dds_::@(topic)_ st; -@[ else]@ - @(topic)_ st; -@[ end if]@ -@[else]@ -@[ if ros2_distro]@ - @(package)::msg::@(topic) st; -@[ else]@ - @(topic) st; -@[ end if]@ -@[end if]@ - - /* Initialize your structure here */ - - int msgsent = 0; - char ch = 'y'; - do - { - if(ch == 'y') - { - mp_publisher->write(&st); ++msgsent; - std::cout << "Sending sample, count=" << msgsent << ", send another sample?(y-yes,n-stop): "; - } - else if(ch == 'n') - { - std::cout << "Stopping execution " << std::endl; - break; - } - else - { - std::cout << "Command " << ch << " not recognized, please enter \"y/n\":"; - } - }while(std::cin >> ch); -} - @[if 1.5 <= fastrtpsgen_version <= 1.7]@ @[ if ros2_distro]@ void @(topic)_Publisher::publish(@(package)::msg::dds_::@(topic)_* st) diff --git a/msg/templates/urtps/Subscriber.cpp.em b/msg/templates/urtps/Subscriber.cpp.em index 950f370cb2..c67fa68cfa 100644 --- a/msg/templates/urtps/Subscriber.cpp.em +++ b/msg/templates/urtps/Subscriber.cpp.em @@ -179,13 +179,6 @@ void @(topic)_Subscriber::SubListener::onNewDataMessage(Subscriber* sub) } } -void @(topic)_Subscriber::run() -{ - std::cout << "Waiting for Data, press Enter to stop the Subscriber. "< 0) {