add debug

This commit is contained in:
Pepijn
2026-01-09 10:21:02 +01:00
parent c3f4aa2d98
commit d63b83ff40
+13 -9
View File
@@ -267,13 +267,19 @@ def get_actions_thread(
obs = robot.get_observation() obs = robot.get_observation()
obs_processed = robot_observation_processor(obs) obs_processed = robot_observation_processor(obs)
# Transform image keys: obs_processed has "images.X", build_dataset_frame expects "X" # Filter out non-feature keys (like _timing_breakdown)
obs_for_frame = {} obs_for_frame = {k: v for k, v in obs_processed.items() if not k.startswith("_")}
for key, value in obs_processed.items():
if key.startswith("images."): # Debug: log keys on first iteration
obs_for_frame[key.removeprefix("images.")] = value if action_queue.qsize() == 0:
else: logger.info(f"[GET_ACTIONS] obs_for_frame keys: {list(obs_for_frame.keys())}")
obs_for_frame[key] = value logger.info(f"[GET_ACTIONS] hw_features keys: {list(hw_features.keys())}")
# Check expected vs actual image keys
expected_img_keys = [k.removeprefix("observation.images.")
for k in hw_features if "images" in k]
logger.info(f"[GET_ACTIONS] Expected image keys: {expected_img_keys}")
for k in expected_img_keys:
logger.info(f"[GET_ACTIONS] '{k}' in obs_for_frame: {k in obs_for_frame}")
obs_with_policy_features = build_dataset_frame( obs_with_policy_features = build_dataset_frame(
hw_features, obs_for_frame, prefix="observation" hw_features, obs_for_frame, prefix="observation"
@@ -362,12 +368,10 @@ def actor_thread(
start_time = time.perf_counter() start_time = time.perf_counter()
# Get new action from queue and update interpolator
action = action_queue.get() action = action_queue.get()
if action is not None: if action is not None:
interpolator.update(action.cpu()) interpolator.update(action.cpu())
# Get interpolated action for smooth control
smooth_action, velocity = interpolator.get_interpolated_action() smooth_action, velocity = interpolator.get_interpolated_action()
if smooth_action is not None: if smooth_action is not None: