Your Name 3 mēneši atpakaļ
vecāks
revīzija
3088eee334

BIN
captured_bbox.png


BIN
captured_frame.png


+ 1 - 0
playgrounds/__init__.py

@@ -0,0 +1 @@
+# Empty init file to make this a Python package

+ 0 - 0
playgrounds/camera_test.py


+ 8 - 8
playgrounds/integration_test.py

@@ -122,13 +122,13 @@ class LoaderSystem:
 
             await self.mag_distributor.home()
             self.mag_distributor.mag_to_feeder()
-            await self.feeder_queue.put(1)
-            await self.controller.prepare_feeder_cell()
-            await self.controller.pick_cell_from_feeder()
-            cell = Cell(id=1, status=CellStatus.WAITING)
-            await self.controller.insert_cell_to_slot(cell, self.test_drop_slot)
-            await self.controller.pick_cell_from_slot(self.test_pickup_slot)
-            await self.controller.dropoff_cell()
+            # await self.feeder_queue.put(1)
+            # await self.controller.prepare_feeder_cell()
+            # await self.controller.pick_cell_from_feeder()
+            # cell = Cell(id=1, status=CellStatus.WAITING)
+            # await self.controller.insert_cell_to_slot(cell, self.test_drop_slot)
+            # await self.controller.pick_cell_from_slot(self.test_pickup_slot)
+            # await self.controller.dropoff_cell()
 
             # await wait_for_enter()
             # # Feeding with MagDistributor
@@ -171,7 +171,7 @@ class LoaderSystem:
             # self.mag_distributor.defeeder_to_mag(self.config.defeeder_magazines[0])
             # self.logger.info("Done.")
 
-            self.logger.info("\nPress Enter to repeat sequence (or Ctrl+C to exit)...")
+            # self.logger.info("\nPress Enter to repeat sequence (or Ctrl+C to exit)...")
 
     async def cleanup(self):
         self.logger.info("Cleaning up resources...")

+ 0 - 0
playgrounds/motor_pwm_simple_test.py


+ 0 - 0
playgrounds/motor_pwm_test.py


+ 0 - 0
playgrounds/motor_waveform_test.py


+ 9 - 9
robot_control/config/config.yaml

@@ -31,36 +31,36 @@ feeder:
   robot_pos: [23, 720, 47]
   mag_pos: 
     pos_mm: 46
-    rot_deg: 153
+    rot_deg: 155
   min_voltage: 2.0
   max_num_cells: 10
 
 defeeder:
-  robot_pos: [12, 526, 70]
+  robot_pos: [12, 526, 72]
   mag_pos: 
-    pos_mm: 0
-    rot_deg: -90
+    pos_mm: 8
+    rot_deg: 120
   max_num_cells: 10
 
 feeder_magazines:
   - mag_pos:
       pos_mm: 297
-      rot_deg: 90
+      rot_deg: 5
     max_num_cells: 70
   - mag_pos:
       pos_mm: 200
-      rot_deg: 90
+      rot_deg: 5
     max_num_cells: 70
   - mag_pos:
       pos_mm: 300
-      rot_deg: 90
+      rot_deg: 5
     max_num_cells: 70
 
 # Order of magazines is implying the priority
 defeeder_magazines:
   - mag_pos:
-      pos_mm: 100
-      rot_deg: 5
+      pos_mm: 297
+      rot_deg: 90
     max_num_cells: 70
     health_range: [60, 100]
     name: accept

+ 2 - 2
robot_control/src/robot/controller.py

@@ -465,8 +465,8 @@ class RobotController:
         """
         io_conf = self.config.gpio
         while not self.next_cell_id:
-            self.next_cell_id = self.vision.read_datamatrix() # commented out for test purposes Y
-            #self.next_cell_id = 1
+            #self.next_cell_id = self.vision.read_datamatrix() # commented out for test purposes Y
+            self.next_cell_id = 1
             if not self.next_cell_id:
                 logger.debug("No cell detected")
                 return False  # No cell detected

+ 7 - 6
robot_control/src/robot/mag_distributor.py

@@ -171,7 +171,7 @@ class MagDistributor:
             # magazin, neutral
             self.move_mag_distributor_at_pos(pos.pos_mm, self.mag_dist_servo_angle_neutral, 1000)
             # magazin, magazin
-            self.move_mag_distributor_at_pos(pos.pos_mm, self.mag_dist_servo_angle_magazin, 250)
+            self.move_mag_distributor_at_pos(pos.pos_mm, pos.rot_deg, 250)
             time.sleep(0.5)
             # magazin, neutral
             self.move_mag_distributor_at_pos(pos.pos_mm, self.mag_dist_servo_angle_neutral, 250)
@@ -180,7 +180,7 @@ class MagDistributor:
             if self.mag_dist_sensor_pin and self.gpio.get_pin(self.mag_dist_sensor_pin):
                 pos = self.config.feeder.mag_pos
                 # feeder, feeder
-                self.move_mag_distributor_at_pos(pos.pos_mm, self.mag_dist_servo_angle_feeder, 200)
+                self.move_mag_distributor_at_pos(pos.pos_mm, pos.rot_deg, 200)
                 time.sleep(0.5)
                 # feeder, neutral
                 self.move_mag_distributor_at_pos(pos.pos_mm, self.mag_dist_servo_angle_neutral, 1000)
@@ -211,10 +211,11 @@ class MagDistributor:
 
         # Move to defeeder position
         pos = self.config.defeeder.mag_pos
-        self.move_mag_distributor_at_pos(pos.pos_mm, 0)
-        self.move_mag_distributor_at_pos(pos.pos_mm, pos.rot_deg)
-        time.sleep(1)
-        self.move_mag_distributor_at_pos(pos.pos_mm, 0)
+        self.move_mag_distributor_at_pos(pos.pos_mm, self.mag_dist_servo_angle_neutral, 1000)
+        time.sleep(0.5)
+        self.move_mag_distributor_at_pos(pos.pos_mm, pos.rot_deg, 1000)
+        time.sleep(0.5)
+        self.move_mag_distributor_at_pos(pos.pos_mm, self.mag_dist_servo_angle_neutral, 1000)
 
 
         # Optionally check for cell presence at defeeder (if sensor available)

BIN
roi_test.jpg


BIN
still_image.jpg