Skip to content

Commit 569d56c

Browse files
authored
fix(bpp): keep publishing rtc cooperate status (#6953)
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent 473f238 commit 569d56c

File tree

4 files changed

+13
-20
lines changed

4 files changed

+13
-20
lines changed

planning/behavior_path_planner/include/behavior_path_planner/planner_manager.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,6 @@ class PlannerManager
290290

291291
module_ptr->updateCurrentState();
292292

293-
module_ptr->publishRTCStatus();
294-
295293
module_ptr->publishSteeringFactor();
296294

297295
module_ptr->publishObjectsOfInterestMarker();
@@ -323,7 +321,6 @@ class PlannerManager
323321
void deleteExpiredModules(SceneModulePtr & module_ptr) const
324322
{
325323
module_ptr->onExit();
326-
module_ptr->publishRTCStatus();
327324
module_ptr->publishObjectsOfInterestMarker();
328325
module_ptr.reset();
329326
}

planning/behavior_path_planner/src/planner_manager.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,10 @@ BehaviorModuleOutput PlannerManager::run(const std::shared_ptr<PlannerData> & da
191191
return BehaviorModuleOutput{}; // something wrong.
192192
}();
193193

194-
std::for_each(
195-
manager_ptrs_.begin(), manager_ptrs_.end(), [](const auto & m) { m->updateObserver(); });
194+
std::for_each(manager_ptrs_.begin(), manager_ptrs_.end(), [](const auto & m) {
195+
m->updateObserver();
196+
m->publishRTCStatus();
197+
});
196198

197199
generateCombinedDrivableArea(result_output, data);
198200

planning/behavior_path_planner_common/include/behavior_path_planner_common/interface/scene_module_interface.hpp

-13
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ class SceneModuleInterface
186186

187187
clearWaitingApproval();
188188
removeRTCStatus();
189-
publishRTCStatus();
190189
unlockNewModuleLaunch();
191190
unlockOutputPath();
192191
steering_factor_interface_ptr_->clearSteeringFactors();
@@ -196,18 +195,6 @@ class SceneModuleInterface
196195
processOnExit();
197196
}
198197

199-
/**
200-
* @brief Publish status if the module is requested to run
201-
*/
202-
void publishRTCStatus()
203-
{
204-
for (const auto & [module_name, ptr] : rtc_interface_ptr_map_) {
205-
if (ptr) {
206-
ptr->publishCooperateStatus(clock_->now());
207-
}
208-
}
209-
}
210-
211198
void publishObjectsOfInterestMarker()
212199
{
213200
for (const auto & [module_name, ptr] : objects_of_interest_marker_interface_ptr_map_) {

planning/behavior_path_planner_common/include/behavior_path_planner_common/interface/scene_module_manager_interface.hpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ class SceneModuleManagerInterface
9999
observers_.erase(itr, observers_.end());
100100
}
101101

102+
void publishRTCStatus()
103+
{
104+
for (const auto & [module_name, ptr] : rtc_interface_ptr_map_) {
105+
if (ptr) {
106+
ptr->publishCooperateStatus(rclcpp::Clock(RCL_ROS_TIME).now());
107+
}
108+
}
109+
}
110+
102111
void publishVirtualWall() const
103112
{
104113
using tier4_autoware_utils::appendMarkerArray;
@@ -235,15 +244,13 @@ class SceneModuleManagerInterface
235244
std::for_each(observers_.begin(), observers_.end(), [](const auto & observer) {
236245
if (!observer.expired()) {
237246
observer.lock()->onExit();
238-
observer.lock()->publishRTCStatus();
239247
}
240248
});
241249

242250
observers_.clear();
243251

244252
if (idle_module_ptr_ != nullptr) {
245253
idle_module_ptr_->onExit();
246-
idle_module_ptr_->publishRTCStatus();
247254
idle_module_ptr_.reset();
248255
}
249256

0 commit comments

Comments
 (0)