Skip to content

Add ER-Force simulator realism options from upstream - #3948

Closed
Andrewyx wants to merge 1 commit into
Andrewyx/erforce_sim_physics_fixesfrom
Andrewyx/erforce_sim_realism_options
Closed

Andrewyx wants to merge 1 commit into
Andrewyx/erforce_sim_physics_fixesfrom
Andrewyx/erforce_sim_realism_options

Conversation

@Andrewyx

@Andrewyx Andrewyx commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

WIP Claude Template

Second of four stacked PRs porting upstream ER-Force simulator changes (#3912). Stacked on #3947.

This PR ports the realism options upstream added since our fork. All of them default to off, so the simulator behaves exactly as it does today unless they are configured:

  • missing_robot_detections (upstream 0f49e671), and missing ball detections are now rolled per camera instead of for all cameras at once (upstream 6bb0bdce), which is what the real vision does.
  • command_delay (upstream 89158739). Our fork applies robot control commands immediately rather than from a queue, so delayed commands are held in a per team queue and applied, with their radio responses, once the delay has passed.
  • robot_rotation_error (upstream b6c119de), which makes a robot drift instead of driving perfectly straight.
  • rotated_robot_detections_start/stop (upstream 2a94f56b), which reports a robot a second time with its pattern misread as the one rotated by 90 degrees.

Two things worth a reviewer's attention:

  • The robot detection code in getWrapperPackets moves into createRobotDetection, mirroring upstream. This is the bulk of the diff and is a straight extraction.
  • Realism settings that live on the robots themselves are applied through applyRobotRealism, so robots created after the configuration arrives (setTeam, moveRobot, resetFlipped) get them too. Upstream only applies them to robots that already exist, which I believe is a bug on their side.

createRealisticRealismConfig is synced with upstream's Realistic.txt, keeping our perfect dribbler, and no longer sets missing_ball_detections twice (it set 0.05 then 0.02; 0.02 is what it has actually been doing, so that is what it keeps).

Testing Done

  • Four new realism tests in er_force_simulator_test: robots are always detected by default, never detected at missing_robot_detections=1, rotated detections are reported on top of the real one with the rotated pattern id, and commands only take effect after command_delay. The command delay test compares against an undelayed run and fails if the delay path is disabled.
  • Defaults unchanged: the existing simulator and gameplay tests pass without modification.
  • Same full suite runs as Fix ER-Force simulator dribbling physics and reported ball model #3947.

Resolved Issues

Part of #3912

Length Justification and Key Files to Review

542 lines, of which roughly half is the createRobotDetection extraction and its tests. The options share that one code path, so splitting them into separate PRs would mean moving the same block repeatedly. Key files: src/extlibs/er_force_sim/src/amun/simulator/simulator.cpp and simulator.h.

Review Checklist

  • Function & Class comments
  • Remove all commented out code
  • Remove extra print statements
  • Resolve all TODO's

Ports the realism options that upstream added to their simulator since we
forked it. All of them default to off, so the simulator behaves exactly as
before unless they are configured.

- missing_robot_detections (upstream 0f49e671), and missing ball detections
  are now rolled per camera instead of for all cameras at once
  (upstream 6bb0bdce), which is what the real vision does
- command_delay (upstream 89158739). Our fork applies robot control commands
  immediately rather than from a queue, so delayed commands are held in a per
  team queue and applied, with their radio responses, once the delay passed
- robot_rotation_error (upstream b6c119de), which makes a robot drift instead
  of driving perfectly straight
- rotated_robot_detections_start/stop (upstream 2a94f56b), which reports a
  robot a second time with its pattern misread as the one rotated by 90
  degrees

The robot detection code in getWrapperPackets moves into createRobotDetection
along the way, mirroring upstream. Realism settings that live on the robots
themselves are applied through applyRobotRealism, so that robots created after
the configuration arrives (by setTeam, moveRobot or resetFlipped) get them too;
upstream only applies them to robots that already exist.

createRealisticRealismConfig is synced with upstream's Realistic.txt, keeping
our perfect dribbler, and no longer sets missing_ball_detections twice.
@Andrewyx
Andrewyx force-pushed the Andrewyx/erforce_sim_realism_options branch from 76e0bd4 to c96528a Compare September 12, 2026 08:45
@Andrewyx

Andrewyx commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

closing for now. expected revisit winter 2026.

@Andrewyx Andrewyx closed this Oct 1, 2026
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