def __init__(self,r_name,r_id,x_off,y_off,theta_off, capacity): Robot.__init__(self,r_name,r_id,x_off,y_off,theta_off) self.carrier_pub = rospy.Publisher("carrier_position",String, queue_size=10) self.carrier_sub = rospy.Subscriber("carrier_position", String, self.carrier_callback) self.picker_sub = rospy.Subscriber("picker_position", String, self.picker_callback) self.kiwi_sub = rospy.Subscriber("picker_kiwi_transfer", String, self.kiwi_callback) self.kiwi_pub = rospy.Publisher("carrier_kiwi_transfer",String, queue_size=10) self.queue_pub = rospy.Publisher("carrier_allocation_request", String, queue_size=10) self.queue_sub = rospy.Subscriber("carrier_allocation_response", String, self.queue_callback) self.next_robot_id = None self.carrier_robots = ["0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0"] self.picker_robots = ["0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0"] self.max_load = capacity self.previousState = self.CarrierState.WAITINGFORPICKER self.is_going_home = False #these variables are used to help the laser callback, it will help in dealing with entities/debris on # it's path to the picker robot #self.StageLaser_sub = rospy.Subscriber(self.robot_node_identifier+"/base_scan",sensor_msgs.msg.LaserScan,self.StageLaser_callback) self.ReadLaser = False self.FiveCounter = 0 self._divertingPath_ = False
def __init__(self): Robot.__init__(self) self.wheel_radius = 0.02 self.encoder_ticks_per_wheel_rev = 225 self.wheel_base_length = 0.09 self.max_speed = 0.3 self._x, self._y, self._heading = STARTING_LOCATION # for getting velocities self.labyrinth = Labyrinth( MazeGenerator(LENGTH_OF_MAZE, LENGTH_OF_MAZE)) self.position = Position(*STARTING_LOCATION, self.wheel_radius, self.encoder_ticks_per_wheel_rev) self.micro_state = MicroRobotState.UNKNOWN self.macro_state = MacroRobotState.MAPPING self.clew = DFS() self.previous_ticks = (0, 0) self.angle_ticker = 0 self.angle_pid = PIDLoop(5, 0, 0.1) self.power_val = 2 self.acceptable_angle_error = .1 self.acceptable_physical_offset = 0.01 self.angle_ticks_needed = 100 self.next_cell = tuple() # for printing the graph self.real_xs = [] self.determined_xs = [] self.real_ys = [] self.determined_ys = [] self.race_start = 0 return
def __init__(self, parent=None, instanceName=None, instanceType = Sensation.InstanceType.Real, level=0): print("We are in Connection, not Robot") Robot.__init__(self, parent=parent, instanceName=instanceName, instanceType=instanceType, level=level)
def __init__(self, parent=None, instanceName=None, instanceType = Sensation.InstanceType.SubInstance, level=0): Robot.__init__(self, parent=parent, instanceName=instanceName, instanceType=instanceType, level=level) print("We are in Hearing, not Robot")
def __init__(self, parent=None, instanceName=None, instanceType = Sensation.InstanceType.SubInstance, level=0): print("We are in TensorFlowClassification, not Robot") Robot.__init__(self, parent=parent, instanceName=instanceName, instanceType=instanceType, level=level)
def __init__(self,r_name,r_id,x_off,y_off,theta_off,capacity): Robot.__init__(self,r_name,r_id,x_off,y_off,theta_off) self.max_load = capacity self.timeLastAdded = time.clock() self.disableSideLaser = False self.picker_pub = rospy.Publisher("picker_position",String, queue_size=10) self.kiwi_sub = rospy.Subscriber("carrier_kiwi_transfer", String, self.kiwi_callback) self.kiwi_pub = rospy.Publisher("picker_kiwi_transfer",String, queue_size=10) self.picker_sub = rospy.Subscriber("picker_position", String, self.picker_callback) self.picker_robots = ["0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0"]
def __init__(self, position, id, scale): Robot.__init__(self,position,id,scale) self.type = randint(0,1) if self.type == 0: taskMgr.add( self.randomWalk, 'walk') self.destination = Point2() self.setRandomPoint( self.destination ) else: taskMgr.add( self.hunt, 'hunt') self.target = None self.time = 0 self.bulletTime = 0
def __init__(self, r_name, r_id, x_off, y_off, theta_off, capacity): Robot.__init__(self, r_name, r_id, x_off, y_off, theta_off) self.carrier_pub = rospy.Publisher("carrier_position", String, queue_size=10) self.carrier_sub = rospy.Subscriber("carrier_position", String, self.carrier_callback) self.picker_sub = rospy.Subscriber("picker_position", String, self.picker_callback) self.kiwi_sub = rospy.Subscriber("picker_kiwi_transfer", String, self.kiwi_callback) self.kiwi_pub = rospy.Publisher("carrier_kiwi_transfer", String, queue_size=10) self.queue_pub = rospy.Publisher("carrier_allocation_request", String, queue_size=10) self.queue_sub = rospy.Subscriber("carrier_allocation_response", String, self.queue_callback) self.next_robot_id = None self.carrier_robots = [ "0,0,0", "0,0,0", "0,0,0", "0,0,0", "0,0,0", "0,0,0", "0,0,0", "0,0,0", "0,0,0", "0,0,0" ] self.picker_robots = [ "0,0,0", "0,0,0", "0,0,0", "0,0,0", "0,0,0", "0,0,0", "0,0,0", "0,0,0", "0,0,0", "0,0,0" ] self.max_load = capacity self.previousState = self.CarrierState.WAITINGFORPICKER self.is_going_home = False #these variables are used to help the laser callback, it will help in dealing with entities/debris on # it's path to the picker robot #self.StageLaser_sub = rospy.Subscriber(self.robot_node_identifier+"/base_scan",sensor_msgs.msg.LaserScan,self.StageLaser_callback) self.ReadLaser = False self.FiveCounter = 0 self._divertingPath_ = False
def __init__(self, socket, address, parent=None, instance=None, is_virtualInstance=False, is_subInstance=False, level=0): Robot.__init__(self, parent=parent, instance=instance, is_virtualInstance=is_virtualInstance, is_subInstance=is_subInstance, level=level) print("We are in SocketServer, not Robot") self.socket=socket self.address=address self.name = str(address)
def __init__(self, parent=None, instanceName=None, instanceType = Sensation.InstanceType.SubInstance, level=0): print("We are in RaspberryPiCamera, not Robot") Robot.__init__(self, parent=parent, instanceName=instanceName, instanceType=instanceType, level=level) # from settings self.camera = picamera.PiCamera() self.camera.rotation = 180 self.lastImage = None self.running=False self.debug_time=time.time()
def __init__(self, r_name, r_id, x_off, y_off, theta_off, capacity): Robot.__init__(self, r_name, r_id, x_off, y_off, theta_off) self.max_load = capacity self.timeLastAdded = time.clock() self.disableSideLaser = False self.picker_pub = rospy.Publisher("picker_position", String, queue_size=10) self.kiwi_sub = rospy.Subscriber("carrier_kiwi_transfer", String, self.kiwi_callback) self.kiwi_pub = rospy.Publisher("picker_kiwi_transfer", String, queue_size=10) self.picker_sub = rospy.Subscriber("picker_position", String, self.picker_callback) self.picker_robots = [ "0,0,0", "0,0,0", "0,0,0", "0,0,0", "0,0,0", "0,0,0" ]
def __init__(self, reports=None, driver_name=None, mode=None, driverDirectory=None): if reports is None: reports = [] Robot.__init__(self, reports) if driver_name is None: driver_name = self.config.robot['driverName'] env = self.config.robot["env"] if mode is None: mode = self.get_mode_from_config() service_args_value = "" if driver_name == 'Firefox': ff_profile = webdriver.FirefoxProfile() ff_profile.set_preference("network.proxy.type", 1) ff_profile.set_preference("network.proxy.http_port", 8080) ff_profile.set_preference("network.proxy.http", "surf-sccc.pasi.log.intra.laposte.fr") ff_profile.set_preference("network.proxy.ssl_port", 8080) ff_profile.set_preference("network.proxy.ssl", "surf-sccc.pasi.log.intra.laposte.fr") ff_profile.set_preference("network.proxy.socks_port", 8080) ff_profile.set_preference("network.proxy.socks", "surf-sccc.pasi.log.intra.laposte.fr") ff_profile.set_preference("network.proxy.ftp_port", 8080) ff_profile.set_preference("network.proxy.ftp", "surf-sccc.pasi.log.intra.laposte.fr") ff_profile.set_preference("network.proxy.socks_username", "PPDJ824") ff_profile.set_preference("network.proxy.socks_password", "Lilalou07PANDORE") ff_profile.set_preference('browser.cache.disk.enable', False) ff_profile.set_preference('browser.cache.memory.enable', False) ff_profile.set_preference('browser.cache.offline.enable', False) ff_profile.set_preference('network.cookie.cookieBehavior', 2) ff_profile.update_preferences() options_ff = OptionsFF() if mode == "headless": options_ff.add_argument("--no-sandbox") # optionsFF.add_argument("--window-size=1900,1080") options_ff.add_argument("--width=1920") options_ff.add_argument("--height=1080") options_ff.add_argument("--disable-extensions") options_ff.add_argument("--disable-dev-shm-usage") options_ff.add_argument("--ignore-certificate-errors") options_ff.add_argument("--disable-gpu") options_ff.add_argument("--headless") self.driver = webdriver.Firefox( firefox_profile=ff_profile, options=options_ff ) elif driver_name == 'IE': if driverDirectory is None: self.driver = webdriver.Ie(self.config.robot["repertoireDriver"]) else: self.driver = webdriver.Ie(driverDirectory) else: # Chrome options = OptionsChrome() options.add_argument("--incognito") # if env != 'dev': # # options.add_argument('--proxy-server=http://localhost:3128') # service_args_value = ['--verbose', '--log-path=/tmp/chromedriver.log'] if mode == "headless": options.add_argument("--no-sandbox") options.add_argument("--headless") options.add_argument("--window-size=1900,1080") options.add_argument("--disable-extensions") options.add_argument("--disable-dev-shm-usage") options.add_argument("--ignore-certificate-errors") options.add_argument("--disable-gpu") options.add_argument("--start-maximized") if "download_directory" in self.config.robot: prefs = {'download.default_directory': self.config.robot["download_directory"]} options.add_experimental_option('prefs', prefs) driver_path = self.config.robot["repertoireDriver"] self.driver = webdriver.Chrome(chrome_options=options, executable_path=driver_path)
def __init__(self, position, id, scale): Robot.__init__(self,position,id,scale) self.rotationX = 0 self.rotationY = 0 self.rotationZ = 0 self.playerDirection = Vec3() self.playerDirection.set(0.0,1.0,0.0) self.scale = scale #Sets up a Third Person Camera View# self.ThirdPerson = True self.cameraDirection = Vec3() self.cameraDirection.set(0.0,1.0,0.0) self.fpvec = Vec3() #Used to set the correct camera location for First Person View self.fpvec.set(0,2.0, 0) self.CAMERA_HEIGHT = 12*self.scale self.CAMERA_LENGTH = 25*self.scale self.setCamera() #################################### #Control Schemes############################## base.accept("arrow_up", self.up) base.accept("arrow_up-repeat", self.up) base.accept("arrow_down", self.down) base.accept("arrow_down-repeat", self.down) base.accept("arrow_left", self.left) base.accept("arrow_left-repeat", self.left) base.accept("arrow_right", self.right) base.accept("arrow_right-repeat", self.right) base.accept("w", self.up) base.accept("w-repeat", self.up) base.accept("a", self.left) base.accept("a-repeat",self.left) base.accept("s", self.down) base.accept("s-repeat", self.down) base.accept("d", self.right) base.accept("d-repeat",self.right) base.accept("q",self.lookLeft) base.accept("q-repeat",self.lookLeft) base.accept("e",self.lookRight) base.accept("e-repeat",self.lookRight) base.accept("page_up", self.lookUp) base.accept("page_up-repeat", self.lookUp) base.accept("page_down",self.lookDown) base.accept("page_down-repeat",self.lookDown) base.accept("[",self.tiltLeft) base.accept("[-repeat",self.tiltLeft) base.accept("]",self.tiltRight) base.accept("]-repeat",self.tiltRight) base.accept( 'mouse1', self.fire) #base.accept( 'mouse1-up', self.setMouseButton) base.accept( 'mouse2', self.ResetZoom) #base.accept( 'mouse2-up', self.setMouseButton) #base.accept( 'mouse3', self.setMouseButton) #base.accept( 'mouse3-up', self.setMouseButton) base.accept( 'wheel_up', self.ZoomIn) base.accept( 'wheel_down', self.ZoomOut) base.accept("t",self.TogglePerson)#Allows you to toggle between first and third person view base.accept("space", self.fire);