import time
import os
import sys

from tiberius.control.control import Control

c = Control()
stop_distance = 20


# Drive around em301
if __name__ == '__main__':
    while(True):
        try:
            c.motors.setSpeedPercent(100)
            c.driveForwardUntilWall(30)
            c.driveBackwardUntilWall(30)
        except KeyboardInterrupt:
            c.motors.stop()
            sys.exit(0)
Example #2
0
from tiberius.control.control import Control

c = Control()

c.turnTo(0)
import sys
from tiberius.control.control import Control
from control import Control
c = Control()
if __name__ == "__main__":
    try:
        #		c.driveStraight(50,100)
        c.driveStraightStopStart(50, 100)
    except KeyboardInterrupt:
        c.motors.stop()
import sys
from tiberius.control.control import Control
c = Control()
if __name__ == "__main__":
    try:
        c.driveStraight(50, 12)  # 50% speed for 11.5s
        c.turnLeft90Degrees()
        c.driveStraight(40, 10)

    except KeyboardInterrupt:
        c.motors.stop()
#!/usr/bin/env python
import sys
from tiberius.control.control import Control
from tiberius.control.actuators import MotorState
from tiberius.logger import logger
import tty
import termios
import time
import logging
d_logger = logging.getLogger('tiberius.testing.keyboard_control')


c = Control()
ultras = c.ultrasonics


def getKey():
    fd = sys.stdin.fileno()
    old_settings = termios.tcgetattr(fd)
    try:
        tty.setraw(sys.stdin.fileno())
        ch = sys.stdin.read(1)
    finally:
        termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
    return ch


if __name__ == "__main__":
    while(True):

        key = getKey()