Skip to content

Add dry run as debug option to debug config - #177

Open
tomasz-lewicki wants to merge 5 commits into
mainfrom
dev/tomasz/dry-run
Open

Add dry run as debug option to debug config#177
tomasz-lewicki wants to merge 5 commits into
mainfrom
dev/tomasz/dry-run

Conversation

@tomasz-lewicki

Copy link
Copy Markdown
Contributor

Add task.debug.dry_run (default False). When set, the policy runs the full loop — obs, inference, postprocess, telemetry — but skips send_low_command, so no torque reaches the robot. Logs a one-time yellow warning so it's unmistakable that commands are suppressed. Intended for on-hardware bring-up: verify the obs pipeline (pair with print_observations) and end-to-end wiring without the robot moving.

Enable via CLI: --task.debug.dry-run

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Add task.debug.dry_run (default False). When set, the policy runs the full
loop — obs, inference, postprocess, telemetry — but skips send_low_command,
so no torque reaches the robot. Logs a one-time yellow warning so it's
unmistakable that commands are suppressed. Intended for on-hardware bring-up:
verify the obs pipeline (pair with print_observations) and end-to-end wiring
without the robot moving.

Enable via CLI: --task.debug.dry-run
dryer_run swaps in a SyntheticInterface that returns a plausible standing
state (default pose, upright IMU, zero velocities) and never opens a DDS
connection, so the policy loop runs off-robot with no sim or hardware
present. Implies dry_run (never sends commands).
SyntheticInterface.send_low_command now publishes the policy's would-be
commands as sensor_msgs/JointState on a synthetic topic (/dryer_run/cmd)
that no real driver subscribes to, so the loop's output is measurable
(ros2 topic hz/echo/bag) while nothing reaches the robot. Falls back to a
no-op if ROS2 is unavailable. Send gate branches: dry_run skips send (real
interface), dryer_run calls it (synthetic topic only).
Ctrl-C/SIGTERM can invalidate the rclpy context mid-publish; check rclpy.ok()
and swallow the publish exception so exit stays clean.
ORT defaults its intra-op pool to CPU count and pins one worker per core via
sched_setaffinity, which bypasses isolcpus and lands workers on the isolated
RT cores (10-13), contending with the 1 kHz EtherCAT actuator threads. The
policy is a small MLP at 50 Hz (~1ms single-threaded), so force
intra/inter_op=1, sequential exec, and clear intra_op_thread_affinities so ORT
never per-core-pins. Fixes run_policy showing up on cores 11/12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant