Pedestrian scennario runner

hey everyone,

i would like to ask if some someone know how to program a pedestrian in a class scenario test, and if you had an exemple of it? because i already find a code to show how to use a pedestrian but i dont know what i have to do to insert it in the class:

  1. def init,
  2. def _initialize_actors(self, config)
  3. def _create_behavior(self))

i also would know if it possible to choose a specific spawn coordinate in the XML file (like the car)? I also read, it impossible to had a pedestrian in a road (except for the pedestrian crossing), that is true?

if you need it i give you the code.
client = carla.Client(“localhost”, 2000)
world = client.get_world()

walker_bp = world.get_blueprint_library().filter(“walker.pedestrian.*”)
controller_bp = world.get_blueprint_library().find(‘controller.ai.walker’)

trans = carla.Transform()
trans.location = world.get_random_location_from_navigation()
trans.location.z += 1

walker = random.choice(walker_bp)
actor = world.spawn_actor(walker, trans)
world.wait_for_tick()

controller = world.spawn_actor(controller_bp, carla.Transform(), actor)
world.wait_for_tick()

controller.start()
controller.go_to_location(world.get_random_location_from_navigation())

thank you for everything