Skip to content
Snippets Groups Projects
Commit 331ac22c authored by Hoop77's avatar Hoop77
Browse files

-

parent a147950a
No related merge requests found
...@@ -26,17 +26,12 @@ void Ultrasonic::onInit() ...@@ -26,17 +26,12 @@ void Ultrasonic::onInit()
main = boost::thread( main = boost::thread(
[this]() [this]()
{ {
ros::Rate rate{1}; for (;;)
while (ros::ok())
{ {
ussDataMsg msg; ussDataMsg msg;
auto distance = getDistance(); auto distance = getDistance();
msg.distance = distance; msg.distance = distance;
std::cout << "\n------------------------\n"
<< "distance: " << distance
<< "\n------------------------\n\n";
ussData.publish(msg); ussData.publish(msg);
rate.sleep();
} }
}); });
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment