Fix action smoothing history and viewer timing control

This commit is contained in:
8x54zj-m
2026-07-22 13:25:17 +08:00
parent 1a84cf69ab
commit 1072565d97
4 changed files with 49 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ terrain="stairs_box"
level="0"
forward_speed="0.5"
timeout="30"
realtime_factor="1.0"
export_only=false
manual=false
headless=false
@@ -31,6 +32,8 @@ Options:
-l, --level N Terrain difficulty level passed to sim2sim. Default: 0.
--speed MPS Autonomous forward command. Default: 0.5.
--timeout SEC Validation timeout in simulation seconds. Default: 30.
--realtime-factor X
Viewer playback speed. Default: 1.0 (real time).
--manual Start at zero velocity and use keyboard commands.
--headless Run validation without a viewer or real-time delay.
--no-validation Run until the viewer closes instead of returning PASS/FAIL.
@@ -82,6 +85,11 @@ while (($#)); do
timeout="$2"
shift 2
;;
--realtime-factor)
(($# >= 2)) || die "$1 requires a number"
realtime_factor="$2"
shift 2
;;
--manual)
manual=true
shift
@@ -115,6 +123,8 @@ esac
[[ "$level" =~ ^[0-9]+$ ]] || die "level must be a non-negative integer: ${level}"
[[ "$forward_speed" =~ ^[0-9]+([.][0-9]+)?$ ]] || die "speed must be a non-negative number: ${forward_speed}"
[[ "$timeout" =~ ^[0-9]+([.][0-9]+)?$ ]] || die "timeout must be a non-negative number: ${timeout}"
[[ "$realtime_factor" =~ ^[0-9]+([.][0-9]+)?$ ]] || die "realtime-factor must be a positive number: ${realtime_factor}"
[[ "$realtime_factor" != "0" && "$realtime_factor" != "0.0" ]] || die "realtime-factor must be positive"
command -v uv >/dev/null 2>&1 || die "uv is not available in PATH"
if [[ -z "$checkpoint" ]]; then
@@ -159,6 +169,7 @@ sim_args=(
--level "$level"
--forward-speed "$forward_speed"
--timeout "$timeout"
--realtime-factor "$realtime_factor"
)
[[ "$manual" == true ]] && sim_args+=(--manual)
[[ "$headless" == true ]] && sim_args+=(--headless)