Ejemplo n.º 1
0
        datas.append(round(data.position[5] * 52.297, 2))

        # move when postion change
        if cmp(self.postion, datas) != 0:
            self.postion = datas
            print "change postion to:", self.postion
            self.m.go_to_axis(self.postion[0], self.postion[1],
                              self.postion[2], self.postion[3],
                              self.postion[4], self.postion[5], 2000)


if __name__ == '__main__':
    m = Mirobot(debug=True)
    m.connect('/dev/ttyUSB0')

    # set mirobot to init postion
    m.home_simultaneous()

    sleep(15)
    try:
        #mirobot control init
        mirobot_control_node(m)
    except rospy.ROSInterruptException:
        pass

    while True:
        rospy.spin()
        sleep(0.1)

    m.disconnect()
Ejemplo n.º 2
0
#!/usr/bin/env python

from mirobot import Mirobot
import sys

if len(sys.argv) > 1:
  host = sys.argv[1]
else:
  host = 'local.mirobot.io'

mirobot = Mirobot(host, debug=True)

mirobot.forward(100)
mirobot.back(100)
mirobot.penup()

mirobot.disconnect()