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

[tmp] Remove non-API member functions: EntityManager’s TrafficLight related member functions #1329

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1c7685e
Add TrafficLightSupervisor and move traffic lights to API
TauTheLepton Jun 11, 2024
060744a
Merge branch 'RJD-1057-base' into RJD-1057-remove-traffic-lights-from…
TauTheLepton Jun 19, 2024
6b2b7fb
feat(traffic_lights): develop TrafficLightsBase and TrafficLights
dmoszynski Jun 19, 2024
f69d7ca
feat(traffic_light_manager): use TrafficLightsBase and TrafficLights …
dmoszynski Jun 19, 2024
4af5eec
ref(traffic_simulator/traffic_lights): refactor all classes insead of…
dmoszynski Jun 20, 2024
2a260ee
feat(scenario_sensor_simulator/traffic_lights_detector): remove depen…
dmoszynski Jun 20, 2024
ef3818f
feat(traffic_lights): develop cast for autoware msgs
dmoszynski Jun 20, 2024
2ac527f
feat(traffic_lights): develop individual traffic_lights_publisher for…
dmoszynski Jun 20, 2024
980781b
feat(traffic_lights): improve traffic_lights_publisher in traffic_sim…
dmoszynski Jun 20, 2024
e74b364
feat(traffic_lights): add converions for autoware_auto_perception_msgs
dmoszynski Jun 20, 2024
87bcb80
ref(traffic_lights): rename rest of TrafficLight**->TrafficLights**
dmoszynski Jun 20, 2024
2ed3d2a
Remove compile error - reorder
TauTheLepton Jun 21, 2024
95a1b7a
Remove unused variables
TauTheLepton Jun 21, 2024
b0aca76
feat(traffic_lights): use conversions instead operator() overlaod, re…
dmoszynski Jun 21, 2024
46e3427
Merge branch 'RJD-1057-remove-traffic-lights-from-entity-manager' of …
dmoszynski Jun 21, 2024
fe5cd70
ref(conversions): remove comments
dmoszynski Jun 21, 2024
149d0a8
feat(traffic_lights): last code improvements
dmoszynski Jun 21, 2024
1fe2648
Add conventional traffic lights tests
TauTheLepton Jun 21, 2024
30b5bd2
Add message timing verification in tests
TauTheLepton Jun 24, 2024
852a5eb
Add ROS message generation tests for TrafficLights
TauTheLepton Jun 24, 2024
36dd3f0
Add publishing tests for V2I traffic lights
TauTheLepton Jun 25, 2024
4408e7c
Use typed tests in traffic lights
TauTheLepton Jun 25, 2024
5e0ef5f
Simplify traffic lights tests
TauTheLepton Jun 26, 2024
ca83e19
Resolve problems with resources not released
TauTheLepton Jun 26, 2024
3591b86
Rename traffic lights test file
TauTheLepton Jun 26, 2024
6c47410
Add explicit destructors for traffic lights
TauTheLepton Jun 26, 2024
5b28b6c
Rename internal traffic lights tests
TauTheLepton Jun 26, 2024
44b458d
Rename internal traffic lights tests file
TauTheLepton Jun 26, 2024
e8ef0c0
Add TrafficLights tests + clean up other tests and verify frequency
TauTheLepton Jun 26, 2024
371534d
Remove exception throwing when starting a timer again in configurable…
TauTheLepton Jun 27, 2024
d3113e2
Merge branch 'RJD-1057-base' into RJD-1057-remove-traffic-lights-from…
TauTheLepton Jun 27, 2024
b5998a5
Merge branch 'RJD-1057-base' into RJD-1057-remove-traffic-lights-from…
TauTheLepton Jul 2, 2024
bc2584a
Merge remote-tracking branch 'tier4/RJD-1057-remove-traffic-lights-fr…
TauTheLepton Jul 2, 2024
c214760
Merge branch 'RJD-1057-base' into RJD-1057-remove-traffic-lights-from…
TauTheLepton Jul 24, 2024
433019c
Remove traffic lights tests
TauTheLepton Jul 25, 2024
b39433a
Revert "ref(traffic_lights): rename rest of TrafficLight**->TrafficLi…
TauTheLepton Jul 29, 2024
a06f4b4
Rename traffic light classes to match filenames
TauTheLepton Jul 29, 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
3 changes: 2 additions & 1 deletion mock/cpp_mock_scenarios/src/traffic_simulation_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ class TrafficSimulationDemoScenario : public cpp_mock_scenarios::CppScenarioNode
"obstacle", "ego", traffic_simulator::helper::constructPose(10, 5, 0, 0, 0, -1.57),
traffic_simulator::helper::constructActionStatus());

