mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-20 11:09:59 +00:00
add debug
This commit is contained in:
@@ -267,13 +267,19 @@ def get_actions_thread(
|
||||
obs = robot.get_observation()
|
||||
obs_processed = robot_observation_processor(obs)
|
||||
|
||||
# Transform image keys: obs_processed has "images.X", build_dataset_frame expects "X"
|
||||
obs_for_frame = {}
|
||||
for key, value in obs_processed.items():
|
||||
if key.startswith("images."):
|
||||
obs_for_frame[key.removeprefix("images.")] = value
|
||||
else:
|
||||
obs_for_frame[key] = value
|
||||
# Filter out non-feature keys (like _timing_breakdown)
|
||||
obs_for_frame = {k: v for k, v in obs_processed.items() if not k.startswith("_")}
|
||||
|
||||
# Debug: log keys on first iteration
|
||||
if action_queue.qsize() == 0:
|
||||
logger.info(f"[GET_ACTIONS] obs_for_frame keys: {list(obs_for_frame.keys())}")
|
||||
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(
|
||||
hw_features, obs_for_frame, prefix="observation"
|
||||
@@ -362,12 +368,10 @@ def actor_thread(
|
||||
|
||||
start_time = time.perf_counter()
|
||||
|
||||
# Get new action from queue and update interpolator
|
||||
action = action_queue.get()
|
||||
if action is not None:
|
||||
interpolator.update(action.cpu())
|
||||
|
||||
# Get interpolated action for smooth control
|
||||
smooth_action, velocity = interpolator.get_interpolated_action()
|
||||
|
||||
if smooth_action is not None:
|
||||
|
||||
Reference in New Issue
Block a user