Skip to content

Commit 5a72683

Browse files
cleaned up initialisation code
1 parent 42ab5da commit 5a72683

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎cawsr.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,6 @@ def run_scenario(
205205
else:
206206
logger.info("Successfully initialised agent; route set.")
207207

208-
self._tick_carla()
209-
210208
logger.info("Loading Traffic Manager...")
211209
tm_port = int(self._carla.TRAFFIC_MANAGER.PORT) # type: ignore
212210
CarlaDataProvider.set_traffic_manager_port(tm_port)

‎srunner/autoagents/autoware_agent.py‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ def run_step_init(self) -> bool:
138138
139139
Ticks CARLA and Autoware, allowing the agent to localise and plan the route.
140140
Operates on a fixed tick budget to ensure determinism. If the agent goes over the budget, it is treated as a failure.
141-
142141
"""
143142

144143
if not self.agent_set_route:
@@ -166,6 +165,8 @@ def run_step_init(self) -> bool:
166165
if self.autoware_state.route_set() and not self.autoware_state.sent_engage:
167166
return True
168167

168+
self.carla_interface.tick_bridge()
169+
169170
return False
170171

171172
def run_step(self) -> None:
@@ -177,11 +178,11 @@ def run_step(self) -> None:
177178
)
178179
self.last_tick = time.perf_counter_ns()
179180

180-
if not self.initialised:
181-
self.initialised = self.run_step_init()
182-
183-
if self.initialised:
184-
logger.info("Set agent route!")
181+
# if not self.initialised:
182+
# self.initialised = self.run_step_init()
183+
#
184+
# if self.initialised:
185+
# logger.info("Set agent route!")
185186

186187
# check if the current route is set and we can publish engage
187188
if self.autoware_state.route_set() and not self.autoware_state.sent_engage:

0 commit comments

Comments
 (0)