api_.getConventionalTrafficLight(34802).emplace(traffic_simulator::TrafficLight::Color::green);
api_.getConventionalTrafficLights()->setTrafficLightsColor(
34802, traffic_simulator::TrafficLight::Color::green);
}

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,40 +583,57 @@ class SimulatorCore
}

template <typename... Ts>
static auto getConventionalTrafficLights(Ts &&... xs) -> decltype(auto)
static auto sendCooperateCommand(Ts &&... xs) -> decltype(auto)
{
return core->getConventionalTrafficLights(std::forward<decltype(xs)>(xs)...);
return asFieldOperatorApplication(core->getEgoName())
.sendCooperateCommand(std::forward<decltype(xs)>(xs)...);
}

// TrafficLights - Conventional and V2I
template <typename... Ts>
static auto getV2ITrafficLights(Ts &&... xs) -> decltype(auto)
static auto setConventionalTrafficLightsState(Ts &&... xs) -> decltype(auto)
{
return core->getV2ITrafficLights(std::forward<decltype(xs)>(xs)...);
return core->getConventionalTrafficLights()->setTrafficLightsState(
std::forward<decltype(xs)>(xs)...);
}

template <typename... Ts>
static auto resetConventionalTrafficLightPublishRate(Ts &&... xs) -> decltype(auto)
static auto setConventionalTrafficLightConfidence(Ts &&... xs) -> decltype(auto)
{
return core->resetConventionalTrafficLightPublishRate(std::forward<decltype(xs)>(xs)...);
return core->getConventionalTrafficLights()->setTrafficLightsConfidence(
std::forward<decltype(xs)>(xs)...);
}

template <typename... Ts>
static auto resetV2ITrafficLightPublishRate(Ts &&... xs) -> decltype(auto)
static auto getConventionalTrafficLightsComposedState(Ts &&... xs) -> decltype(auto)
{
return core->resetV2ITrafficLightPublishRate(std::forward<decltype(xs)>(xs)...);
return core->getConventionalTrafficLights()->getTrafficLightsComposedState(
std::forward<decltype(xs)>(xs)...);
}

template <typename... Ts>
static auto sendCooperateCommand(Ts &&... xs) -> decltype(auto)
static auto compareConventionalTrafficLightsState(Ts &&... xs) -> decltype(auto)
{
return asFieldOperatorApplication(core->getEgoName())
.sendCooperateCommand(std::forward<decltype(xs)>(xs)...);
return core->getConventionalTrafficLights()->compareTrafficLightsState(
std::forward<decltype(xs)>(xs)...);
}

template <typename... Ts>
static auto setConventionalTrafficLightConfidence(Ts &&... xs) -> decltype(auto)
static auto resetConventionalTrafficLightPublishRate(Ts &&... xs) -> decltype(auto)
{
return core->getConventionalTrafficLights()->resetUpdate(std::forward<decltype(xs)>(xs)...);
}

template <typename... Ts>
static auto setV2ITrafficLightsState(Ts &&... xs) -> decltype(auto)
{
return core->getV2ITrafficLights()->setTrafficLightsState(std::forward<decltype(xs)>(xs)...);
}

template <typename... Ts>
static auto resetV2ITrafficLightPublishRate(Ts &&... xs) -> decltype(auto)
{
return core->setConventionalTrafficLightConfidence(std::forward<decltype(xs)>(xs)...);
return core->getV2ITrafficLights()->resetUpdate(std::forward<decltype(xs)>(xs)...);
}
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,8 @@ struct ApplyV2ITrafficSignalStateAction : public CustomCommand,
[[fallthrough]];

