Ejemplo n.º 1
0
class RobotsCommand(commands.Command):
    def run(self, options, arguments):
        self.robots = Robots()
        self.robots.loadYaml('config.yml')

        if not arguments:
            for name, robot in self.robots.robots.items():
                self.executeFor(robot, options)
        else:
            for name in arguments:
                if name in self.robots.robots:
                    self.executeFor(self.robots.robots[name], options)
                else:
                    print('Robot %s not found' % name)
                    return

    def executeFor(self, robot, options):
        pass

    def stop(self):
        if self.robots:
            self.robots.stop()
Ejemplo n.º 2
0
    def run(self, options, arguments):
        self.robots = Robots()
        self.robots.loadYaml('config.yml')

        if not arguments:
            for name, robot in self.robots.robots.items():
                self.executeFor(robot, options)
        else:
            for name in arguments:
                if name in self.robots.robots:
                    self.executeFor(self.robots.robots[name], options)
                else:
                    print('Robot %s not found' % name)
                    return
Ejemplo n.º 3
0
class RobotCommand(commands.Command):
    def run(self, options, arguments):
        if not arguments:
            print('You must specify a robot name')
            return

        robotName = arguments[0]
        arguments = arguments[1:]

        self.robots = Robots()
        self.robots.loadYaml('config.yml')

        if robotName not in self.robots:
            print('Robot %s not found' % robotName)
            return

        self.execute(self.robots[robotName], options, arguments)

    def execute(self, robot, options, arguments):
        pass

    def stop(self):
        if self.robots:
            self.robots.stop()
Ejemplo n.º 4
0
    def run(self, options, arguments):
        if not arguments:
            print('You must specify a robot name')
            return

        robotName = arguments[0]
        arguments = arguments[1:]

        self.robots = Robots()
        self.robots.loadYaml('config.yml')

        if robotName not in self.robots:
            print('Robot %s not found' % robotName)
            return

        self.execute(self.robots[robotName], options, arguments)
Ejemplo n.º 5
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import time, math
from rhoban.robot import Robots

robots = Robots()
robots.loadYaml('config.yml')

sigmaban = robots['sigmaban']
sigmaban.motors.start(50)
t = 0

sigmaban.motors.allHard()

while True:
    t = t + 0.01
    sigmaban.motors['Coude D'].setAngle(math.sin(t)*40)
    time.sleep(0.01)

robots.stop()