mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-16 17:20:05 +00:00
add debug
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user