Skip to content

Commit e3216dc

Browse files
committed
refactor(traffic_light_utils): prefix package and namespace with autoware
Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
1 parent 24652f8 commit e3216dc

File tree

19 files changed

+36
-34
lines changed

19 files changed

+36
-34
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ common/autoware_test_utils/** kyoichi.sugahara@tier4.jp mamoru.sobue@tier4.jp ta
2525
common/autoware_testing/** adam.dabrowski@robotec.ai satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
2626
common/autoware_time_utils/** christopherj.ho@gmail.com shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
2727
common/autoware_trajectory/** mamoru.sobue@tier4.jp takayuki.murooka@tier4.jp yukinari.hisaki.2@tier4.jp
28+
common/autoware_traffic_light_utils/** kotaro.uetake@tier4.jp satoshi.ota@tier4.jp shunsuke.miura@tier4.jp
2829
common/autoware_universe_utils/** mamoru.sobue@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp
2930
common/autoware_vehicle_info_utils/** mamoru.sobue@tier4.jp shumpei.wakabayashi@tier4.jp taiki.tanaka@tier4.jp tomoya.kimura@tier4.jp
3031
common/bag_time_manager_rviz_plugin/** taiki.tanaka@tier4.jp
@@ -41,7 +42,6 @@ common/tier4_system_rviz_plugin/** koji.minoda@tier4.jp
4142
common/tier4_traffic_light_rviz_plugin/** satoshi.ota@tier4.jp
4243
common/tier4_vehicle_rviz_plugin/** yukihiro.saito@tier4.jp
4344
common/traffic_light_recognition_marker_publisher/** shumpei.wakabayashi@tier4.jp takeshi.miura@tier4.jp tomoya.kimura@tier4.jp
44-
common/traffic_light_utils/** kotaro.uetake@tier4.jp satoshi.ota@tier4.jp shunsuke.miura@tier4.jp
4545
control/autoware_autonomous_emergency_braking/** daniel.sanchez@tier4.jp kyoichi.sugahara@tier4.jp mamoru.sobue@tier4.jp takamasa.horibe@tier4.jp tomoya.kimura@tier4.jp
4646
control/autoware_collision_detector/** go.sakayori@tier4.jp kyoichi.sugahara@tier4.jp tomohito.ando@tier4.jp
4747
control/autoware_control_validator/** kyoichi.sugahara@tier4.jp makoto.kurihara@tier4.jp mamoru.sobue@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp

common/.pages

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ nav:
2222
- 'Signal Processing':
2323
- 'Introduction': common/autoware_signal_processing
2424
- 'Butterworth Filter': common/autoware_signal_processing/documentation/ButterworthFilter
25+
- 'autoware_traffic_light_utils': common/autoware_traffic_light_utils
2526
- 'autoware_universe_utils': common/autoware_universe_utils
26-
- 'traffic_light_utils': common/traffic_light_utils
2727
- 'RVIZ2 Plugins':
2828
- 'autoware_perception_rviz_plugin': common/autoware_perception_rviz_plugin
2929
- 'autoware_overlay_rviz_plugin': common/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
cmake_minimum_required(VERSION 3.14)
2-
project(traffic_light_utils)
2+
project(autoware_traffic_light_utils)
33

44
find_package(autoware_cmake REQUIRED)
55
autoware_package()
66

77
find_package(Boost REQUIRED)
88
find_package(autoware_cmake REQUIRED)
99

10-
ament_auto_add_library(traffic_light_utils SHARED
10+
ament_auto_add_library(${PROJECT_NAME} SHARED
1111
src/traffic_light_utils.cpp
1212
)
1313

@@ -16,7 +16,7 @@ if(BUILD_TESTING)
1616
file(GLOB_RECURSE TEST_SOURCES test/*.cpp)
1717
ament_add_ros_isolated_gtest(test_traffic_light_utils ${TEST_SOURCES})
1818
target_include_directories(test_traffic_light_utils PRIVATE src/include)
19-
target_link_libraries(test_traffic_light_utils traffic_light_utils)
19+
target_link_libraries(test_traffic_light_utils ${PROJECT_NAME})
2020
endif()
2121

2222
ament_auto_package()

common/traffic_light_utils/README.md common/autoware_traffic_light_utils/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# traffic_light_utils
1+
# autoware_traffic_light_utils
22

33
## Purpose
44

common/traffic_light_utils/include/traffic_light_utils/traffic_light_utils.hpp common/autoware_traffic_light_utils/include/autoware/traffic_light_utils/traffic_light_utils.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef TRAFFIC_LIGHT_UTILS__TRAFFIC_LIGHT_UTILS_HPP_
16-
#define TRAFFIC_LIGHT_UTILS__TRAFFIC_LIGHT_UTILS_HPP_
15+
#ifndef AUTOWARE__TRAFFIC_LIGHT_UTILS__TRAFFIC_LIGHT_UTILS_HPP_
16+
#define AUTOWARE__TRAFFIC_LIGHT_UTILS__TRAFFIC_LIGHT_UTILS_HPP_
1717

1818
#include "autoware_perception_msgs/msg/traffic_light_element.hpp"
1919
#include "autoware_perception_msgs/msg/traffic_light_group.hpp"
@@ -27,7 +27,7 @@
2727
#include <tf2/LinearMath/Matrix3x3.h>
2828
#include <tf2/LinearMath/Transform.h>
2929

30-
namespace traffic_light_utils
30+
namespace autoware::traffic_light_utils
3131
{
3232

3333
void setSignalUnknown(tier4_perception_msgs::msg::TrafficLight & signal, float confidence = -1);
@@ -79,6 +79,6 @@ tf2::Vector3 getTrafficLightBottomRight(const lanelet::ConstLineString3d & traff
7979

8080
tf2::Vector3 getTrafficLightCenter(const lanelet::ConstLineString3d & traffic_light);
8181

82-
} // namespace traffic_light_utils
82+
} // namespace autoware::traffic_light_utils
8383

84-
#endif // TRAFFIC_LIGHT_UTILS__TRAFFIC_LIGHT_UTILS_HPP_
84+
#endif // AUTOWARE__TRAFFIC_LIGHT_UTILS__TRAFFIC_LIGHT_UTILS_HPP_

common/traffic_light_utils/package.xml common/autoware_traffic_light_utils/package.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0"?>
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
4-
<name>traffic_light_utils</name>
4+
<name>autoware_traffic_light_utils</name>
55
<version>0.38.0</version>
6-
<description>The traffic_light_utils package</description>
6+
<description>The autoware_traffic_light_utils package</description>
77
<maintainer email="kotaro.uetake@tier4.jp">Kotaro Uetake</maintainer>
88
<maintainer email="shunsuke.miura@tier4.jp">Shunsuke Miura</maintainer>
99
<maintainer email="satoshi.ota@tier4.jp">Satoshi Ota</maintainer>

common/traffic_light_utils/src/traffic_light_utils.cpp common/autoware_traffic_light_utils/src/traffic_light_utils.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "traffic_light_utils/traffic_light_utils.hpp"
15+
#include "autoware/traffic_light_utils/traffic_light_utils.hpp"
1616

17-
namespace traffic_light_utils
17+
namespace autoware::traffic_light_utils
1818
{
1919

2020
void setSignalUnknown(tier4_perception_msgs::msg::TrafficLight & signal, float confidence)
@@ -105,4 +105,4 @@ tf2::Vector3 getTrafficLightCenter(const lanelet::ConstLineString3d & traffic_li
105105
return (top_left + bottom_right) / 2;
106106
}
107107

108-
} // namespace traffic_light_utils
108+
} // namespace autoware::traffic_light_utils

common/traffic_light_utils/test/test_traffic_light_utils.cpp common/autoware_traffic_light_utils/test/test_traffic_light_utils.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#include "autoware/traffic_light_utils/traffic_light_utils.hpp"
1516
#include "gtest/gtest.h"
16-
#include "traffic_light_utils/traffic_light_utils.hpp"
1717

18-
namespace traffic_light_utils
18+
namespace autoware::traffic_light_utils
1919
{
2020

2121
TEST(setSignalUnknown, set_signal_element)
@@ -53,4 +53,4 @@ TEST(getTrafficLightCenter, get_signal)
5353
EXPECT_FLOAT_EQ(getTrafficLightCenter(test_light).z(), (float)1.5);
5454
}
5555

56-
} // namespace traffic_light_utils
56+
} // namespace autoware::traffic_light_utils

perception/autoware_traffic_light_occlusion_predictor/package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
<depend>autoware_lanelet2_extension</depend>
1717
<depend>autoware_map_msgs</depend>
18+
<depend>autoware_traffic_light_utils</depend>
1819
<depend>autoware_universe_utils</depend>
1920
<depend>geometry_msgs</depend>
2021
<depend>image_geometry</depend>
@@ -27,7 +28,6 @@
2728
<depend>tf2_eigen</depend>
2829
<depend>tf2_ros</depend>
2930
<depend>tier4_perception_msgs</depend>
30-
<depend>traffic_light_utils</depend>
3131

3232
<test_depend>ament_lint_auto</test_depend>
3333
<test_depend>autoware_lint_common</test_depend>

perception/autoware_traffic_light_occlusion_predictor/src/node.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ void TrafficLightOcclusionPredictorNode::mapCallback(
117117
continue;
118118
}
119119
lanelet::ConstLineString3d string3d = static_cast<lanelet::ConstLineString3d>(lsp);
120-
traffic_light_position_map_[lsp.id()] = traffic_light_utils::getTrafficLightCenter(string3d);
120+
traffic_light_position_map_[lsp.id()] =
121+
autoware::traffic_light_utils::getTrafficLightCenter(string3d);
121122
}
122123
}
123124
}
@@ -166,7 +167,7 @@ void TrafficLightOcclusionPredictorNode::syncCallback(
166167
out_msg_.signals.push_back(in_signal_msg->signals.at(i));
167168

168169
if (occlusion_ratios[i] >= config_.max_occlusion_ratio) {
169-
traffic_light_utils::setSignalUnknown(out_msg_.signals.at(predicted_num + i), 0.0);
170+
autoware::traffic_light_utils::setSignalUnknown(out_msg_.signals.at(predicted_num + i), 0.0);
170171
}
171172
}
172173

perception/autoware_traffic_light_occlusion_predictor/src/node.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
#include "occlusion_predictor.hpp"
1919

20+
#include <autoware/traffic_light_utils/traffic_light_utils.hpp>
2021
#include <perception_utils/prime_synchronizer.hpp>
2122
#include <rclcpp/rclcpp.hpp>
22-
#include <traffic_light_utils/traffic_light_utils.hpp>
2323

2424
#include <autoware_map_msgs/msg/lanelet_map_bin.hpp>
2525
#include <geometry_msgs/msg/pose_stamped.hpp>

planning/behavior_path_planner/autoware_behavior_path_planner_common/package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@
5454
<depend>autoware_planning_msgs</depend>
5555
<depend>autoware_route_handler</depend>
5656
<depend>autoware_rtc_interface</depend>
57+
<depend>autoware_traffic_light_utils</depend>
5758
<depend>autoware_universe_utils</depend>
5859
<depend>autoware_vehicle_info_utils</depend>
5960
<depend>geometry_msgs</depend>
6061
<depend>magic_enum</depend>
6162
<depend>rclcpp</depend>
6263
<depend>tf2</depend>
6364
<depend>tier4_planning_msgs</depend>
64-
<depend>traffic_light_utils</depend>
6565
<depend>visualization_msgs</depend>
6666

6767
<test_depend>ament_cmake_ros</test_depend>

planning/behavior_path_planner/autoware_behavior_path_planner_common/src/utils/traffic_light_utils.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include <autoware/behavior_path_planner_common/utils/traffic_light_utils.hpp>
1616
#include <autoware/motion_utils/trajectory/trajectory.hpp>
17-
#include <traffic_light_utils/traffic_light_utils.hpp>
17+
#include <autoware/traffic_light_utils/traffic_light_utils.hpp>
1818

1919
namespace autoware::behavior_path_planner::utils::traffic_light
2020
{
@@ -91,7 +91,7 @@ std::optional<double> calcDistanceToRedTrafficLight(
9191
continue;
9292
}
9393

94-
if (!traffic_light_utils::isTrafficSignalStop(
94+
if (!autoware::traffic_light_utils::isTrafficSignalStop(
9595
lanelet, traffic_signal_stamped.value().signal)) {
9696
continue;
9797
}
@@ -143,7 +143,7 @@ bool isTrafficSignalStop(
143143
continue;
144144
}
145145

146-
if (traffic_light_utils::isTrafficSignalStop(
146+
if (autoware::traffic_light_utils::isTrafficSignalStop(
147147
lanelet, traffic_signal_stamped.value().signal)) {
148148
return true;
149149
}

planning/behavior_velocity_planner/autoware_behavior_velocity_traffic_light_module/package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<depend>autoware_perception_msgs</depend>
2626
<depend>autoware_planning_msgs</depend>
2727
<depend>autoware_route_handler</depend>
28+
<depend>autoware_traffic_light_utils</depend>
2829
<depend>autoware_universe_utils</depend>
2930
<depend>eigen</depend>
3031
<depend>geometry_msgs</depend>
@@ -34,7 +35,6 @@
3435
<depend>tf2_eigen</depend>
3536
<depend>tf2_geometry_msgs</depend>
3637
<depend>tier4_planning_msgs</depend>
37-
<depend>traffic_light_utils</depend>
3838
<depend>visualization_msgs</depend>
3939

4040
<test_depend>ament_cmake_ros</test_depend>

planning/behavior_velocity_planner/autoware_behavior_velocity_traffic_light_module/src/scene.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#include <autoware/behavior_velocity_planner_common/utilization/util.hpp>
2020
#include <autoware/motion_utils/trajectory/trajectory.hpp>
21-
#include <traffic_light_utils/traffic_light_utils.hpp>
21+
#include <autoware/traffic_light_utils/traffic_light_utils.hpp>
2222

2323
#include <boost/geometry/algorithms/distance.hpp>
2424
#include <boost/geometry/algorithms/intersection.hpp>
@@ -177,7 +177,7 @@ bool TrafficLightModule::isStopSignal()
177177
}
178178

179179
// Check if the current traffic signal state requires stopping
180-
return traffic_light_utils::isTrafficSignalStop(lane_, looking_tl_state_);
180+
return autoware::traffic_light_utils::isTrafficSignalStop(lane_, looking_tl_state_);
181181
}
182182

183183
void TrafficLightModule::updateTrafficSignal()

planning/motion_velocity_planner/autoware_motion_velocity_out_of_lane_module/package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<depend>autoware_perception_msgs</depend>
2222
<depend>autoware_planning_msgs</depend>
2323
<depend>autoware_route_handler</depend>
24+
<depend>autoware_traffic_light_utils</depend>
2425
<depend>autoware_universe_utils</depend>
2526
<depend>autoware_vehicle_info_utils</depend>
2627
<depend>geometry_msgs</depend>
@@ -29,7 +30,6 @@
2930
<depend>rclcpp</depend>
3031
<depend>tf2</depend>
3132
<depend>tier4_planning_msgs</depend>
32-
<depend>traffic_light_utils</depend>
3333
<depend>visualization_msgs</depend>
3434

3535
<test_depend>ament_cmake_ros</test_depend>

planning/motion_velocity_planner/autoware_motion_velocity_out_of_lane_module/src/filter_predicted_objects.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
#include "filter_predicted_objects.hpp"
1616

1717
#include <autoware/motion_utils/trajectory/trajectory.hpp>
18+
#include <autoware/traffic_light_utils/traffic_light_utils.hpp>
1819
#include <autoware/universe_utils/geometry/boost_geometry.hpp>
19-
#include <traffic_light_utils/traffic_light_utils.hpp>
2020

2121
#include <boost/geometry/algorithms/detail/intersects/interface.hpp>
2222
#include <boost/geometry/algorithms/intersects.hpp>

planning/motion_velocity_planner/autoware_motion_velocity_out_of_lane_module/src/out_of_lane_module.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
#include <autoware/motion_utils/trajectory/trajectory.hpp>
2727
#include <autoware/motion_velocity_planner_common/planner_data.hpp>
2828
#include <autoware/route_handler/route_handler.hpp>
29+
#include <autoware/traffic_light_utils/traffic_light_utils.hpp>
2930
#include <autoware/universe_utils/geometry/boost_geometry.hpp>
3031
#include <autoware/universe_utils/ros/parameter.hpp>
3132
#include <autoware/universe_utils/ros/update_param.hpp>
3233
#include <autoware/universe_utils/system/stop_watch.hpp>
33-
#include <traffic_light_utils/traffic_light_utils.hpp>
3434

3535
#include <boost/geometry/algorithms/envelope.hpp>
3636
#include <boost/geometry/algorithms/intersects.hpp>
@@ -179,7 +179,8 @@ void prepare_stop_lines_rtree(
179179
const auto traffic_signal_stamped = planner_data.get_traffic_signal(element->id());
180180
if (
181181
traffic_signal_stamped.has_value() && element->stopLine().has_value() &&
182-
traffic_light_utils::isTrafficSignalStop(ll, traffic_signal_stamped.value().signal)) {
182+
autoware::traffic_light_utils::isTrafficSignalStop(
183+
ll, traffic_signal_stamped.value().signal)) {
183184
stop_line_node.second.stop_line.clear();
184185
for (const auto & p : element->stopLine()->basicLineString()) {
185186
stop_line_node.second.stop_line.emplace_back(p.x(), p.y());

0 commit comments

Comments
 (0)