示例#1
0
    def test_put_freq(self):
        pub = rospy.Publisher('/motor_raw', MotorFreqs)
        m = MotorFreqs()
        m.left_hz = 123
        m.right_hz = 456
        for i in range(10):
            pub.publish(m)
            time.sleep(0.1)

        self.file_check("rtmotor_raw_l0", m.left_hz,
                        "wrong left value from motor_raw")
        self.file_check("rtmotor_raw_r0", m.right_hz,
                        "wrong left value from motor_raw")
    def test_put_freq(self):  #test for motor_raw
        pub = rospy.Publisher('/motor_raw', MotorFreqs)
        #definition of instance(not publishing)

        m = MotorFreqs()
        m.left_hz = 123
        m.right_hz = 456
        for i in range(10):  # 10 times
            pub.publish(m)  # actual publishing here
            time.sleep(0.1)

        self.file_check("rtmotor_raw_l0", m.left_hz,
                        "wrong left value from motor_raw")
        self.file_check("rtmotor_raw_r0", m.right_hz,
                        "wrong right value from motor_raw")
示例#3
0
    def test_put_freq(self):
        on = rospy.ServiceProxy('/motor_on', Trigger)
        ret = on()
        time.sleep(1.0)

        pub = rospy.Publisher('/motor_raw', MotorFreqs)
        m = MotorFreqs()
        m.left_hz = 500
        m.right_hz = 500
        for i in range(10):
            pub.publish(m)
            time.sleep(0.1)
            print 'test_put_freq pub.publish(m)'
        self.file_check("rtmotor_raw_l0", m.left_hz,
                        "wrong left value from motor_raw")
        self.file_check("rtmotor_raw_r0", m.right_hz,
                        "wrong right value from motor_raw")
示例#4
0
    def test_put_freq(self):
        pub = rospy.Publisher("/motor_raw", MotorFreqs)
        m = MotorFreqs()
        m.left_hz = 123
        m.right_hz = 456
        pub.publish(m)
        time.sleep(2)

        # self.file_check("rtmotor_raw_l0", m.left_hz, "wrong left value from motor_raw")
        # self.file_check("rtmotor_raw_r0", m.right_hz, "wrong right value from motor_raw")

        m.left_hz = 0
        m.right_hz = 0
        pub.publish(m)