CloudTwin  ROS2 Humble
Digital twin for path and trajectory optimisation
Classes | Functions | Variables
test_random_obstacle_spawner Namespace Reference

Classes

class  CancelTimer
 
class  ControlledEmergencyStateSpawner
 
class  ControlledPatrolStateSpawner
 
class  FakeCycleSpawner
 
class  MotionSpawner
 
class  OpenMap
 
class  RecordingLogger
 

Functions

def dense_segment_is_valid (grid, start, end)
 
def hospital_map ()
 
def minimum_emergency_distance (phase)
 
def path_length (start, waypoints)
 
def position_on_path (start, waypoints, elapsed, speed=1.0)
 
def route_path_length (route)
 
def route_position_at (route, elapsed)
 
def sample_route_points (start, waypoints)
 
def sampled_routes_min_distance (routes)
 
def shared_track_min_distance (routes)
 
def test_close_humans_can_move_apart ()
 
def test_close_humans_cannot_move_closer ()
 
def test_controlled_emergency_has_eight_spaced_gathering_points ()
 
def test_controlled_emergency_routes_are_valid_on_hospital_map ()
 
def test_controlled_emergency_routes_keep_distance_over_time ()
 
def test_controlled_emergency_trigger_assigns_fixed_routes ()
 
def test_controlled_emergency_waiting_human_uses_fixed_return_route ()
 
def test_controlled_patrol_counts_are_fixed ()
 
def test_controlled_patrol_routes_are_spaced ()
 
def test_controlled_patrol_routes_are_valid_on_hospital_map ()
 
def test_controlled_patrol_state_restarts_loop ()
 
def test_cycle_schedules_next_emergency_after_dispersal ()
 
def test_cycle_waits_until_dispersal_is_complete ()
 
def test_disabled_loop_does_not_schedule_another_emergency ()
 
def test_human_inside_robot_keepout_can_move_away ()
 
def test_motion_rejects_robot_keepout ()
 
def test_spawn_timeout_starts_with_successful_partial_batch ()
 
def test_spawn_timeout_without_successful_spawns_fails ()
 
def test_waiting_emergency_human_holds_position_when_grouped ()
 
def test_walking_humans_can_enter_soft_spacing ()
 

Variables

 controlled_emergency_speed
 
 emergency_cycle
 
 emergency_cycle_active
 
 emergency_duration
 
 logger
 
 movement_started
 
 next_emergency_time
 
 people
 
string SCRIPTS_DIR = Path(__file__).resolve().parents[1] / "scripts"
 
 spawn_response_timeout
 
 spawn_timeout_timer
 
 started
 

Detailed Description

State-machine tests for the controlled obstacle spawner.

Function Documentation

◆ dense_segment_is_valid()

def test_random_obstacle_spawner.dense_segment_is_valid (   grid,
  start,
  end 
)

◆ hospital_map()

def test_random_obstacle_spawner.hospital_map ( )

◆ minimum_emergency_distance()

def test_random_obstacle_spawner.minimum_emergency_distance (   phase)

◆ path_length()

def test_random_obstacle_spawner.path_length (   start,
  waypoints 
)

◆ position_on_path()

def test_random_obstacle_spawner.position_on_path (   start,
  waypoints,
  elapsed,
  speed = 1.0 
)

◆ route_path_length()

def test_random_obstacle_spawner.route_path_length (   route)

◆ route_position_at()

def test_random_obstacle_spawner.route_position_at (   route,
  elapsed 
)

◆ sample_route_points()

def test_random_obstacle_spawner.sample_route_points (   start,
  waypoints 
)

◆ sampled_routes_min_distance()

def test_random_obstacle_spawner.sampled_routes_min_distance (   routes)

◆ shared_track_min_distance()

def test_random_obstacle_spawner.shared_track_min_distance (   routes)

◆ test_close_humans_can_move_apart()

def test_random_obstacle_spawner.test_close_humans_can_move_apart ( )

◆ test_close_humans_cannot_move_closer()

def test_random_obstacle_spawner.test_close_humans_cannot_move_closer ( )

