# Revision history [back]

One issue is that your while loops (in main() and fix_yaw()) are executing as fast as the cpu core can run. The proper fix is to sleep() inside these loops. Unless you have a very good reason, don't execute those loops more than 100 times a second.

You can use a rospy::Rate object to publish to cmd_vel with (mostly) fixed period. It depends on your hardware, but 10 or 20 Hz is usually fast enough for cmd_vel.