Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: rename autoware_perception_msgs::msg::TrafficSingal** to TrafficLight** #6763

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
ca4f1d3
refactor: refacotring `perception/map_based_prediction`
ktro2828 Apr 8, 2024
60e8050
refactor: refactoring `perception/traffic_light_arbiter`
ktro2828 Apr 8, 2024
ed58ba6
refactor: refactoring `perception/traffic_light_visualization`
ktro2828 Apr 8, 2024
0dd9c93
refactor: refactoring `perception/traffic_light_multi_camera_fusion`
ktro2828 Apr 8, 2024
51e338a
refactor: refactoring `perception/crosswalk_traffic_light_estimator`
ktro2828 Apr 8, 2024
3faec4a
refactor: refactoring `planning/planning_test_utils`
ktro2828 Apr 8, 2024
8add1e5
refactor: refactoring `planning/behavior_velocity_planner_common`
ktro2828 Apr 8, 2024
0f2958e
refactor: refactoring `common/traffic_light_utils`
ktro2828 Apr 8, 2024
1705436
refactor: refactoring `common/tier4_traffic_light_rviz_plugin`
ktro2828 Apr 8, 2024
c7652b8
refactor: refactoring `planning/behavior_velocity_intersection_module`
ktro2828 Apr 8, 2024
bd4b15a
refactor: refactoring `planning/behavior_path_planner_common`
ktro2828 Apr 8, 2024
83f6fe2
refactor: refactoring `planning/behavior_velocity_traffic_light_module`
ktro2828 Apr 8, 2024
887364b
refactor: refactoring `planning/behavior_velocity_crosswalk_module`
ktro2828 Apr 8, 2024
fb9bb7e
refactor: refactoring `planning/behavior_path_planner`
ktro2828 Apr 8, 2024
f6594f6
refactor: refactoring `planning/behavior_path_avoidance_module`
ktro2828 Apr 8, 2024
c947244
refactor: refactoring `planning/behavior_velocity_planner`
ktro2828 Apr 8, 2024
1172f0f
refactor: refactoring `system/component_system_monitor`
ktro2828 Apr 8, 2024
e61b816
refactor: refactoring `common/autoware_overlay_rviz_plugin`
ktro2828 Apr 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This plugin provides a visual and easy-to-understand display of vehicle speed, t
| `/vehicle/status/steering_status` | `autoware_auto_vehicle_msgs::msg::SteeringReport` | The topic is status of steering |
| `/vehicle/status/gear_status` | `autoware_auto_vehicle_msgs::msg::GearReport` | The topic is status of gear |
| `/planning/scenario_planning/current_max_velocity` | `tier4_planning_msgs::msg::VelocityLimit` | The topic is velocity limit |
| `/perception/traffic_light_recognition/traffic_signals` | `autoware_perception_msgs::msg::TrafficSignalArray` | The topic is status of traffic light |
| `/perception/traffic_light_recognition/traffic_signals` | `autoware_perception_msgs::msg::TrafficLightArray` | The topic is status of traffic light |

## Parameter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private Q_SLOTS:
turn_signals_sub_;
rclcpp::Subscription<autoware_auto_vehicle_msgs::msg::HazardLightsReport>::SharedPtr
hazard_lights_sub_;
rclcpp::Subscription<autoware_perception_msgs::msg::TrafficSignalArray>::SharedPtr traffic_sub_;
rclcpp::Subscription<autoware_perception_msgs::msg::TrafficLightArray>::SharedPtr traffic_sub_;
rclcpp::Subscription<tier4_planning_msgs::msg::VelocityLimit>::SharedPtr speed_limit_sub_;

std::mutex property_mutex_;
Expand All @@ -117,7 +117,7 @@ private Q_SLOTS:
const autoware_auto_vehicle_msgs::msg::HazardLightsReport::ConstSharedPtr & msg);
void updateSpeedLimitData(const tier4_planning_msgs::msg::VelocityLimit::ConstSharedPtr msg);
void updateTrafficLightData(
const autoware_perception_msgs::msg::TrafficSignalArray::ConstSharedPtr msg);
const autoware_perception_msgs::msg::TrafficLightArray::ConstSharedPtr msg);
void drawWidget(QImage & hud);
};
} // namespace autoware_overlay_rviz_plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
#include <rviz_common/properties/int_property.hpp>
#include <rviz_common/ros_topic_display.hpp>

