Skip to content

Commit

Permalink
refactor(traffic_light_utils): prefix package and namespace with auto…
Browse files Browse the repository at this point in the history
…ware (#9251)

Signed-off-by: Esteve Fernandez <[email protected]>
  • Loading branch information
esteve authored Nov 18, 2024
1 parent 2a2bffa commit f112f65
Show file tree
Hide file tree
Showing 19 changed files with 36 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ common/autoware_test_utils/** [email protected] [email protected] ta
common/autoware_testing/** [email protected] [email protected] [email protected] [email protected]
common/autoware_time_utils/** [email protected] [email protected] [email protected]
common/autoware_trajectory/** [email protected] [email protected] [email protected]
common/autoware_traffic_light_utils/** [email protected] [email protected] [email protected]
common/autoware_universe_utils/** [email protected] [email protected] [email protected]
common/autoware_vehicle_info_utils/** [email protected] [email protected] [email protected] [email protected]
common/bag_time_manager_rviz_plugin/** [email protected]
Expand All @@ -41,7 +42,6 @@ common/tier4_system_rviz_plugin/** [email protected]
common/tier4_traffic_light_rviz_plugin/** [email protected]
common/tier4_vehicle_rviz_plugin/** [email protected]
common/traffic_light_recognition_marker_publisher/** [email protected] [email protected] [email protected]
common/traffic_light_utils/** [email protected] [email protected] [email protected]
control/autoware_autonomous_emergency_braking/** [email protected] [email protected] [email protected] [email protected] [email protected]
control/autoware_collision_detector/** [email protected] [email protected] [email protected]
control/autoware_control_validator/** [email protected] [email protected] [email protected] [email protected] [email protected]
Expand Down
2 changes: 1 addition & 1 deletion common/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ nav:
- 'Signal Processing':
- 'Introduction': common/autoware_signal_processing
- 'Butterworth Filter': common/autoware_signal_processing/documentation/ButterworthFilter
- 'autoware_traffic_light_utils': common/autoware_traffic_light_utils
- 'autoware_universe_utils': common/autoware_universe_utils
- 'traffic_light_utils': common/traffic_light_utils
- 'RVIZ2 Plugins':
- 'autoware_perception_rviz_plugin': common/autoware_perception_rviz_plugin
- 'autoware_overlay_rviz_plugin': common/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
cmake_minimum_required(VERSION 3.14)
project(traffic_light_utils)
project(autoware_traffic_light_utils)

find_package(autoware_cmake REQUIRED)
autoware_package()

find_package(Boost REQUIRED)
find_package(autoware_cmake REQUIRED)

ament_auto_add_library(traffic_light_utils SHARED
ament_auto_add_library(${PROJECT_NAME} SHARED
src/traffic_light_utils.cpp
)

Expand All @@ -16,7 +16,7 @@ if(BUILD_TESTING)
file(GLOB_RECURSE TEST_SOURCES test/*.cpp)
ament_add_ros_isolated_gtest(test_traffic_light_utils ${TEST_SOURCES})
target_include_directories(test_traffic_light_utils PRIVATE src/include)
target_link_libraries(test_traffic_light_utils traffic_light_utils)
target_link_libraries(test_traffic_light_utils ${PROJECT_NAME})
endif()

ament_auto_package()
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# traffic_light_utils
# autoware_traffic_light_utils

## Purpose

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef TRAFFIC_LIGHT_UTILS__TRAFFIC_LIGHT_UTILS_HPP_
#define TRAFFIC_LIGHT_UTILS__TRAFFIC_LIGHT_UTILS_HPP_
#ifndef AUTOWARE__TRAFFIC_LIGHT_UTILS__TRAFFIC_LIGHT_UTILS_HPP_
#define AUTOWARE__TRAFFIC_LIGHT_UTILS__TRAFFIC_LIGHT_UTILS_HPP_

#include "autoware_perception_msgs/msg/traffic_light_element.hpp"
#include "autoware_perception_msgs/msg/traffic_light_group.hpp"
Expand All @@ -27,7 +27,7 @@
#include <tf2/LinearMath/Matrix3x3.h>
#include <tf2/LinearMath/Transform.h>

namespace traffic_light_utils
namespace autoware::traffic_light_utils
{

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

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

} // namespace traffic_light_utils
} // namespace autoware::traffic_light_utils

#endif // TRAFFIC_LIGHT_UTILS__TRAFFIC_LIGHT_UTILS_HPP_
#endif // AUTOWARE__TRAFFIC_LIGHT_UTILS__TRAFFIC_LIGHT_UTILS_HPP_
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>traffic_light_utils</name>
<name>autoware_traffic_light_utils</name>
<version>0.38.0</version>
<description>The traffic_light_utils package</description>
<description>The autoware_traffic_light_utils package</description>
<maintainer email="[email protected]">Kotaro Uetake</maintainer>
<maintainer email="[email protected]">Shunsuke Miura</maintainer>
<maintainer email="[email protected]">Satoshi Ota</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "traffic_light_utils/traffic_light_utils.hpp"
#include "autoware/traffic_light_utils/traffic_light_utils.hpp"

namespace traffic_light_utils
namespace autoware::traffic_light_utils
{

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

} // namespace traffic_light_utils
} // namespace autoware::traffic_light_utils
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "autoware/traffic_light_utils/traffic_light_utils.hpp"
#include "gtest/gtest.h"
#include "traffic_light_utils/traffic_light_utils.hpp"

namespace traffic_light_utils
namespace autoware::traffic_light_utils
{

TEST(setSignalUnknown, set_signal_element)
Expand Down Expand Up @@ -53,4 +53,4 @@ TEST(getTrafficLightCenter, get_signal)
EXPECT_FLOAT_EQ(getTrafficLightCenter(test_light).z(), (float)1.5);
}

} // namespace traffic_light_utils
} // namespace autoware::traffic_light_utils
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<depend>autoware_lanelet2_extension</depend>
<depend>autoware_map_msgs</depend>
<depend>autoware_traffic_light_utils</depend>
<depend>autoware_universe_utils</depend>
<depend>geometry_msgs</depend>
<depend>image_geometry</depend>
Expand All @@ -27,7 +28,6 @@
<depend>tf2_eigen</depend>
<depend>tf2_ros</depend>
<depend>tier4_perception_msgs</depend>
<depend>traffic_light_utils</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ void TrafficLightOcclusionPredictorNode::mapCallback(
continue;
}
lanelet::ConstLineString3d string3d = static_cast<lanelet::ConstLineString3d>(lsp);
traffic_light_position_map_[lsp.id()] = traffic_light_utils::getTrafficLightCenter(string3d);
traffic_light_position_map_[lsp.id()] =
autoware::traffic_light_utils::getTrafficLightCenter(string3d);
}
}
}
Expand Down Expand Up @@ -166,7 +167,7 @@ void TrafficLightOcclusionPredictorNode::syncCallback(
out_msg_.signals.push_back(in_signal_msg->signals.at(i));

if (occlusion_ratios[i] >= config_.max_occlusion_ratio) {
traffic_light_utils::setSignalUnknown(out_msg_.signals.at(predicted_num + i), 0.0);
autoware::traffic_light_utils::setSignalUnknown(out_msg_.signals.at(predicted_num + i), 0.0);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

#include "occlusion_predictor.hpp"

#include <autoware/traffic_light_utils/traffic_light_utils.hpp>
#include <perception_utils/prime_synchronizer.hpp>
#include <rclcpp/rclcpp.hpp>
#include <traffic_light_utils/traffic_light_utils.hpp>

#include <autoware_map_msgs/msg/lanelet_map_bin.hpp>
#include <geometry_msgs/msg/pose_stamped.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@
<depend>autoware_planning_msgs</depend>
<depend>autoware_route_handler</depend>
<depend>autoware_rtc_interface</depend>
<depend>autoware_traffic_light_utils</depend>
<depend>autoware_universe_utils</depend>
<depend>autoware_vehicle_info_utils</depend>
<depend>geometry_msgs</depend>
<depend>magic_enum</depend>
<depend>rclcpp</depend>
<depend>tf2</depend>
<depend>tier4_planning_msgs</depend>
<depend>traffic_light_utils</depend>
<depend>visualization_msgs</depend>

<test_depend>ament_cmake_ros</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <autoware/behavior_path_planner_common/utils/traffic_light_utils.hpp>
#include <autoware/motion_utils/trajectory/trajectory.hpp>
#include <traffic_light_utils/traffic_light_utils.hpp>
#include <autoware/traffic_light_utils/traffic_light_utils.hpp>

namespace autoware::behavior_path_planner::utils::traffic_light
{
Expand Down Expand Up @@ -91,7 +91,7 @@ std::optional<double> calcDistanceToRedTrafficLight(
continue;
}

if (!traffic_light_utils::isTrafficSignalStop(
if (!autoware::traffic_light_utils::isTrafficSignalStop(
lanelet, traffic_signal_stamped.value().signal)) {
continue;
}
Expand Down Expand Up @@ -143,7 +143,7 @@ bool isTrafficSignalStop(
continue;
}

if (traffic_light_utils::isTrafficSignalStop(
if (autoware::traffic_light_utils::isTrafficSignalStop(
lanelet, traffic_signal_stamped.value().signal)) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<depend>autoware_perception_msgs</depend>
<depend>autoware_planning_msgs</depend>
<depend>autoware_route_handler</depend>
<depend>autoware_traffic_light_utils</depend>
<depend>autoware_universe_utils</depend>
<depend>eigen</depend>
<depend>geometry_msgs</depend>
Expand All @@ -34,7 +35,6 @@
<depend>tf2_eigen</depend>
<depend>tf2_geometry_msgs</depend>
<depend>tier4_planning_msgs</depend>
<depend>traffic_light_utils</depend>
<depend>visualization_msgs</depend>

<test_depend>ament_cmake_ros</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <autoware/behavior_velocity_planner_common/utilization/util.hpp>
#include <autoware/motion_utils/trajectory/trajectory.hpp>
#include <traffic_light_utils/traffic_light_utils.hpp>
#include <autoware/traffic_light_utils/traffic_light_utils.hpp>

#include <boost/geometry/algorithms/distance.hpp>
#include <boost/geometry/algorithms/intersection.hpp>
Expand Down Expand Up @@ -177,7 +177,7 @@ bool TrafficLightModule::isStopSignal()
}

// Check if the current traffic signal state requires stopping
return traffic_light_utils::isTrafficSignalStop(lane_, looking_tl_state_);
return autoware::traffic_light_utils::isTrafficSignalStop(lane_, looking_tl_state_);
}

void TrafficLightModule::updateTrafficSignal()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<depend>autoware_perception_msgs</depend>
<depend>autoware_planning_msgs</depend>
<depend>autoware_route_handler</depend>
<depend>autoware_traffic_light_utils</depend>
<depend>autoware_universe_utils</depend>
<depend>autoware_vehicle_info_utils</depend>
<depend>geometry_msgs</depend>
Expand All @@ -29,7 +30,6 @@
<depend>rclcpp</depend>
<depend>tf2</depend>
<depend>tier4_planning_msgs</depend>
<depend>traffic_light_utils</depend>
<depend>visualization_msgs</depend>

<test_depend>ament_cmake_ros</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "filter_predicted_objects.hpp"

#include <autoware/motion_utils/trajectory/trajectory.hpp>
#include <autoware/traffic_light_utils/traffic_light_utils.hpp>
#include <autoware/universe_utils/geometry/boost_geometry.hpp>
#include <traffic_light_utils/traffic_light_utils.hpp>

#include <boost/geometry/algorithms/detail/intersects/interface.hpp>
#include <boost/geometry/algorithms/intersects.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
#include <autoware/motion_utils/trajectory/trajectory.hpp>
#include <autoware/motion_velocity_planner_common/planner_data.hpp>
#include <autoware/route_handler/route_handler.hpp>
#include <autoware/traffic_light_utils/traffic_light_utils.hpp>
#include <autoware/universe_utils/geometry/boost_geometry.hpp>
#include <autoware/universe_utils/ros/parameter.hpp>
#include <autoware/universe_utils/ros/update_param.hpp>
#include <autoware/universe_utils/system/stop_watch.hpp>
#include <traffic_light_utils/traffic_light_utils.hpp>

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

0 comments on commit f112f65

Please sign in to comment.