◆ test_controlled_emergency_has_eight_spaced_gathering_points()

def test_random_obstacle_spawner.test_controlled_emergency_has_eight_spaced_gathering_points ( )

◆ test_controlled_emergency_routes_are_valid_on_hospital_map()

def test_random_obstacle_spawner.test_controlled_emergency_routes_are_valid_on_hospital_map ( )

◆ test_controlled_emergency_routes_keep_distance_over_time()

def test_random_obstacle_spawner.test_controlled_emergency_routes_keep_distance_over_time ( )

◆ test_controlled_emergency_trigger_assigns_fixed_routes()

def test_random_obstacle_spawner.test_controlled_emergency_trigger_assigns_fixed_routes ( )

◆ test_controlled_emergency_waiting_human_uses_fixed_return_route()

def test_random_obstacle_spawner.test_controlled_emergency_waiting_human_uses_fixed_return_route ( )

◆ test_controlled_patrol_counts_are_fixed()

def test_random_obstacle_spawner.test_controlled_patrol_counts_are_fixed ( )

◆ test_controlled_patrol_routes_are_spaced()

def test_random_obstacle_spawner.test_controlled_patrol_routes_are_spaced ( )

◆ test_controlled_patrol_routes_are_valid_on_hospital_map()

def test_random_obstacle_spawner.test_controlled_patrol_routes_are_valid_on_hospital_map ( )

◆ test_controlled_patrol_state_restarts_loop()

def test_random_obstacle_spawner.test_controlled_patrol_state_restarts_loop ( )

◆ test_cycle_schedules_next_emergency_after_dispersal()

def test_random_obstacle_spawner.test_cycle_schedules_next_emergency_after_dispersal ( )

◆ test_cycle_waits_until_dispersal_is_complete()

def test_random_obstacle_spawner.test_cycle_waits_until_dispersal_is_complete ( )

◆ test_disabled_loop_does_not_schedule_another_emergency()

def test_random_obstacle_spawner.test_disabled_loop_does_not_schedule_another_emergency ( )

◆ test_human_inside_robot_keepout_can_move_away()

def test_random_obstacle_spawner.test_human_inside_robot_keepout_can_move_away ( )

◆ test_motion_rejects_robot_keepout()

def test_random_obstacle_spawner.test_motion_rejects_robot_keepout ( )

◆ test_spawn_timeout_starts_with_successful_partial_batch()

def test_random_obstacle_spawner.test_spawn_timeout_starts_with_successful_partial_batch ( )

◆ test_spawn_timeout_without_successful_spawns_fails()

def test_random_obstacle_spawner.test_spawn_timeout_without_successful_spawns_fails ( )

◆ test_waiting_emergency_human_holds_position_when_grouped()

def test_random_obstacle_spawner.test_waiting_emergency_human_holds_position_when_grouped ( )

◆ test_walking_humans_can_enter_soft_spacing()

def test_random_obstacle_spawner.test_walking_humans_can_enter_soft_spacing ( )

Variable Documentation

◆ controlled_emergency_speed

test_random_obstacle_spawner.controlled_emergency_speed

◆ emergency_cycle

test_random_obstacle_spawner.emergency_cycle

◆ emergency_cycle_active

test_random_obstacle_spawner.emergency_cycle_active

◆ emergency_duration

test_random_obstacle_spawner.emergency_duration

◆ logger

test_random_obstacle_spawner.logger

◆ movement_started

test_random_obstacle_spawner.movement_started

◆ next_emergency_time

test_random_obstacle_spawner.next_emergency_time

◆ people

test_random_obstacle_spawner.people

◆ SCRIPTS_DIR

string test_random_obstacle_spawner.SCRIPTS_DIR = Path(__file__).resolve().parents[1] / "scripts"

◆ spawn_response_timeout

test_random_obstacle_spawner.spawn_response_timeout

◆ spawn_timeout_timer

test_random_obstacle_spawner.spawn_timeout_timer

◆ started

test_random_obstacle_spawner.started