#include <autoware_perception_msgs/msg/traffic_signal.hpp>
#include <autoware_perception_msgs/msg/traffic_signal_array.hpp>
#include <autoware_perception_msgs/msg/traffic_signal_element.hpp>
#include <autoware_perception_msgs/msg/traffic_light.hpp>
#include <autoware_perception_msgs/msg/traffic_light_array.hpp>
#include <autoware_perception_msgs/msg/traffic_light_element.hpp>

#include <OgreColourValue.h>
#include <OgreMaterial.h>
Expand All @@ -40,8 +40,8 @@ class TrafficDisplay
TrafficDisplay();
void drawTrafficLightIndicator(QPainter & painter, const QRectF & backgroundRect);
void updateTrafficLightData(
const autoware_perception_msgs::msg::TrafficSignalArray::ConstSharedPtr & msg);
autoware_perception_msgs::msg::TrafficSignalArray current_traffic_;
const autoware_perception_msgs::msg::TrafficLightArray::ConstSharedPtr & msg);
autoware_perception_msgs::msg::TrafficLightArray current_traffic_;

private:
QImage traffic_light_image_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void SignalDisplay::onInitialize()

traffic_topic_property_ = std::make_unique<rviz_common::properties::RosTopicProperty>(
"Traffic Topic", "/perception/traffic_light_recognition/traffic_signals",
"autoware_perception/msgs/msg/TrafficSignalArray", "Topic for Traffic Light Data", this,
"autoware_perception/msgs/msg/TrafficLightArray", "Topic for Traffic Light Data", this,
SLOT(topic_updated_traffic()));
traffic_topic_property_->initialize(rviz_ros_node);
}
Expand Down Expand Up @@ -159,10 +159,10 @@ void SignalDisplay::setupRosSubscriptions()
updateHazardLightsData(msg);
});

traffic_sub_ = rviz_node_->create_subscription<autoware_perception_msgs::msg::TrafficSignalArray>(
traffic_sub_ = rviz_node_->create_subscription<autoware_perception_msgs::msg::TrafficLightArray>(
traffic_topic_property_->getTopicStd(),
rclcpp::QoS(rclcpp::KeepLast(10)).durability_volatile().reliable(),
[this](const autoware_perception_msgs::msg::TrafficSignalArray::SharedPtr msg) {
[this](const autoware_perception_msgs::msg::TrafficLightArray::SharedPtr msg) {
updateTrafficLightData(msg);
});

Expand Down Expand Up @@ -237,7 +237,7 @@ void SignalDisplay::onDisable()
}

void SignalDisplay::updateTrafficLightData(
const autoware_perception_msgs::msg::TrafficSignalArray::ConstSharedPtr msg)
const autoware_perception_msgs::msg::TrafficLightArray::ConstSharedPtr msg)
{
std::lock_guard<std::mutex> lock(property_mutex_);

Expand Down Expand Up @@ -506,14 +506,13 @@ void SignalDisplay::topic_updated_traffic()
// resubscribe to the topic
traffic_sub_.reset();
auto rviz_ros_node = context_->getRosNodeAbstraction().lock();
traffic_sub_ =
rviz_ros_node->get_raw_node()
->create_subscription<autoware_perception_msgs::msg::TrafficSignalArray>(
traffic_topic_property_->getTopicStd(),
rclcpp::QoS(rclcpp::KeepLast(10)).durability_volatile().reliable(),
[this](const autoware_perception_msgs::msg::TrafficSignalArray::SharedPtr msg) {
updateTrafficLightData(msg);
});
traffic_sub_ = rviz_ros_node->get_raw_node()
->create_subscription<autoware_perception_msgs::msg::TrafficLightArray>(
traffic_topic_property_->getTopicStd(),
rclcpp::QoS(rclcpp::KeepLast(10)).durability_volatile().reliable(),
[this](const autoware_perception_msgs::msg::TrafficLightArray::SharedPtr msg) {
updateTrafficLightData(msg);
});
}

} // namespace autoware_overlay_rviz_plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ TrafficDisplay::TrafficDisplay()
}

