POMDPPlanners.tests.test_environments.test_carla_pomdp package

Tests for the CARLA POMDP world environment.

Subpackages

Submodules

POMDPPlanners.tests.test_environments.test_carla_pomdp.test_carla_belief module

Tests for the perceived-agents CARLA particle belief.

Covers PerceivedAgentsBelief stamping the observation’s agents block onto every particle: perceived agents are written into the slots (with jitter), empty slots are cleared, the ego block is preserved, and the returned belief is itself a PerceivedAgentsBelief so the stamping repeats each step. Perception itself lives in the world’s observation model, so these tests feed a perceived agents block directly. All tests run on hand-built states.

POMDPPlanners.tests.test_environments.test_carla_pomdp.test_carla_belief.test_reinvigorate_clears_slots_when_nothing_perceived()[source]

An observation with no perceived agents clears the stamped agent block.

Purpose: Validates stamping overwrites (does not accumulate) stale slots.

Given: Particles pre-seeded with a present slot and an observation with no agents When: reinvigorate stamps the empty perceived block Then: Every particle’s agent slots are cleared to empty

Test type: unit

POMDPPlanners.tests.test_environments.test_carla_pomdp.test_carla_belief.test_reinvigorate_marks_perceived_agent_present()[source]

A perceived agent turns on the matching particle slot on every particle.

Purpose: Validates stamping acquires traffic the particles were not seeded with.

Given: A belief of empty-agent particles and an observation with one perceived agent When: reinvigorate stamps the observation’s agent block onto the particles Then: Every particle’s first slot is marked present (== 1.0)

Test type: unit

POMDPPlanners.tests.test_environments.test_carla_pomdp.test_carla_belief.test_reinvigorate_places_agent_near_perceived_pose()[source]

Stamped agents cluster around the perceived pose.

Purpose: Validates the perceived pose (not zero) is written into the slot.

Given: A belief and an observation with an agent 8 m ahead, 1 m to the left When: reinvigorate stamps the agent block over many particles Then: The mean stamped slot position is close to the perceived position

Test type: unit

POMDPPlanners.tests.test_environments.test_carla_pomdp.test_carla_belief.test_reinvigorate_preserves_ego_block()[source]

Stamping leaves the ego state block untouched.

Purpose: Validates only agent slots are overwritten, not the filtered ego estimate.

Given: Particles with distinct non-zero ego blocks and an observation with an agent When: reinvigorate stamps the agent block Then: The ego block of every particle is unchanged

Test type: unit

POMDPPlanners.tests.test_environments.test_carla_pomdp.test_carla_belief.test_reinvigorate_returns_same_type_for_persistent_stamping()[source]

Reinvigorate returns a PerceivedAgentsBelief so stamping repeats across steps.

Purpose: Validates the belief type persists (not downgraded to base).

Given: A PerceivedAgentsBelief and any observation When: reinvigorate produces the next belief Then: The result is a PerceivedAgentsBelief carrying the same config

Test type: unit

POMDPPlanners.tests.test_environments.test_carla_pomdp.test_carla_belief.test_stamped_agents_have_particle_diversity()[source]

Per-particle jitter keeps stamped agent poses diverse.

Purpose: Validates the filter can still discriminate agent poses after stamping.

Given: A belief and an observation with one perceived agent, non-zero jitter When: reinvigorate stamps the agent block Then: The stamped slot poses are not all identical across particles

Test type: unit

POMDPPlanners.tests.test_environments.test_carla_pomdp.test_carla_belief.test_update_persists_stamping_through_full_filter_step()[source]

A full belief.update stamps the perceived agents and stays a PerceivedAgentsBelief.

Purpose: Validates the reinvigoration hook fires through the whole PF update path.

Given: A belief of empty-agent particles and a kinematic model as the transition/obs POMDP When: update is called with an observation carrying a perceived agent Then: The updated belief is a PerceivedAgentsBelief whose particles carry that agent

Test type: integration

POMDPPlanners.tests.test_environments.test_carla_pomdp.test_carla_belief.test_zero_jitter_stamps_identical_blocks()[source]

With jitter disabled every particle receives the exact perceived block.

Purpose: Validates the jitter guard so a study can stamp the perceived estimate verbatim.

Given: A zero-jitter belief and an observation with one perceived agent When: reinvigorate stamps the agent block Then: Every particle’s agent block is identical

Test type: unit

POMDPPlanners.tests.test_environments.test_carla_pomdp.test_carla_pomdp module

POMDPPlanners.tests.test_environments.test_carla_pomdp.test_carla_server_pool module

POMDPPlanners.tests.test_environments.test_carla_pomdp.test_carla_video module