Skip to content

Commit

Permalink
style: fix cpplint and uncrustify
Browse files Browse the repository at this point in the history
  • Loading branch information
outrider-jhulas committed Oct 25, 2023
1 parent 938f688 commit 3757586
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,15 @@ class Aggregator

std::string base_path_; /**< \brief Prepended to all status names of aggregator. */

bool critical_; /**< \brief If true, aggregator will publish an error immediately after receiving. */
std::uint8_t last_top_level_state_; /**< \brief Store the last top level value to publish the critical error only once */
/*!
*\brief If true, aggregator will publish an error immediately after receiving.
*/
bool critical_;

/*!
*\brief Store the last top level value to publish the critical error only once.
*/
std::uint8_t last_top_level_state_;

/// Records all ROS warnings. No warnings are repeated.
std::set<std::string> ros_warnings_;
Expand Down
7 changes: 4 additions & 3 deletions diagnostic_aggregator/src/aggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ void Aggregator::diagCallback(const DiagnosticArray::SharedPtr diag_msg)
for (auto j = 0u; j < diag_msg->status.size(); ++j) {
analyzed = false;

const bool top_level_state_transition_to_error = (last_top_level_state_ != DiagnosticStatus::ERROR)
&& (diag_msg->status[j].level == DiagnosticStatus::ERROR);
const bool top_level_state_transition_to_error =
(last_top_level_state_ != DiagnosticStatus::ERROR) &&
(diag_msg->status[j].level == DiagnosticStatus::ERROR);

if (critical_ && top_level_state_transition_to_error) {
RCLCPP_DEBUG(
Expand All @@ -171,7 +172,7 @@ void Aggregator::diagCallback(const DiagnosticArray::SharedPtr diag_msg)
// store the last published state
last_top_level_state_ = diag_toplevel_state.level;
}

auto item = std::make_shared<StatusItem>(&diag_msg->status[j]);

if (analyzer_group_->match(item->getName())) {
Expand Down

0 comments on commit 3757586

Please sign in to comment.