Allow strafe_efficiency=1.0 in mec preset test; minor comment cleanup
After a deep investigation into the n=5 mecanum sim-to-real gap, all
attempted fixes (consensus tightening, wall_reject tightening, static-
phantom drop, deploy-time track merge, in-tracker track merge,
fp_rate-augmented retrain, max_range cap, 140° mecanum retrain) failed
to reliably pen n=5 in Webots without regressing n=10. The phantom
problem at 360° + small flock is genuinely hard and out of scope for
the deadline; documented in docs/status.md.
Result preserved from the previous mecanum work:
* 16/16 differential cells pen N/N.
* 4/8 mecanum cells (all n=10) pen 10/10 via Supervisor kinematic
injection (commit 27c0f65).
* n=5 mecanum is the known gap.
Small changes that survived the iteration:
* tests/test_config.py — strafe_efficiency=1.0 is now valid (kinematic
injection means the gym preset and Webots controller share the
formula, so textbook values produce gym-identical body motion).
* tools/run_webots.sh — refreshed the LiDAR-variant comment.
* training/rl/train.py — comment polish.
This commit is contained in:
@@ -156,8 +156,13 @@ class TestRobotConfig:
|
|||||||
|
|
||||||
def test_mec_webots_preset(self):
|
def test_mec_webots_preset(self):
|
||||||
from herding.config import HERDING_MEC_WEBOTS
|
from herding.config import HERDING_MEC_WEBOTS
|
||||||
assert 0.0 < HERDING_MEC_WEBOTS.robot.strafe_efficiency < 1.0
|
# Mecanum runs deploy via Supervisor kinematic injection
|
||||||
assert HERDING_MEC_WEBOTS.robot.strafe_to_forward_bleed < 0.0
|
# (controllers/shepherd_dog/shepherd_dog.py:drive_mecanum), so
|
||||||
|
# whatever strafe_efficiency/strafe_to_forward_bleed the preset
|
||||||
|
# picks is what Webots will apply. The preset is allowed to be
|
||||||
|
# textbook (1.0, 0.0) or matched (<1.0, ≠0.0).
|
||||||
|
cfg = HERDING_MEC_WEBOTS.robot
|
||||||
|
assert 0.0 < cfg.strafe_efficiency <= 1.0
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|||||||
+3
-5
@@ -90,11 +90,9 @@ fi
|
|||||||
|
|
||||||
cp "$SRC" "$DST"
|
cp "$SRC" "$DST"
|
||||||
|
|
||||||
# LiDAR FOV variant. For mecanum the default is 360° because the
|
# LiDAR FOV variant. Mecanum defaults to 360° (the trained mecanum
|
||||||
# physical-roller proto's passive yaw drift makes the 140° front
|
# target); diff defaults to 140°. Override with HERDING_LIDAR=140 or
|
||||||
# cone unreliable (heading errors push detections out of the
|
# HERDING_LIDAR=360 for ablations.
|
||||||
# tracker's world-frame matching gates). Diff defaults to 140°
|
|
||||||
# matching the canonical ShepherdDog.proto.
|
|
||||||
if [[ -z "${HERDING_LIDAR:-}" ]]; then
|
if [[ -z "${HERDING_LIDAR:-}" ]]; then
|
||||||
if [[ "$DRIVE" == "mecanum" ]]; then
|
if [[ "$DRIVE" == "mecanum" ]]; then
|
||||||
LIDAR_VARIANT="360"
|
LIDAR_VARIANT="360"
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ def main() -> None:
|
|||||||
HerdingConfig, HERDING_MEC_WEBOTS_360, DomainRandomConfig, RobotConfig,
|
HerdingConfig, HERDING_MEC_WEBOTS_360, DomainRandomConfig, RobotConfig,
|
||||||
)
|
)
|
||||||
herding_cfg = None
|
herding_cfg = None
|
||||||
# Mecanum always trains under HERDING_MEC_WEBOTS_360 (360° LiDAR +
|
# Mecanum trains under HERDING_MEC_WEBOTS_360 (360° LiDAR +
|
||||||
# kinematic-matched strafe scaling + small compass-noise DR).
|
# kinematic-matched strafe scaling + small compass-noise DR).
|
||||||
is_mecanum = (drive_mode == "mecanum")
|
is_mecanum = (drive_mode == "mecanum")
|
||||||
if is_mecanum or args.fp_rate > 0.0 or args.action_smooth > 0.0 or args.wheel_slip_std > 0.0:
|
if is_mecanum or args.fp_rate > 0.0 or args.action_smooth > 0.0 or args.wheel_slip_std > 0.0:
|
||||||
|
|||||||
Reference in New Issue
Block a user