Skip to content

Commit 6dd0758

Browse files
committedMar 21, 2025
feat!(autoware_overlay_rviz_plugin): removed the blinking function of turn_signal
Signed-off-by: Y.Hisaki <yhisaki31@gmail.com>
1 parent 69c0a32 commit 6dd0758

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed
 

‎visualization/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin/include/turn_signals_display.hpp

-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ class TurnSignalsDisplay
5252
int current_turn_signal_; // Internal variable to store turn signal state
5353
int current_hazard_lights_; // Internal variable to store hazard lights state
5454
QImage coloredImage(const QImage & source, const QColor & color);
55-
56-
std::chrono::steady_clock::time_point last_toggle_time_;
57-
bool blink_on_ = false;
58-
const std::chrono::milliseconds blink_interval_{500}; // Blink interval in milliseconds
5955
};
6056

6157
} // namespace autoware_overlay_rviz_plugin

‎visualization/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin/src/turn_signals_display.cpp

+5-19
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ namespace autoware_overlay_rviz_plugin
3737

3838
TurnSignalsDisplay::TurnSignalsDisplay() : current_turn_signal_(0)
3939
{
40-
last_toggle_time_ = std::chrono::steady_clock::now();
41-
4240
// Load the arrow image
4341
std::string package_path =
4442
ament_index_cpp::get_package_share_directory("autoware_overlay_rviz_plugin");
@@ -87,28 +85,16 @@ void TurnSignalsDisplay::drawArrows(
8785
(current_turn_signal_ == autoware_vehicle_msgs::msg::TurnIndicatorsReport::ENABLE_RIGHT ||
8886
current_hazard_lights_ == autoware_vehicle_msgs::msg::HazardLightsReport::ENABLE);
8987

90-
// Color the arrows based on the state of the turn signals and hazard lights by having them blink
91-
// on and off
92-
if (this->blink_on_) {
93-
if (leftActive) {
94-
scaledLeftArrow = coloredImage(scaledLeftArrow, color);
95-
}
96-
if (rightActive) {
97-
scaledRightArrow = coloredImage(scaledRightArrow, color);
98-
}
88+
if (leftActive) {
89+
scaledLeftArrow = coloredImage(scaledLeftArrow, color);
90+
}
91+
if (rightActive) {
92+
scaledRightArrow = coloredImage(scaledRightArrow, color);
9993
}
10094

10195
// Draw the arrows
10296
painter.drawImage(QPointF(leftArrowXPos, arrowYPos), scaledLeftArrow);
10397
painter.drawImage(QPointF(rightArrowXPos, arrowYPos), scaledRightArrow);
104-
105-
auto now = std::chrono::steady_clock::now();
106-
if (
107-
std::chrono::duration_cast<std::chrono::milliseconds>(now - last_toggle_time_) >=
108-
blink_interval_) {
109-
blink_on_ = !blink_on_; // Toggle the blink state
110-
last_toggle_time_ = now;
111-
}
11298
}
11399

114100
QImage TurnSignalsDisplay::coloredImage(const QImage & source, const QColor & color)

0 commit comments

Comments
 (0)