예제 #1
0
def stopMotors():

    # Handle each event individually
    PerformMove(0, 0, 1, 1)
    switchOffMotors()
예제 #2
0
from std_msgs.msg import String


def stopMotors():

    # Handle each event individually
    PerformMove(0, 0, 1, 1)
    switchOffMotors()


if __name__ == '__main__':

    rospy.init_node('motor_listener', anonymous=True)
    rate = rospy.Rate(10)  # 10hz
    start = rospy.Time.now().to_sec()

    try:
        while not rospy.is_shutdown():

            stopMotors()
            rate.sleep()

        # spin() simply keeps python from exiting until this node is stopped
        rospy.spin()

    except rospy.ROSInterruptException:
        pass
    except KeyboardInterrupt:
        switchOffMotors()
        pass