void TrafficDisplay::updateTrafficLightData(
const autoware_perception_msgs::msg::TrafficSignalArray::ConstSharedPtr & msg)
const autoware_perception_msgs::msg::TrafficLightArray::ConstSharedPtr & msg)
{
current_traffic_ = *msg;
}
Expand Down
6 changes: 3 additions & 3 deletions common/tier4_traffic_light_rviz_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ This plugin panel publishes dummy traffic light signals.

### Output

| Name | Type | Description |
| ------------------------------------------------------- | --------------------------------------------------- | ----------------------------- |
| `/perception/traffic_light_recognition/traffic_signals` | `autoware_perception_msgs::msg::TrafficSignalArray` | Publish traffic light signals |
| Name | Type | Description |
| ------------------------------------------------------- | -------------------------------------------------- | ----------------------------- |
| `/perception/traffic_light_recognition/traffic_signals` | `autoware_perception_msgs::msg::TrafficLightArray` | Publish traffic light signals |

## HowToUse

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,50 +139,50 @@ void TrafficLightPublishPanel::onSetTrafficLightState()
const auto shape = light_shape_combo_->currentText();
const auto status = light_status_combo_->currentText();

TrafficSignalElement traffic_light;
TrafficLightElement traffic_light;
traffic_light.confidence = traffic_light_confidence_input_->value();

if (color == "RED") {
traffic_light.color = TrafficSignalElement::RED;
traffic_light.color = TrafficLightElement::RED;
} else if (color == "AMBER") {
traffic_light.color = TrafficSignalElement::AMBER;
traffic_light.color = TrafficLightElement::AMBER;
} else if (color == "GREEN") {
traffic_light.color = TrafficSignalElement::GREEN;
traffic_light.color = TrafficLightElement::GREEN;
} else if (color == "WHITE") {
traffic_light.color = TrafficSignalElement::WHITE;
traffic_light.color = TrafficLightElement::WHITE;
} else if (color == "UNKNOWN") {
traffic_light.color = TrafficSignalElement::UNKNOWN;
traffic_light.color = TrafficLightElement::UNKNOWN;
}

if (shape == "CIRCLE") {
traffic_light.shape = TrafficSignalElement::CIRCLE;
traffic_light.shape = TrafficLightElement::CIRCLE;
} else if (shape == "LEFT_ARROW") {
traffic_light.shape = TrafficSignalElement::LEFT_ARROW;
traffic_light.shape = TrafficLightElement::LEFT_ARROW;
} else if (shape == "RIGHT_ARROW") {
traffic_light.shape = TrafficSignalElement::RIGHT_ARROW;
traffic_light.shape = TrafficLightElement::RIGHT_ARROW;
} else if (shape == "UP_ARROW") {
traffic_light.shape = TrafficSignalElement::UP_ARROW;
traffic_light.shape = TrafficLightElement::UP_ARROW;
} else if (shape == "DOWN_ARROW") {
traffic_light.shape = TrafficSignalElement::DOWN_ARROW;
traffic_light.shape = TrafficLightElement::DOWN_ARROW;
} else if (shape == "DOWN_LEFT_ARROW") {
traffic_light.shape = TrafficSignalElement::DOWN_LEFT_ARROW;
traffic_light.shape = TrafficLightElement::DOWN_LEFT_ARROW;
} else if (shape == "DOWN_RIGHT_ARROW") {
traffic_light.shape = TrafficSignalElement::DOWN_RIGHT_ARROW;
traffic_light.shape = TrafficLightElement::DOWN_RIGHT_ARROW;
} else if (shape == "UNKNOWN") {
traffic_light.shape = TrafficSignalElement::UNKNOWN;
traffic_light.shape = TrafficLightElement::UNKNOWN;
}

if (status == "SOLID_OFF") {
traffic_light.status = TrafficSignalElement::SOLID_OFF;
traffic_light.status = TrafficLightElement::SOLID_OFF;
} else if (status == "SOLID_ON") {
traffic_light.status = TrafficSignalElement::SOLID_ON;
traffic_light.status = TrafficLightElement::SOLID_ON;
} else if (status == "FLASHING") {
traffic_light.status = TrafficSignalElement::FLASHING;
traffic_light.status = TrafficLightElement::FLASHING;
} else if (status == "UNKNOWN") {
traffic_light.status = TrafficSignalElement::UNKNOWN;
traffic_light.status = TrafficLightElement::UNKNOWN;
}

