Esempio n. 1
0
def rm(pos):
	rows[pos] = 0
	RobotInterface.open()
	RobotInterface.moveToPosition(pos)
	RobotInterface.close()
	RobotInterface.reset()
	RobotInterface.open()
Esempio n. 2
0
def mv(moveFrom, moveTo):
	rows[moveFrom] = 0
	rows[moveTo] = 1

	RobotInterface.open()
	RobotInterface.moveToPosition(moveFrom)
	RobotInterface.close()
	RobotInterface.moveToPosition(moveTo)
	RobotInterface.open()
Esempio n. 3
0
####################################################################
# Button Opcode 165
# Bit Number:  7    6   5   4   3   2   1   0
# Bit Number Value: CLOCK SCHEDULE DAY HOUR MINUTE DOCK SPOT CLEAN
####################################################################
_CLEAN_ = 0
_SPOT_ = 1
_DOCK_ = 2
_MINUTE_ = 3
_HOUR_ = 4
_DAY_ = 5
_SCHEDULE_ = 6
_CLOCK_ = 7
PREV_ERROR = 0

roomba = RobotInterface() #Initialize the robot interface
lock = Lock() #Initialize lock variable

###############################################################
# stopRoomba() sends the drive command with zero velocity and
# zero turning radius, thus, stopping the robot.
###############################################################
def stopRoomba():
    roomba.driveDirect(0,0)

###############################################################
#  rotate() uses the drive() function, but only rotates
#  one wheel, allowing us to turn counter-clockwise.
#
#   we need to turn 180, and then +-45
#   so turn (135 - 225)
Esempio n. 4
0
#using a neural network with the Robot

#import libraries
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import ops
from PIL import Image


import RobotInterface 
import time
import picamera


print("import complete")
RI = RobotInterface.RobotInterface()

# load neural network model 

img_width = 150
img_height = 150


class_names = ["Dog", "Cat"]
model = tf.keras.models.load_model("CatsVersusDogs.trained",compile=True)



RI.centerAllServos()
RI.allLEDSOff()
Esempio n. 5
0
#!/usr/bin/env python

import RobotInterface
import Data.State

import rospy


main():
    rospy.init_node('robot_control')
    
    interface = RobotInterface.RobotInterface()

    state = Data.State.RawState()

    # find the maximum and minimum servo positions.
    while(1):
        # set the servo state
        interface.setState(state)

        #increment the state





main()



Esempio n. 6
0
 def __init__(self, arguments):
     # initialize robot
     self.robot = RobotInterface.RobotInterface()
     self.currentState = 0