diff --git a/robot_sf/gym_env/env_util.py b/robot_sf/gym_env/env_util.py index 6a4c32a..6956ef3 100644 --- a/robot_sf/gym_env/env_util.py +++ b/robot_sf/gym_env/env_util.py @@ -278,19 +278,25 @@ def speed_sensor(r_id=0): ) ) - def ray_sensor(): + def ray_sensor_ego_ped(): return lidar_ray_scan(sim.ego_ped.pose, occupancies[1], lidar_config)[0] - def target_sensor(): + def target_sensor_ego_ped(): return target_sensor_obs( sim.ego_ped.pose, sim.ego_ped_goal_pos, None ) # TODO: What next goal to choose? - def speed_sensor(): + def speed_sensor_ego_ped(): return sim.ego_ped.current_speed sensor_fusions.append( - SensorFusion(ray_sensor, speed_sensor, target_sensor, orig_obs_space[1], False) + SensorFusion( + ray_sensor_ego_ped, + speed_sensor_ego_ped, + target_sensor_ego_ped, + orig_obs_space[1], + False, + ) ) # Ego pedestrian does not have a next goal # Format: [robot, ego_pedestrian] diff --git a/tests/env_test.py b/tests/env_test.py index 109b5cd..6dff3ff 100644 --- a/tests/env_test.py +++ b/tests/env_test.py @@ -47,3 +47,9 @@ def test_ego_ped_env(): _, _, done, _, _ = env.step(rand_action) if done: env.reset() + +if __name__ == "__main__": + # test_can_create_env() + # test_can_return_valid_observation() + # test_can_simulate_with_pedestrians() + test_ego_ped_env()