|
92 | 92 | agent_logger.setLevel(logging.INFO)
|
93 | 93 | agent_logger.addHandler(file_handler)
|
94 | 94 |
|
95 |
| - # load different scenes |
96 | 95 | configs_dir = "src/rai_bench/rai_bench/o3de_test_bench/configs/"
|
97 | 96 | connector_path = configs_dir + "o3de_config.yaml"
|
98 |
| - one_carrot_simulation_config = O3DExROS2SimulationConfig.load_config( |
99 |
| - base_config_path=Path(configs_dir + "scene1.yaml"), |
100 |
| - connector_config_path=Path(connector_path), |
101 |
| - ) |
102 |
| - multiple_carrot_simulation_config = O3DExROS2SimulationConfig.load_config( |
103 |
| - base_config_path=Path(configs_dir + "scene2.yaml"), |
104 |
| - connector_config_path=Path(connector_path), |
105 |
| - ) |
106 |
| - red_cubes_simulation_config = O3DExROS2SimulationConfig.load_config( |
107 |
| - base_config_path=Path(configs_dir + "scene3.yaml"), |
108 |
| - connector_config_path=Path(connector_path), |
109 |
| - ) |
110 |
| - multiple_cubes_simulation_config = O3DExROS2SimulationConfig.load_config( |
111 |
| - base_config_path=Path(configs_dir + "scene4.yaml"), |
112 |
| - connector_config_path=Path(connector_path), |
113 |
| - ) |
114 |
| - # combine different scene configs with the tasks to create various scenarios |
115 |
| - scenarios = [ |
116 |
| - Scenario( |
117 |
| - task=GrabCarrotTask(logger=bench_logger), |
118 |
| - simulation_config=one_carrot_simulation_config, |
119 |
| - ), |
120 |
| - Scenario( |
121 |
| - task=GrabCarrotTask(logger=bench_logger), |
122 |
| - simulation_config=multiple_carrot_simulation_config, |
123 |
| - ), |
124 |
| - Scenario( |
125 |
| - task=PlaceCubesTask(logger=bench_logger), |
126 |
| - simulation_config=red_cubes_simulation_config, |
127 |
| - ), |
128 |
| - Scenario( |
129 |
| - task=PlaceCubesTask(logger=bench_logger), |
130 |
| - simulation_config=multiple_cubes_simulation_config, |
131 |
| - ), |
| 97 | + #### Create scenarios manually |
| 98 | + # load different scenes |
| 99 | + # one_carrot_simulation_config = O3DExROS2SimulationConfig.load_config( |
| 100 | + # base_config_path=Path(configs_dir + "scene1.yaml"), |
| 101 | + # connector_config_path=Path(connector_path), |
| 102 | + # ) |
| 103 | + # multiple_carrot_simulation_config = O3DExROS2SimulationConfig.load_config( |
| 104 | + # base_config_path=Path(configs_dir + "scene2.yaml"), |
| 105 | + # connector_config_path=Path(connector_path), |
| 106 | + # ) |
| 107 | + # red_cubes_simulation_config = O3DExROS2SimulationConfig.load_config( |
| 108 | + # base_config_path=Path(configs_dir + "scene3.yaml"), |
| 109 | + # connector_config_path=Path(connector_path), |
| 110 | + # ) |
| 111 | + # multiple_cubes_simulation_config = O3DExROS2SimulationConfig.load_config( |
| 112 | + # base_config_path=Path(configs_dir + "scene4.yaml"), |
| 113 | + # connector_config_path=Path(connector_path), |
| 114 | + # ) |
| 115 | + # # combine different scene configs with the tasks to create various scenarios |
| 116 | + # scenarios = [ |
| 117 | + # Scenario( |
| 118 | + # task=GrabCarrotTask(logger=bench_logger), |
| 119 | + # simulation_config=one_carrot_simulation_config, |
| 120 | + # ), |
| 121 | + # Scenario( |
| 122 | + # task=GrabCarrotTask(logger=bench_logger), |
| 123 | + # simulation_config=multiple_carrot_simulation_config, |
| 124 | + # ), |
| 125 | + # Scenario( |
| 126 | + # task=PlaceCubesTask(logger=bench_logger), |
| 127 | + # simulation_config=red_cubes_simulation_config, |
| 128 | + # ), |
| 129 | + # Scenario( |
| 130 | + # task=PlaceCubesTask(logger=bench_logger), |
| 131 | + # simulation_config=multiple_cubes_simulation_config, |
| 132 | + # ), |
| 133 | + # ] |
| 134 | + |
| 135 | + ### Create scenarios automatically |
| 136 | + scene_paths = [ |
| 137 | + configs_dir + "scene1.yaml", |
| 138 | + configs_dir + "scene2.yaml", |
| 139 | + configs_dir + "scene3.yaml", |
| 140 | + configs_dir + "scene4.yaml", |
132 | 141 | ]
|
| 142 | + simulations_configs = [ |
| 143 | + O3DExROS2SimulationConfig.load_config(Path(path), Path(connector_path)) |
| 144 | + for path in scene_paths |
| 145 | + ] |
| 146 | + tasks = [ |
| 147 | + GrabCarrotTask(logger=bench_logger), |
| 148 | + PlaceCubesTask(logger=bench_logger), |
| 149 | + ] |
| 150 | + scenarios = Benchmark.create_scenarios( |
| 151 | + tasks=tasks, simulation_configs=simulations_configs |
| 152 | + ) |
133 | 153 |
|
134 | 154 | # custom request to arm
|
135 | 155 | base_arm_pose = PoseModel(translation=Translation(x=0.3, y=0.0, z=0.4))
|
|
0 commit comments