Created
March 20, 2016 20:21
-
-
Save awesomebytes/d31c0c8c34020fcdc56e to your computer and use it in GitHub Desktop.
Check if Gazebo simulation is running
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| from time import sleep | |
| import rospy | |
| if __name__ == '__main__': | |
| rospy.init_node('check_time') | |
| # Until rospy initalizes the time returned will be 0 | |
| # so we need to give a bit of time to see if it initializes | |
| sleep(2) | |
| if rospy.Time.now() == rospy.Time(): | |
| print "Simulation stalled/paused" | |
| else: | |
| print "Simulation running correctly" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment