|
30 | 30 | #include <string>
|
31 | 31 | #include <vector>
|
32 | 32 |
|
33 |
| -// for writing the svg file |
34 |
| -#include <fstream> |
35 |
| -#include <iostream> |
36 |
| -// for the geometry types |
37 |
| -#include <tier4_autoware_utils/geometry/geometry.hpp> |
38 |
| -// for the svg mapper |
39 |
| -#include <boost/geometry/io/svg/svg_mapper.hpp> |
40 |
| -#include <boost/geometry/io/svg/write.hpp> |
41 |
| - |
42 | 33 | namespace behavior_velocity_planner::out_of_lane
|
43 | 34 | {
|
44 | 35 | void cut_predicted_path_beyond_line(
|
@@ -98,23 +89,10 @@ std::optional<const lanelet::BasicLineString2d> find_next_stop_line(
|
98 | 89 | /// @param [in] planner_data planner data to get the map and traffic light information
|
99 | 90 | void cut_predicted_path_beyond_red_lights(
|
100 | 91 | autoware_auto_perception_msgs::msg::PredictedPath & predicted_path,
|
101 |
| - const PlannerData & planner_data, const double object_front_overhang, int i) |
| 92 | + const PlannerData & planner_data, const double object_front_overhang) |
102 | 93 | {
|
103 |
| - // Declare a stream and an SVG mapper |
104 |
| - std::ofstream svg( |
105 |
| - "/home/mclement/Pictures/image" + std::to_string(i) + ".svg"); // /!\ CHANGE PATH |
106 |
| - boost::geometry::svg_mapper<tier4_autoware_utils::Point2d> mapper(svg, 400, 400); |
107 | 94 | const auto stop_line = find_next_stop_line(predicted_path, planner_data);
|
108 |
| - lanelet::BasicLineString2d path_ls; |
109 |
| - for (const auto & p : predicted_path.path) path_ls.emplace_back(p.position.x, p.position.y); |
110 | 95 | if (stop_line) cut_predicted_path_beyond_line(predicted_path, *stop_line, object_front_overhang);
|
111 |
| - lanelet::BasicLineString2d cut_path_ls; |
112 |
| - for (const auto & p : predicted_path.path) cut_path_ls.emplace_back(p.position.x, p.position.y); |
113 |
| - mapper.add(cut_path_ls); |
114 |
| - if (stop_line) mapper.add(*stop_line); |
115 |
| - mapper.map(path_ls, "opacity:0.3;fill:black;stroke:black;stroke-width:2"); |
116 |
| - if (stop_line) mapper.map(*stop_line, "opacity:0.5;fill:black;stroke:red;stroke-width:2"); |
117 |
| - mapper.map(cut_path_ls, "opacity:0.3;fill:red;stroke:red;stroke-width:2"); |
118 | 96 | }
|
119 | 97 |
|
120 | 98 | /// @brief filter predicted objects and their predicted paths
|
@@ -153,11 +131,10 @@ autoware_auto_perception_msgs::msg::PredictedObjects filter_predicted_objects(
|
153 | 131 | const auto new_end =
|
154 | 132 | std::remove_if(predicted_paths.begin(), predicted_paths.end(), is_invalid_predicted_path);
|
155 | 133 | predicted_paths.erase(new_end, predicted_paths.end());
|
156 |
| - auto i = 0; |
157 |
| - if (true || params.objects_cut_predicted_paths_beyond_red_lights) |
| 134 | + if (params.objects_cut_predicted_paths_beyond_red_lights) |
158 | 135 | for (auto & predicted_path : predicted_paths)
|
159 | 136 | cut_predicted_path_beyond_red_lights(
|
160 |
| - predicted_path, planner_data, filtered_object.shape.dimensions.x, i++); |
| 137 | + predicted_path, planner_data, filtered_object.shape.dimensions.x); |
161 | 138 | predicted_paths.erase(
|
162 | 139 | std::remove_if(
|
163 | 140 | predicted_paths.begin(), predicted_paths.end(),
|
|
0 commit comments