Skip to content

test(env): add deterministic mock environment fixture - #5

Merged
Staaaaaaaaar merged 1 commit into
mainfrom
feat/mock-env-fixture
Aug 17, 2026
Merged

test(env): add deterministic mock environment fixture#5
Staaaaaaaaar merged 1 commit into
mainfrom
feat/mock-env-fixture

Conversation

@Staaaaaaaaar

Copy link
Copy Markdown
Owner

Summary

  • add the CPU-only rh_mock_env package as a deterministic Environment contract fixture
  • provide status readiness, idempotent full-3D reset, fixed-step simulation clock, odometry, and map-to-odom-to-base_link TF
  • integrate planar body-frame cmd_vel while preserving reset height, roll, and pitch
  • enforce a strict non-RUNNING zero gate and a simulation-time command watchdog
  • add black-box ROS integration coverage under tests/integration_mock

Runtime behavior

  • READY is published only after required publishers, subscriptions, service, clock, odometry, and TF are initialized
  • reset validates the complete map-frame pose and normalized quaternion, zeros motion, activates the expected Episode, and does not rewind global simulation time
  • equivalent duplicate request IDs replay the first result without resetting again; conflicting reuse is rejected
  • delayed, wrong-Episode, and non-increasing Episode state messages are filtered by rh_ros
  • fixed-step motion is intentionally planar and deterministic rather than physically realistic

Fault injection

  • configurable readiness delay or never-ready startup
  • reset failure with ERROR and restart-required status
  • clock freeze
  • stale status heartbeat suppression
  • startup-only model parameters reject ineffective runtime changes

The heartbeat helper gains an explicit enable switch so fixtures can test stale-component handling without reaching into private timer state.

Boundaries

This fixture is not a simulator product and does not model collision, acceleration, gravity, contacts, sensors, noise, Gazebo, Isaac Sim, or Go2 compatibility. It exists only to verify the public Env ROS contract on CPU CI.

Validation

  • make dev-check
  • repository, Markdown, YAML, and Ruff checks pass
  • 7 ROS packages build successfully under Ubuntu 22.04 and ROS 2 Humble
  • 151 tests pass with 0 errors, failures, or skips
  • 12 deterministic model tests pass
  • 5 ROS black-box tests complete in about 2.2 seconds, below the 30-second acceptance limit
  • ros2 pkg executables rh_mock_env reports the mock_env executable

@Staaaaaaaaar
Staaaaaaaaar merged commit a4e3986 into main Aug 17, 2026
1 check passed
@Staaaaaaaaar
Staaaaaaaaar deleted the feat/mock-env-fixture branch August 17, 2026 08:56
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