Skip to content

Commit

Permalink
refactor(tier4_calibration_rviz_plugin): apply clang-tidy (tier4#1596)
Browse files Browse the repository at this point in the history
  • Loading branch information
h-ohta authored and boyali committed Sep 28, 2022
1 parent 05f9d3d commit c592a29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ void AccelBrakeMapCalibratorButtonPanel::onInitialize()
update_suggest_sub_ = raw_node->create_subscription<std_msgs::msg::Bool>(
topic_edit_->text().toStdString(), 10,
std::bind(
&AccelBrakeMapCalibratorButtonPanel::callbackUpdateSuggest, this, std::placeholders::_1));
&AccelBrakeMapCalibratorButtonPanel::callback_update_suggest, this, std::placeholders::_1));

client_ = raw_node->create_client<tier4_vehicle_msgs::srv::UpdateAccelBrakeMap>(
"/accel_brake_map_calibrator/update_map_dir");
}

void AccelBrakeMapCalibratorButtonPanel::callbackUpdateSuggest(
void AccelBrakeMapCalibratorButtonPanel::callback_update_suggest(
const std_msgs::msg::Bool::ConstSharedPtr msg)
{
if (after_calib_) {
Expand All @@ -96,20 +96,20 @@ void AccelBrakeMapCalibratorButtonPanel::callbackUpdateSuggest(
calibration_button_->setEnabled(true);
}

void AccelBrakeMapCalibratorButtonPanel::editTopic()
void AccelBrakeMapCalibratorButtonPanel::edit_topic()
{
update_suggest_sub_.reset();
rclcpp::Node::SharedPtr raw_node =
this->getDisplayContext()->getRosNodeAbstraction().lock()->get_raw_node();
update_suggest_sub_ = raw_node->create_subscription<std_msgs::msg::Bool>(
topic_edit_->text().toStdString(), 10,
std::bind(
&AccelBrakeMapCalibratorButtonPanel::callbackUpdateSuggest, this, std::placeholders::_1));
&AccelBrakeMapCalibratorButtonPanel::callback_update_suggest, this, std::placeholders::_1));
calibration_button_->setText("Wait for subscribe topic");
calibration_button_->setEnabled(false);
}

void AccelBrakeMapCalibratorButtonPanel::pushCalibrationButton()
void AccelBrakeMapCalibratorButtonPanel::push_calibration_button()
{
// lock button
calibration_button_->setEnabled(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ class AccelBrakeMapCalibratorButtonPanel : public rviz_common::Panel
public:
explicit AccelBrakeMapCalibratorButtonPanel(QWidget * parent = nullptr);
void onInitialize() override;
void callbackUpdateSuggest(const std_msgs::msg::Bool::ConstSharedPtr msg);
void callback_update_suggest(const std_msgs::msg::Bool::ConstSharedPtr msg);

public Q_SLOTS:
void editTopic();
void pushCalibrationButton();
public Q_SLOTS: // NOLINT for Qt
void edit_topic();
void push_calibration_button();

protected:
rclcpp::Subscription<std_msgs::msg::Bool>::SharedPtr update_suggest_sub_;
Expand All @@ -56,8 +56,6 @@ public Q_SLOTS:

QLabel * topic_label_;
QLineEdit * topic_edit_;
QLabel * dir_label_;
QLineEdit * dir_edit_;
QPushButton * calibration_button_;
QLabel * status_label_;
};
Expand Down

0 comments on commit c592a29

Please sign in to comment.