Skip to content

Commit

Permalink
sleep 0.5s while waiting for controllers to connect in order to avoid…
Browse files Browse the repository at this point in the history
… high CPU usage
  • Loading branch information
klues authored Apr 1, 2020
1 parent 100db61 commit 127313a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/keyboard_teleop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main(int argc, char **argv) {
ros::Subscriber nameSub = n.subscribe("model_name", 100, controllerNameCallback);
while (controllerCount == 0 || controllerCount < nameSub.getNumPublishers()) {
ros::spinOnce();
ros::spinOnce();
ros::spinOnce();
ros::Duration(0.5).sleep();
}
ros::spinOnce();

Expand Down

0 comments on commit 127313a

Please sign in to comment.