leofeltrin commited on
Commit
397e692
·
1 Parent(s): de8c0c6

Corrige bounds de validação de pose para corresponder ao workspace real do Cliport (X: [0.25, 0.75], Y: [-0.5, 0.5], Z: [0.0, 0.3])

Browse files
cliport/cfg/config.yaml CHANGED
@@ -15,8 +15,9 @@ auto_fix_attempts: 2 # number of automatic LLM repair attempts after a failure
15
  pose_validation:
16
  enabled: true
17
  max_retries: 1
18
- xy_bounds: [0.05, 0.95]
19
- z_bounds: [0.0, 0.5]
 
20
 
21
  # Advanced options
22
  task_description_candidate_num: -1 # the number of sample task descriptions. -1 means all
 
15
  pose_validation:
16
  enabled: true
17
  max_retries: 1
18
+ x_bounds: [0.25, 0.75] # X bounds matching Cliport workspace
19
+ y_bounds: [-0.5, 0.5] # Y bounds matching Cliport workspace (Y can be negative)
20
+ z_bounds: [0.0, 0.3] # Z bounds matching Cliport workspace
21
 
22
  # Advanced options
23
  task_description_candidate_num: -1 # the number of sample task descriptions. -1 means all
gensim/agent.py CHANGED
@@ -231,7 +231,7 @@ class Agent:
231
  if previous_error and attempt_number > 0:
232
  error_feedback = f"\n\nIMPORTANT: The previous code generation attempt failed validation with the following error:\n{previous_error}\n\nPlease fix these issues in your code:\n"
233
  if "fora dos limites" in previous_error or "outside bounds" in previous_error.lower():
234
- error_feedback += "- Ensure ALL object poses and target poses are within workspace bounds: X: [0.05, 0.95], Y: [0.05, 0.95], Z: [0.0, 0.5]\n"
235
  if "base_pose" in previous_error.lower() or "base" in previous_error.lower():
236
  error_feedback += "- If creating multiple structures, each structure MUST have its own separate base pose at different locations\n"
237
  if "add_goal" in previous_error.lower():
 
231
  if previous_error and attempt_number > 0:
232
  error_feedback = f"\n\nIMPORTANT: The previous code generation attempt failed validation with the following error:\n{previous_error}\n\nPlease fix these issues in your code:\n"
233
  if "fora dos limites" in previous_error or "outside bounds" in previous_error.lower():
234
+ error_feedback += "- Ensure ALL object poses and target poses are within workspace bounds: X: [0.25, 0.75], Y: [-0.5, 0.5], Z: [0.0, 0.3]\n"
235
  if "base_pose" in previous_error.lower() or "base" in previous_error.lower():
236
  error_feedback += "- If creating multiple structures, each structure MUST have its own separate base pose at different locations\n"
237
  if "add_goal" in previous_error.lower():
gensim/sim_runner.py CHANGED
@@ -60,9 +60,18 @@ class SimulationRunner:
60
  pose_validation_cfg = cfg.get('pose_validation', {})
61
  self.pose_validation_enabled = pose_validation_cfg.get('enabled', False)
62
  self.pose_validation_max_retries = pose_validation_cfg.get('max_retries', 0)
63
- xy_bounds = pose_validation_cfg.get('xy_bounds', [0.0, 1.0])
64
- z_bounds = pose_validation_cfg.get('z_bounds', [0.0, 1.0])
65
- self.pose_xy_bounds = (xy_bounds[0], xy_bounds[1])
 
 
 
 
 
 
 
 
 
66
  self.pose_z_bounds = (z_bounds[0], z_bounds[1])
67
 
68
  def print_current_stats(self):
@@ -143,12 +152,12 @@ class SimulationRunner:
143
  x, y, z = map(float, pose[:3])
144
  except ValueError:
145
  continue
146
- if not (self.pose_xy_bounds[0] <= x <= self.pose_xy_bounds[1]):
147
- invalid_entries.append(f"x={x:.3f} fora dos limites {self.pose_xy_bounds}")
148
- if not (self.pose_xy_bounds[0] <= y <= self.pose_xy_bounds[1]):
149
- invalid_entries.append(f"y={y:.3f} fora dos limites {self.pose_xy_bounds}")
150
  if not (self.pose_z_bounds[0] <= z <= self.pose_z_bounds[1]):
151
- invalid_entries.append(f"z={z:.3f} fora dos limites {self.pose_z_bounds}")
152
 
153
  if len(invalid_entries) >= 3:
154
  break
 
60
  pose_validation_cfg = cfg.get('pose_validation', {})
61
  self.pose_validation_enabled = pose_validation_cfg.get('enabled', False)
62
  self.pose_validation_max_retries = pose_validation_cfg.get('max_retries', 0)
63
+ # Support separate X and Y bounds, fallback to xy_bounds for compatibility
64
+ if 'x_bounds' in pose_validation_cfg and 'y_bounds' in pose_validation_cfg:
65
+ x_bounds = pose_validation_cfg.get('x_bounds', [0.25, 0.75])
66
+ y_bounds = pose_validation_cfg.get('y_bounds', [-0.5, 0.5])
67
+ self.pose_x_bounds = (x_bounds[0], x_bounds[1])
68
+ self.pose_y_bounds = (y_bounds[0], y_bounds[1])
69
+ else:
70
+ # Legacy: use xy_bounds for both X and Y
71
+ xy_bounds = pose_validation_cfg.get('xy_bounds', [0.25, 0.75])
72
+ self.pose_x_bounds = (xy_bounds[0], xy_bounds[1])
73
+ self.pose_y_bounds = (xy_bounds[0], xy_bounds[1])
74
+ z_bounds = pose_validation_cfg.get('z_bounds', [0.0, 0.3])
75
  self.pose_z_bounds = (z_bounds[0], z_bounds[1])
76
 
77
  def print_current_stats(self):
 
152
  x, y, z = map(float, pose[:3])
153
  except ValueError:
154
  continue
155
+ if not (self.pose_x_bounds[0] <= x <= self.pose_x_bounds[1]):
156
+ invalid_entries.append(f"x={x:.3f} fora dos limites X {self.pose_x_bounds}")
157
+ if not (self.pose_y_bounds[0] <= y <= self.pose_y_bounds[1]):
158
+ invalid_entries.append(f"y={y:.3f} fora dos limites Y {self.pose_y_bounds}")
159
  if not (self.pose_z_bounds[0] <= z <= self.pose_z_bounds[1]):
160
+ invalid_entries.append(f"z={z:.3f} fora dos limites Z {self.pose_z_bounds}")
161
 
162
  if len(invalid_entries) >= 3:
163
  break