def __init__(self): super().__init__('R_KR16') self.publisher_ = self.create_publisher(AdjacencyList, 'graph_node_network', 10) timer_period = 1 # seconds self.timer = self.create_timer(timer_period, self.timer_callback) #Action server declaration self._action_server = ActionServer(self,Transport,'transport_request',self.transport_callback,goal_callback=self.goal_parse_msg) self.action_storage_client_2 = ActionClient(self, Storage, 'storage_request_2') self.action_storage_client_0 = ActionClient(self, Storage, 'storage_request_0') self.graph = AdjacencyList() self.graph.node = 1 self.graph.adjacent = [0,2] self.storage_0_ready = 0 self.storage_2_ready = 0 print("init.....") #--------GPIO pin setup start------------- GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) self.pin_start_01 = 36 self.pin_start_12 = 37 self.pin_progress = 31 self.pin_finished = 33 GPIO.setup(self.pin_start_01, GPIO.OUT) GPIO.setup(self.pin_start_12, GPIO.OUT) GPIO.setup(self.pin_progress, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.setup(self.pin_finished, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.output(self.pin_start_01, GPIO.LOW) GPIO.output(self.pin_start_12, GPIO.LOW) #--------GPIO pin setup end------------- print("ready")
def __init__(self): super().__init__('Linear_Conveyor') self.publisher_ = self.create_publisher(AdjacencyList, 'graph_node_network', 10) self._action_server = ActionServer(self,Storage,'storage_request_0',self.storage_callback,goal_callback=self.goal_parse_msg) timer_period = 1 # seconds self.timer = self.create_timer(timer_period, self.timer_callback) self.graph = AdjacencyList() self.graph.node = 0 self.graph.adjacent = [1] #--------GPIO pin setup start------------- GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) self.pin_MOVEUP = 11 self.pin_MOVEDOWN = 13 GPIO.setup(self.pin_MOVEUP, GPIO.OUT) GPIO.setup(self.pin_MOVEDOWN, GPIO.OUT) GPIO.output(self.pin_MOVEUP, GPIO.LOW) GPIO.output(self.pin_MOVEDOWN, GPIO.LOW) #--------GPIO pin setup end------------- self.pos = 0 self.length_of_movement = 1.2 print("Ensure the conveyor is wired to the controller") time.sleep(1) print("init.....") for i in range(10): GPIO.output(self.pin_MOVEDOWN, GPIO.HIGH) time.sleep(self.length_of_movement) GPIO.output(self.pin_MOVEDOWN, GPIO.LOW) print("ready")
def __init__(self): super().__init__('R_KR10') self.publisher_ = self.create_publisher(AdjacencyList, 'graph_node_network', 10) timer_period = 1 # seconds self.timer = self.create_timer(timer_period, self.timer_callback) #Action server declaration self._action_server = ActionServer(self,Transport,'transport_request',self.transport_callback,goal_callback=self.goal_parse_msg) self.action_storage_client_2 = ActionClient(self, Storage, 'storage_request_2') self.action_storage_client_5 = ActionClient(self, Storage, 'storage_request_5') self.action_storage_client_6 = ActionClient(self, Storage, 'storage_request_6') self.servcie_machine_client_4 = self.create_client(MachineRequest5, 'machine_request_5') self.graph = AdjacencyList() self.graph.node = 3 self.graph.adjacent = [2,4,5,6] self.storage_2_ready = 0 print("init.....") #--------GPIO pin setup start------------- GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) self.pin_start_23 = 33 self.pin_start_32 = 35 self.pin_start_34 = 36 self.pin_start_43 = 37 self.pin_start_35 = 38 self.pin_start_36 = 40 self.pin_progress = 16 self.pin_finished = 18 GPIO.setup(self.pin_start_23, GPIO.OUT) #Input 2 Kuka GPIO.setup(self.pin_start_32, GPIO.OUT) #Input 3 Kuka GPIO.setup(self.pin_start_34, GPIO.OUT) #Input 4 Kuka GPIO.setup(self.pin_start_43, GPIO.OUT) #Input 5 Kuka GPIO.setup(self.pin_start_35, GPIO.OUT) #Input 6 Kuka GPIO.setup(self.pin_start_36, GPIO.OUT) #Input 7 Kuka GPIO.setup(self.pin_progress, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.setup(self.pin_finished, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.output(self.pin_start_23, GPIO.LOW) GPIO.output(self.pin_start_32, GPIO.LOW) GPIO.output(self.pin_start_34, GPIO.LOW) GPIO.output(self.pin_start_43, GPIO.LOW) GPIO.output(self.pin_start_35, GPIO.LOW) GPIO.output(self.pin_start_36, GPIO.LOW) #--------GPIO pin setup end------------- print("ready")
def __init__(self): super().__init__('minimal_publisher') self.publisher_ = self.create_publisher(AdjacencyList, 'graph_node_network', 10) timer_period = 1 # seconds self.timer = self.create_timer(timer_period, self.timer_callback) self._action_server = ActionServer(self, Storage, 'storage_request_2', self.spin_execute_callback) self.graph = AdjacencyList() self.graph.node = 2 self.graph.adjacent = [1, 3] self.trays = [0, 0, 0] self.spinning = 0 self.conveyor_GPIO_pin = 15 self.conveyor_IR_pins = [38, 40] self.pneumatic_stop_pins = [8, 7] self.pneumatic_pin = 0 self.new_ir_readings = [0, 0] self.old_ir_readings = [0, 0] self.kuka_tray_counter = [-1, -1] self.debounce_counter = [0, 0] self.tray_requested = 0 self.found = 0 self.correct_edge_found = 0 print("init.....") #--------GPIO pin setup start------------- GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(self.conveyor_GPIO_pin, GPIO.OUT) GPIO.setup(self.conveyor_IR_pins[0], GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.setup(self.conveyor_IR_pins[1], GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.setup(self.pneumatic_stop_pins[0], GPIO.OUT) GPIO.setup(self.pneumatic_stop_pins[1], GPIO.OUT) #--------GPIO pin setup end------------- print("ready")
def __init__(self): super().__init__('minimal_publisher') self.publisher_ = self.create_publisher(AdjacencyList, 'graph_node_network', 10) self._action_server = ActionServer(self, Storage, 'storage_request_5', self.storage_callback, goal_callback=self.goal_parse_msg) timer_period = 1 # seconds self.timer = self.create_timer(timer_period, self.timer_callback) self.create_timer(10, self.contents_callback) self.graph = AdjacencyList() self.graph.node = 5 self.graph.adjacent = [3] self.contents = [] print("init.....") print("ready")
def __init__(self): super().__init__('minimal_publisher') self.publisher_ = self.create_publisher(AdjacencyList, 'graph_node_network', 10) timer_period = 1 # seconds self.timer = self.create_timer(timer_period, self.timer_callback) self.service_request_5 = self.create_service(MachineRequest5, 'machine_request_5', self.machine_5_callback) self.graph = AdjacencyList() self.graph.node = 4 self.graph.adjacent = [3] self.Door_opening_pin = 35 self.Door_closing pin = 36 self.Interlock_shorting_pin = 37 self.Chuck_opening_pin = 38 GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(self.Door_opening_pin, GPIO.OUT) GPIO.setup(self.Door_closing_pin, GPIO.OUT) GPIO.setup(self.Chuck_opening_pin, GPIO.OUT)