|
@@ -50,21 +50,25 @@ class LoaderSystem:
|
|
|
i2c_device_class = MCP3428 if not self.config.i2c.debug else MockI2C
|
|
i2c_device_class = MCP3428 if not self.config.i2c.debug else MockI2C
|
|
|
self.i2c = I2C(i2c_device_class)
|
|
self.i2c = I2C(i2c_device_class)
|
|
|
|
|
|
|
|
|
|
+ self.feeder_queue: asyncio.Queue[int] = asyncio.Queue(self.config.feeder.max_capacity)
|
|
|
|
|
+ self.defeeder_queue: asyncio.Queue[int] = asyncio.Queue(self.config.defeeder.max_capacity)
|
|
|
|
|
+
|
|
|
# Initialize robot controller with all required arguments
|
|
# Initialize robot controller with all required arguments
|
|
|
self.controller = RobotController(
|
|
self.controller = RobotController(
|
|
|
self.config,
|
|
self.config,
|
|
|
self.gpio,
|
|
self.gpio,
|
|
|
self.i2c,
|
|
self.i2c,
|
|
|
self.vision,
|
|
self.vision,
|
|
|
- self.pump_controller
|
|
|
|
|
|
|
+ self.pump_controller,
|
|
|
|
|
+ self.feeder_queue,
|
|
|
|
|
+ self.defeeder_queue
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
self.logger = logging.getLogger(__name__)
|
|
self.logger = logging.getLogger(__name__)
|
|
|
self.logger.info("Initializing LoaderSystem")
|
|
self.logger.info("Initializing LoaderSystem")
|
|
|
- # self.vision.initialize()
|
|
|
|
|
|
|
+ self.vision.initialize()
|
|
|
|
|
|
|
|
# Test stuff
|
|
# Test stuff
|
|
|
- self.test_dropoff = self.config.dropoff_grades[0]
|
|
|
|
|
self.test_slot = self.config.measurement_devices[0].slots[3]
|
|
self.test_slot = self.config.measurement_devices[0].slots[3]
|
|
|
|
|
|
|
|
# Use mock I2C device if debug is enabled
|
|
# Use mock I2C device if debug is enabled
|
|
@@ -104,7 +108,7 @@ class LoaderSystem:
|
|
|
await wait_for_enter()
|
|
await wait_for_enter()
|
|
|
self.logger.info("Starting movement sequence...")
|
|
self.logger.info("Starting movement sequence...")
|
|
|
await self.controller.pick_cell_from_slot(self.test_slot)
|
|
await self.controller.pick_cell_from_slot(self.test_slot)
|
|
|
- await self.controller.dropoff_cell(self.test_dropoff)
|
|
|
|
|
|
|
+ await self.controller.dropoff_cell()
|
|
|
|
|
|
|
|
await self.controller.pick_cell_from_feeder()
|
|
await self.controller.pick_cell_from_feeder()
|
|
|
cell = Cell(id=1, status=CellStatus.WAITING)
|
|
cell = Cell(id=1, status=CellStatus.WAITING)
|