@@ -37,7 +37,6 @@ def setup(self, config: EnvironmentConfig | None = None) -> None:
3737
3838 rclpy .init (args = None )
3939
40-
4140 self .autoware_state = autoware_state .AutowareState ("ego_vehicle" , None )
4241
4342 self .route_node = route_node .RouteNode (self .autoware_state )
@@ -55,6 +54,8 @@ def setup(self, config: EnvironmentConfig | None = None) -> None:
5554 )
5655 self ._executor_thread .start ()
5756
57+ self .sent_route = False
58+
5859 # check the bridge is ready
5960 # publish sensor information to the bridge
6061 # wait for it to return the correct message
@@ -93,8 +94,6 @@ def set_route(self) -> None:
9394
9495 logger .info ("Clearing route..." )
9596 self .route_node .request_clear_route ()
96-
97-
9897
9998 def _convert_to_waypoint (self , point ):
10099 """Returns a waypoint
@@ -129,7 +128,11 @@ def run_step(self) -> None:
129128 if not self .agent_set_route :
130129 self .set_route ()
131130
132- if self .autoware_state .is_ready_publish_route () and self .agent_set_route :
131+ if (
132+ self .autoware_state .is_ready_publish_route ()
133+ and self .agent_set_route
134+ and not self .sent_route
135+ ):
133136 waypoints = []
134137 goal_pose = self ._convert_to_waypoint (
135138 self .goal_pose_world
@@ -139,8 +142,9 @@ def run_step(self) -> None:
139142 waypoints .append (
140143 self ._convert_to_waypoint (waypoint ).autoware_from_world_coords ()
141144 )
142- self .route_node .request_route (goal_pose , waypoints )
145+ # self.route_node.request_route(goal_pose, waypoints)
143146 self .route_node .publish_route (goal_pose , waypoints )
147+ self .sent_route = True
144148
145149 # check if the current route is set
146150 if self .autoware_state .route_ready () and not self .autoware_state .sent_engage :
0 commit comments