Skip to content

Commit

Permalink
feat(planner_manager): output module status (autowarefoundation#3729)
Browse files Browse the repository at this point in the history
* feat(planner_manager): output module status

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

* feat(planner_manager): use magic enum

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

---------

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
  • Loading branch information
satoshi-ota committed May 25, 2023
1 parent 1f809b8 commit d67dd9e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions planning/behavior_path_planner/src/planner_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "behavior_path_planner/utils/utils.hpp"

#include <lanelet2_extension/utility/utilities.hpp>
#include <magic_enum.hpp>

#include <boost/format.hpp>

Expand Down Expand Up @@ -575,6 +576,10 @@ void PlannerManager::print() const
return;
}

const auto get_status = [](const auto & m) {
return magic_enum::enum_name(m->getCurrentStatus());
};

size_t max_string_num = 0;

std::ostringstream string_stream;
Expand All @@ -591,13 +596,15 @@ void PlannerManager::print() const
string_stream << "\n";
string_stream << "approved modules : ";
for (const auto & m : approved_module_ptrs_) {
string_stream << "[" << m->name() << "]->";
string_stream << "[" << m->name() << "(" << get_status(m) << ")"
<< "]->";
}

string_stream << "\n";
string_stream << "candidate module : ";
for (const auto & m : candidate_module_ptrs_) {
string_stream << "[" << m->name() << "]->";
string_stream << "[" << m->name() << "(" << get_status(m) << ")"
<< "]->";
}

string_stream << "\n" << std::fixed << std::setprecision(1);
Expand Down

0 comments on commit d67dd9e

Please sign in to comment.