TrafficSignal traffic_signal;
TrafficLight traffic_signal;
traffic_signal.elements.push_back(traffic_light);
traffic_signal.traffic_signal_id = traffic_light_id;

Expand Down Expand Up @@ -218,7 +218,7 @@ void TrafficLightPublishPanel::onInitialize()
using std::placeholders::_1;
raw_node_ = this->getDisplayContext()->getRosNodeAbstraction().lock()->get_raw_node();

pub_traffic_signals_ = raw_node_->create_publisher<TrafficSignalArray>(
pub_traffic_signals_ = raw_node_->create_publisher<TrafficLightArray>(
"/perception/traffic_light_recognition/traffic_signals", rclcpp::QoS(1));

sub_vector_map_ = raw_node_->create_subscription<HADMapBin>(
Expand Down Expand Up @@ -273,23 +273,23 @@ void TrafficLightPublishPanel::onTimer()

const auto & light = signal.elements.front();
switch (light.color) {
case TrafficSignalElement::RED:
case TrafficLightElement::RED:
color_label->setText("RED");
color_label->setStyleSheet("background-color: #FF0000;");
break;
case TrafficSignalElement::AMBER:
case TrafficLightElement::AMBER:
color_label->setText("AMBER");
color_label->setStyleSheet("background-color: #FFBF00;");
break;
case TrafficSignalElement::GREEN:
case TrafficLightElement::GREEN:
color_label->setText("GREEN");
color_label->setStyleSheet("background-color: #7CFC00;");
break;
case TrafficSignalElement::WHITE:
case TrafficLightElement::WHITE:
color_label->setText("WHITE");
color_label->setStyleSheet("background-color: #FFFFFF;");
break;
case TrafficSignalElement::UNKNOWN:
case TrafficLightElement::UNKNOWN:
color_label->setText("UNKNOWN");
color_label->setStyleSheet("background-color: #808080;");
break;
Expand All @@ -301,28 +301,28 @@ void TrafficLightPublishPanel::onTimer()
shape_label->setAlignment(Qt::AlignCenter);

switch (light.shape) {
case TrafficSignalElement::CIRCLE:
case TrafficLightElement::CIRCLE:
shape_label->setText("CIRCLE");
break;
case TrafficSignalElement::LEFT_ARROW:
case TrafficLightElement::LEFT_ARROW:
shape_label->setText("LEFT_ARROW");
break;
case TrafficSignalElement::RIGHT_ARROW:
case TrafficLightElement::RIGHT_ARROW:
shape_label->setText("RIGHT_ARROW");
break;
case TrafficSignalElement::UP_ARROW:
case TrafficLightElement::UP_ARROW:
shape_label->setText("UP_ARROW");
break;
case TrafficSignalElement::DOWN_ARROW:
case TrafficLightElement::DOWN_ARROW:
shape_label->setText("DOWN_ARROW");
break;
case TrafficSignalElement::DOWN_LEFT_ARROW:
case TrafficLightElement::DOWN_LEFT_ARROW:
shape_label->setText("DOWN_LEFT_ARROW");
break;
case TrafficSignalElement::DOWN_RIGHT_ARROW:
case TrafficLightElement::DOWN_RIGHT_ARROW:
shape_label->setText("DOWN_RIGHT_ARROW");
break;
case TrafficSignalElement::UNKNOWN:
case TrafficLightElement::UNKNOWN:
shape_label->setText("UNKNOWN");
break;
default:
Expand All @@ -333,16 +333,16 @@ void TrafficLightPublishPanel::onTimer()
status_label->setAlignment(Qt::AlignCenter);

switch (light.status) {
case TrafficSignalElement::SOLID_OFF:
case TrafficLightElement::SOLID_OFF:
status_label->setText("SOLID_OFF");
break;
case TrafficSignalElement::SOLID_ON:
case TrafficLightElement::SOLID_ON:
status_label->setText("SOLID_ON");
break;
case TrafficSignalElement::FLASHING:
case TrafficLightElement::FLASHING:
status_label->setText("FLASHING");
break;
case TrafficSignalElement::UNKNOWN:
case TrafficLightElement::UNKNOWN:
status_label->setText("UNKNOWN");
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <rviz_common/panel.hpp>

#include <autoware_auto_mapping_msgs/msg/had_map_bin.hpp>
#include <autoware_perception_msgs/msg/traffic_signal_array.hpp>
#include <autoware_perception_msgs/msg/traffic_light_array.hpp>
#endif

#include <set>
Expand All @@ -36,9 +36,9 @@ namespace rviz_plugins
{

using autoware_auto_mapping_msgs::msg::HADMapBin;
using autoware_perception_msgs::msg::TrafficSignal;
using autoware_perception_msgs::msg::TrafficSignalArray;
using autoware_perception_msgs::msg::TrafficSignalElement;
using autoware_perception_msgs::msg::TrafficLight;
using autoware_perception_msgs::msg::TrafficLightArray;
using autoware_perception_msgs::msg::TrafficLightElement;
class TrafficLightPublishPanel : public rviz_common::Panel
{
Q_OBJECT
Expand All @@ -60,7 +60,7 @@ public Q_SLOTS:

rclcpp::Node::SharedPtr raw_node_;
rclcpp::TimerBase::SharedPtr pub_timer_;
rclcpp::Publisher<TrafficSignalArray>::SharedPtr pub_traffic_signals_;
rclcpp::Publisher<TrafficLightArray>::SharedPtr pub_traffic_signals_;
rclcpp::Subscription<HADMapBin>::SharedPtr sub_vector_map_;

QSpinBox * publishing_rate_input_;
Expand All @@ -74,7 +74,7 @@ public Q_SLOTS:
QPushButton * publish_button_;
QTableWidget * traffic_table_;

TrafficSignalArray extra_traffic_signals_;
TrafficLightArray extra_traffic_signals_;

bool enable_publish_{false};
std::set<int> traffic_light_ids_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#ifndef TRAFFIC_LIGHT_UTILS__TRAFFIC_LIGHT_UTILS_HPP_
#define TRAFFIC_LIGHT_UTILS__TRAFFIC_LIGHT_UTILS_HPP_

#include "autoware_perception_msgs/msg/traffic_signal.hpp"
#include "autoware_perception_msgs/msg/traffic_signal_element.hpp"
#include "autoware_perception_msgs/msg/traffic_light.hpp"
#include "autoware_perception_msgs/msg/traffic_light_element.hpp"
#include "tier4_perception_msgs/msg/traffic_light.hpp"
#include "tier4_perception_msgs/msg/traffic_light_element.hpp"
#include "tier4_perception_msgs/msg/traffic_light_roi.hpp"
Expand Down Expand Up @@ -50,7 +50,7 @@ void setSignalUnknown(tier4_perception_msgs::msg::TrafficLight & signal, float c
* @return True if a circle-shaped light with the specified color is found, false otherwise.
*/
bool hasTrafficLightCircleColor(
const autoware_perception_msgs::msg::TrafficSignal & tl_state, const uint8_t & lamp_color);
const autoware_perception_msgs::msg::TrafficLight & tl_state, const uint8_t & lamp_color);

/**
* @brief Checks if a traffic light state includes a light with the specified shape.
Expand All @@ -62,7 +62,7 @@ bool hasTrafficLightCircleColor(
* @return True if a light with the specified shape is found, false otherwise.
*/
bool hasTrafficLightShape(
const autoware_perception_msgs::msg::TrafficSignal & tl_state, const uint8_t & lamp_shape);
const autoware_perception_msgs::msg::TrafficLight & tl_state, const uint8_t & lamp_shape);

/**
* @brief Determines if a traffic signal indicates a stop for the given lanelet.
Expand All @@ -78,7 +78,7 @@ bool hasTrafficLightShape(
*/
bool isTrafficSignalStop(
const lanelet::ConstLanelet & lanelet,
const autoware_perception_msgs::msg::TrafficSignal & tl_state);
const autoware_perception_msgs::msg::TrafficLight & tl_state);

tf2::Vector3 getTrafficLightTopLeft(const lanelet::ConstLineString3d & traffic_light);

Expand Down
Loading
Loading