From 0b55d0a05042c1285912ae8ab2c55b159a741149 Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Tue, 17 Dec 2024 15:26:25 +0300 Subject: [PATCH] pallet pos --- robot/urdf_manager.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/robot/urdf_manager.py b/robot/urdf_manager.py index 6a2d5d1..7634fdb 100644 --- a/robot/urdf_manager.py +++ b/robot/urdf_manager.py @@ -40,6 +40,7 @@ class UrdfManager: def load_models(self): p.loadURDF( os.path.join(self.application_path, "urdf", "plane.urdf"), + [0,0,-1], physicsClientId=self.physics_client, ) @@ -58,10 +59,10 @@ class UrdfManager: if self.pallet: self.pallet = None self.start_loop(self.urdf_filename) - + k = 0.2 - self.pallet_target = [1.3 + k, 0.6, 0.1] - self.pallet_size = [0.3 + k, 1.2, 0.144] + self.pallet_target = [1.366773, 0.59591, -0.624086] + self.pallet_size = [0.8, 1.2, 0.144] self.pallet_position = [ (self.pallet_target[i] - self.pallet_size[i] * 0.5) for i in range(len(self.pallet_target)) @@ -71,7 +72,7 @@ class UrdfManager: self.box_size = [0.2, 0.2, 0.2] # положение дальнего угла - self.conv_target = [1.1 + 0.5, -0.63, 0.4] + self.conv_target = [1.045, -0.989, -0.094] self.conv_size = [0.5, 3.0, 0.1] self.conv_direction = self.conv_size.index(max(self.conv_size)) self.conv_pos = [ @@ -104,13 +105,9 @@ class UrdfManager: for p in self.packing: # logger.info(p) - + for i in range(len(self.box_size)): - p[i] = ( - self.pallet_target[i] - - p[i] - - self.box_size[i] * 0.5 - ) + p[i] = self.pallet_target[i] - p[i] - self.box_size[i] * 0.5 dir_wall = (self.conv_direction + 1) % (3 - 1) p[dir_wall] -= self.box_size[dir_wall] p[self.conv_direction] -= self.box_size[self.conv_direction] * 0.5