mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-22 17:32:07 +00:00
logs
This commit is contained in:
@@ -48,6 +48,16 @@ class BaseStrategy(RolloutStrategy):
|
|||||||
|
|
||||||
control_interval = interpolator.get_control_interval(cfg.fps)
|
control_interval = interpolator.get_control_interval(cfg.fps)
|
||||||
|
|
||||||
|
# Flush a few observation reads so CAN bus / sensor state is fresh
|
||||||
|
# before the first inference. Without this, the first observation(s)
|
||||||
|
# can return stale or identical values for all joints, poisoning the
|
||||||
|
# entire first action chunk.
|
||||||
|
_OBS_WARMUP_READS = 5
|
||||||
|
for _ in range(_OBS_WARMUP_READS):
|
||||||
|
robot.get_observation()
|
||||||
|
precise_sleep(1 / cfg.fps)
|
||||||
|
logger.info("Flushed %d observation warmup reads", _OBS_WARMUP_READS)
|
||||||
|
|
||||||
start_time = time.perf_counter()
|
start_time = time.perf_counter()
|
||||||
engine.resume()
|
engine.resume()
|
||||||
logger.info("Base strategy control loop started")
|
logger.info("Base strategy control loop started")
|
||||||
|
|||||||
@@ -63,6 +63,10 @@ class RolloutStrategy(abc.ABC):
|
|||||||
self._engine = ctx.policy.inference
|
self._engine = ctx.policy.inference
|
||||||
logger.info("Starting inference engine...")
|
logger.info("Starting inference engine...")
|
||||||
self._engine.start()
|
self._engine.start()
|
||||||
|
# Reset policy and processor state so the first inference starts clean
|
||||||
|
# (matches the old HIL script which called policy.reset() / preprocessor.reset()
|
||||||
|
# at the beginning of each episode).
|
||||||
|
self._engine.reset()
|
||||||
self._warmup_flushed = False
|
self._warmup_flushed = False
|
||||||
logger.info("Inference engine started")
|
logger.info("Inference engine started")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user