case 2:
for (auto & traffic_light :
getV2ITrafficLights(boost::lexical_cast<std::int64_t>(parameters[0]))) {
traffic_light.get().clear();
traffic_light.get().set(unquote(parameters.at(1)));
}
setV2ITrafficLightsState(
boost::lexical_cast<std::int64_t>(parameters[0]), unquote(parameters.at(1)));
break;

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,12 @@ auto TrafficSignalCondition::description() const -> String

auto TrafficSignalCondition::evaluate() -> Object
{
if (auto && traffic_lights =
getConventionalTrafficLights(boost::lexical_cast<std::int64_t>(name));
state == "none") {
const auto lanelet_id = boost::lexical_cast<std::int64_t>(name);
current_state = getConventionalTrafficLightsComposedState(lanelet_id);
if (current_state.empty()) {
current_state = "none";
return asBoolean(std::all_of(
std::begin(traffic_lights), std::end(traffic_lights),
[](const traffic_simulator::TrafficLight & traffic_light) { return traffic_light.empty(); }));
} else {
std::stringstream ss;
std::string separator = "";
for (traffic_simulator::TrafficLight & traffic_light : traffic_lights) {
ss << separator << traffic_light;
separator = "; ";
}
current_state = ss.str();

return asBoolean(std::all_of(
std::begin(traffic_lights), std::end(traffic_lights),
[this](const traffic_simulator::TrafficLight & traffic_light) {
return traffic_light.contains(state);
}));
}
return asBoolean(compareConventionalTrafficLightsState(lanelet_id, state));
}
} // namespace syntax
} // namespace openscenario_interpreter
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ TrafficSignalState::TrafficSignalState(const pugi::xml_node & node, Scope & scop

auto TrafficSignalState::evaluate() const -> Object
{
for (traffic_simulator::TrafficLight & traffic_light : getConventionalTrafficLights(id())) {
traffic_light.clear();
traffic_light.set(state);
};

setConventionalTrafficLightsState(id(), state);
return unspecified;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ auto TrafficSignalStateAction::run() noexcept -> void {}

auto TrafficSignalStateAction::start() const -> void
{
for (traffic_simulator::TrafficLight & traffic_light : getConventionalTrafficLights(id())) {
traffic_light.clear();
traffic_light.set(state);
};
setConventionalTrafficLightsState(id(), state);
}

auto TrafficSignalStateAction::id() const -> std::int64_t
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <traffic_simulator/entity/entity_base.hpp>
#include <traffic_simulator/hdmap_utils/hdmap_utils.hpp>
#include <traffic_simulator/helper/stop_watch.hpp>
#include <traffic_simulator/traffic_lights/traffic_light_manager.hpp>
#include <traffic_simulator/traffic_lights/traffic_lights.hpp>
#include <traffic_simulator/utils/pose.hpp>
#include <traffic_simulator_msgs/msg/obstacle.hpp>
#include <traffic_simulator_msgs/msg/waypoints_array.hpp>
Expand Down Expand Up @@ -86,7 +86,7 @@ class ActionNode : public BT::ActionNodeBase
BT::InputPort<std::optional<double>>("target_speed"),
BT::InputPort<std::shared_ptr<hdmap_utils::HdMapUtils>>("hdmap_utils"),
BT::InputPort<std::shared_ptr<traffic_simulator::CanonicalizedEntityStatus>>("entity_status"),
BT::InputPort<std::shared_ptr<traffic_simulator::TrafficLightManager>>("traffic_light_manager"),
BT::InputPort<std::shared_ptr<traffic_simulator::TrafficLightsBase>>("traffic_lights"),
BT::InputPort<traffic_simulator::behavior::Request>("request"),
BT::OutputPort<std::optional<traffic_simulator_msgs::msg::Obstacle>>("obstacle"),
BT::OutputPort<std::shared_ptr<traffic_simulator::EntityStatus>>("non_canonicalized_updated_status"),
Expand All @@ -113,7 +113,7 @@ class ActionNode : public BT::ActionNodeBase
protected:
traffic_simulator::behavior::Request request;
std::shared_ptr<hdmap_utils::HdMapUtils> hdmap_utils;
std::shared_ptr<traffic_simulator::TrafficLightManager> traffic_light_manager;
std::shared_ptr<traffic_simulator::TrafficLightsBase> traffic_lights;
std::shared_ptr<traffic_simulator::CanonicalizedEntityStatus> entity_status;
double current_time;
double step_time;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class PedestrianBehaviorTree : public BehaviorPluginBase
DEFINE_GETTER_SETTER(RouteLanelets, lanelet::Ids)
DEFINE_GETTER_SETTER(StepTime, double)
DEFINE_GETTER_SETTER(TargetSpeed, std::optional<double>)
DEFINE_GETTER_SETTER(TrafficLightManager, std::shared_ptr<traffic_simulator::TrafficLightManager>)
DEFINE_GETTER_SETTER(TrafficLights, std::shared_ptr<traffic_simulator::TrafficLightsBase>)
DEFINE_GETTER_SETTER(UpdatedStatus, std::shared_ptr<traffic_simulator::EntityStatus>)
DEFINE_GETTER_SETTER(VehicleParameters, traffic_simulator_msgs::msg::VehicleParameters)
DEFINE_GETTER_SETTER(Waypoints, traffic_simulator_msgs::msg::WaypointsArray)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class VehicleBehaviorTree : public BehaviorPluginBase
DEFINE_GETTER_SETTER(RouteLanelets, lanelet::Ids)
DEFINE_GETTER_SETTER(StepTime, double)
DEFINE_GETTER_SETTER(TargetSpeed, std::optional<double>)
DEFINE_GETTER_SETTER(TrafficLightManager, std::shared_ptr<traffic_simulator::TrafficLightManager>)
DEFINE_GETTER_SETTER(TrafficLights, std::shared_ptr<traffic_simulator::TrafficLightsBase>)
DEFINE_GETTER_SETTER(UpdatedStatus, std::shared_ptr<traffic_simulator::EntityStatus>)
DEFINE_GETTER_SETTER(VehicleParameters, traffic_simulator_msgs::msg::VehicleParameters)
DEFINE_GETTER_SETTER(Waypoints, traffic_simulator_msgs::msg::WaypointsArray)
Expand Down
39 changes: 17 additions & 22 deletions simulation/behavior_tree_plugin/src/action_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ auto ActionNode::getBlackBoardValues() -> void
if (!getInput<std::shared_ptr<hdmap_utils::HdMapUtils>>("hdmap_utils", hdmap_utils)) {
THROW_SIMULATION_ERROR("failed to get input hdmap_utils in ActionNode");
}
if (!getInput<std::shared_ptr<traffic_simulator::TrafficLightManager>>(
"traffic_light_manager", traffic_light_manager)) {
THROW_SIMULATION_ERROR("failed to get input traffic_light_manager in ActionNode");
if (!getInput<std::shared_ptr<traffic_simulator::TrafficLightsBase>>(
"traffic_lights", traffic_lights)) {
THROW_SIMULATION_ERROR("failed to get input traffic_lights in ActionNode");
}
if (!getInput<std::shared_ptr<traffic_simulator::CanonicalizedEntityStatus>>(
"entity_status", entity_status)) {
Expand Down Expand Up @@ -191,28 +191,23 @@ auto ActionNode::getDistanceToTrafficLightStopLine(
const lanelet::Ids & route_lanelets,
const math::geometry::CatmullRomSplineInterface & spline) const -> std::optional<double>
{
const auto traffic_light_ids = hdmap_utils->getTrafficLightIdsOnPath(route_lanelets);
if (traffic_light_ids.empty()) {
return std::nullopt;
}
std::set<double> collision_points = {};
for (const auto id : traffic_light_ids) {
using Color = traffic_simulator::TrafficLight::Color;
using Status = traffic_simulator::TrafficLight::Status;
using Shape = traffic_simulator::TrafficLight::Shape;
if (auto && traffic_light = traffic_light_manager->getTrafficLight(id);
traffic_light.contains(Color::red, Status::solid_on, Shape::circle) or
traffic_light.contains(Color::yellow, Status::solid_on, Shape::circle)) {
const auto collision_point = hdmap_utils->getDistanceToTrafficLightStopLine(spline, id);
if (collision_point) {
collision_points.insert(collision_point.value());
if (const auto traffic_light_ids = hdmap_utils->getTrafficLightIdsOnPath(route_lanelets);
!traffic_light_ids.empty()) {
std::set<double> collision_points = {};
for (const auto traffic_light_id : traffic_light_ids) {
if (traffic_lights->isRequiredStopTrafficLightState(traffic_light_id)) {
if (
const auto collision_point =
hdmap_utils->getDistanceToTrafficLightStopLine(spline, traffic_light_id)) {
collision_points.insert(collision_point.value());
}
}
}
if (!collision_points.empty()) {
return *collision_points.begin();
}
}
if (collision_points.empty()) {
return std::nullopt;
}
return *collision_points.begin();
return std::nullopt;
}

auto ActionNode::getDistanceToStopLine(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public: \
DEFINE_GETTER_SETTER(ReferenceTrajectory, std::shared_ptr<math::geometry::CatmullRomSpline>)
DEFINE_GETTER_SETTER(RouteLanelets, lanelet::Ids)
DEFINE_GETTER_SETTER(TargetSpeed, std::optional<double>)
DEFINE_GETTER_SETTER(TrafficLightManager, std::shared_ptr<traffic_simulator::TrafficLightManager>)
DEFINE_GETTER_SETTER(TrafficLights, std::shared_ptr<traffic_simulator::TrafficLightsBase>)
DEFINE_GETTER_SETTER(VehicleParameters, traffic_simulator_msgs::msg::VehicleParameters)
DEFINE_GETTER_SETTER(Waypoints, traffic_simulator_msgs::msg::WaypointsArray)
// clang-format on
Expand Down
2 changes: 2 additions & 0 deletions simulation/do_nothing_plugin/src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include <geometry/quaternion/slerp.hpp>
#include <geometry/vector3/hypot.hpp>
#include <geometry/vector3/operator.hpp>
#include <geometry_msgs/msg/accel.hpp>
#include <geometry_msgs/msg/twist.hpp>

namespace entity_behavior
{
Expand Down
6 changes: 4 additions & 2 deletions simulation/simple_sensor_simulator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ ament_auto_add_library(simple_sensor_simulator_component SHARED
src/sensor_simulation/detection_sensor/detection_sensor.cpp
src/sensor_simulation/lidar/lidar_sensor.cpp
src/sensor_simulation/lidar/raycaster.cpp
src/sensor_simulation/occupancy_grid/occupancy_grid_sensor.cpp
src/sensor_simulation/occupancy_grid/occupancy_grid_builder.cpp
src/sensor_simulation/occupancy_grid/grid_traversal.cpp
src/sensor_simulation/occupancy_grid/occupancy_grid_builder.cpp
src/sensor_simulation/occupancy_grid/occupancy_grid_sensor.cpp
src/sensor_simulation/primitives/box.cpp
src/sensor_simulation/primitives/primitive.cpp
src/sensor_simulation/primitives/primitive.cpp
src/sensor_simulation/sensor_simulation.cpp
src/sensor_simulation/traffic_lights/traffic_lights_publisher.cpp
src/simple_sensor_simulator.cpp
src/vehicle_simulation/ego_entity_simulation.cpp
src/vehicle_simulation/vehicle_model/sim_model_delay_steer_acc.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,10 @@ class SensorSimulation
auto attachPseudoTrafficLightsDetector(
const double /*current_simulation_time*/,
const simulation_api_schema::PseudoTrafficLightDetectorConfiguration & configuration,
rclcpp::Node & node, std::shared_ptr<hdmap_utils::HdMapUtils> hdmap_utils) -> void
rclcpp::Node & node) -> void
{
if (configuration.architecture_type() == "awf/universe") {
using Message = autoware_auto_perception_msgs::msg::TrafficSignalArray;
traffic_lights_detectors_.push_back(std::make_unique<traffic_lights::TrafficLightsDetector>(
std::make_shared<traffic_simulator::TrafficLightPublisher<Message>>(
"/perception/traffic_light_recognition/traffic_signals", &node, hdmap_utils)));
} else if (configuration.architecture_type() >= "awf/universe/20230906") {
using Message = autoware_perception_msgs::msg::TrafficSignalArray;
traffic_lights_detectors_.push_back(std::make_unique<traffic_lights::TrafficLightsDetector>(
std::make_shared<traffic_simulator::TrafficLightPublisher<Message>>(
"/perception/traffic_light_recognition/internal/traffic_signals", &node, hdmap_utils)));
} else {
std::stringstream ss;
ss << "Unexpected architecture_type " << std::quoted(configuration.architecture_type())
<< " given.";
throw std::runtime_error(ss.str());
}
traffic_lights_detectors_.push_back(std::make_unique<traffic_lights::TrafficLightsDetector>(
node, configuration.architecture_type()));
}

auto updateSensorFrame(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 TIER IV, Inc. All rights reserved.
// Copyright 2024 TIER IV, Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -16,10 +16,9 @@
#define SIMPLE_SENSOR_SIMULATOR__SENSOR_SIMULATION__TRAFFIC_LIGHTS__TRAFFIC_LIGHTS_DETECTOR_HPP_

#include <rclcpp/rclcpp.hpp>
#include <simple_sensor_simulator/sensor_simulation/traffic_lights/traffic_lights_publisher.hpp>
#include <simulation_interface/conversions.hpp>
#include <string>
#include <traffic_simulator/hdmap_utils/hdmap_utils.hpp>
#include <traffic_simulator/traffic_lights/traffic_light_publisher.hpp>

namespace simple_sensor_simulator
{
Expand All @@ -32,21 +31,45 @@ namespace traffic_lights
*/
class TrafficLightsDetector
{
const std::shared_ptr<traffic_simulator::TrafficLightPublisherBase> publisher_;

public:
explicit TrafficLightsDetector(
const std::shared_ptr<traffic_simulator::TrafficLightPublisherBase> & publisher)
: publisher_(publisher)
template <typename NodeType>
explicit TrafficLightsDetector(NodeType & node, const std::string & architecture_type)
: publisher_ptr_(makePublisher(node, architecture_type))
{
}

auto updateFrame(
const rclcpp::Time & current_ros_time,
const simulation_api_schema::UpdateTrafficLightsRequest & request) -> void
{
publisher_->publish(current_ros_time, request);
publisher_ptr_->publish(current_ros_time, request);
}

private:
template <typename NodeType>
auto makePublisher(NodeType & node, const std::string & architecture_type)
-> std::unique_ptr<TrafficLightsPublisherBase>
{
/*
V2ITrafficLights in TrafficSimulator publishes using topics "/v2x/traffic_signals" and
"/perception/traffic_light_recognition/external/traffic_signals" for all "awf/universe/..."
*/
if (architecture_type == "awf/universe") {
using Message = autoware_auto_perception_msgs::msg::TrafficSignalArray;
return std::make_unique<TrafficLightsPublisher<Message>>(
&node, "/perception/traffic_light_recognition/traffic_signals");
} else if (architecture_type >= "awf/universe/20230906") {
using Message = autoware_perception_msgs::msg::TrafficSignalArray;
return std::make_unique<TrafficLightsPublisher<Message>>(
&node, "/perception/traffic_light_recognition/internal/traffic_signals");
} else {
std::stringstream ss;
ss << "Unexpected architecture_type " << std::quoted(architecture_type) << " given.";
throw std::invalid_argument(ss.str());
}
}

const std::unique_ptr<TrafficLightsPublisherBase> publisher_ptr_;
};
} // namespace traffic_lights
} // namespace simple_sensor_simulator
Expand Down
Loading
Loading