-
Notifications
You must be signed in to change notification settings - Fork 682
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(behavior_path_planner): reorganize debug visualization (#1101)
* refactor(behavior_path_planner): reorganize debug visualization Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> * refactor the code for consistency reuse utilities function Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> * refactor const reference string to rvalue reference Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> * clear debug marker on exit to remove artifact Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> * initialize marker using common createDefaultMarker and add reserve add reserve to increase performance of push back. Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp>
- Loading branch information
1 parent
45d95dd
commit bd46fd2
Showing
8 changed files
with
477 additions
and
556 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
planning/behavior_path_planner/include/behavior_path_planner/debug_utilities.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// Copyright 2022 TIER IV, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
#ifndef BEHAVIOR_PATH_PLANNER__DEBUG_UTILITIES_HPP_ | ||
#define BEHAVIOR_PATH_PLANNER__DEBUG_UTILITIES_HPP_ | ||
|
||
#include "behavior_path_planner/path_shifter/path_shifter.hpp" | ||
#include "behavior_path_planner/path_utilities.hpp" | ||
#include "behavior_path_planner/utilities.hpp" | ||
|
||
#include <tier4_autoware_utils/ros/marker_helper.hpp> | ||
|
||
#include <autoware_auto_perception_msgs/msg/predicted_objects.hpp> | ||
#include <autoware_auto_planning_msgs/msg/path_with_lane_id.hpp> | ||
#include <geometry_msgs/msg/polygon.hpp> | ||
#include <visualization_msgs/msg/marker_array.hpp> | ||
|
||
#include <lanelet2_core/LaneletMap.h> | ||
#include <lanelet2_routing/RoutingGraph.h> | ||
#include <tf2/utils.h> | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
namespace marker_utils | ||
{ | ||
using autoware_auto_perception_msgs::msg::PredictedObjects; | ||
using autoware_auto_planning_msgs::msg::PathWithLaneId; | ||
using behavior_path_planner::ShiftPointArray; | ||
using geometry_msgs::msg::Point; | ||
using geometry_msgs::msg::Polygon; | ||
using geometry_msgs::msg::Pose; | ||
using geometry_msgs::msg::Vector3; | ||
using std_msgs::msg::ColorRGBA; | ||
using visualization_msgs::msg::Marker; | ||
using visualization_msgs::msg::MarkerArray; | ||
|
||
inline int64_t bitShift(int64_t original_id) { return original_id << (sizeof(int32_t) * 8 / 2); } | ||
|
||
MarkerArray createPoseMarkerArray( | ||
const Pose & pose, std::string && ns, const int32_t & id, const float & r, const float & g, | ||
const float & b); | ||
|
||
MarkerArray createPathMarkerArray( | ||
const PathWithLaneId & path, std::string && ns, const int64_t & lane_id, const float & r, | ||
const float & g, const float & b); | ||
|
||
MarkerArray createShiftPointMarkerArray( | ||
const ShiftPointArray & shift_points, const double & base_shift, std::string && ns, | ||
const float & r, const float & g, const float & b, const float & w); | ||
|
||
MarkerArray createShiftLengthMarkerArray( | ||
const std::vector<double> & shift_distance, | ||
const autoware_auto_planning_msgs::msg::PathWithLaneId & reference, std::string && ns, | ||
const float & r, const float & g, const float & b); | ||
|
||
MarkerArray createLaneletsAreaMarkerArray( | ||
const std::vector<lanelet::ConstLanelet> & lanelets, std::string && ns, const float & r, | ||
const float & g, const float & b); | ||
|
||
MarkerArray createFurthestLineStringMarkerArray(const lanelet::ConstLineStrings3d & linestrings); | ||
|
||
MarkerArray createPolygonMarkerArray( | ||
const Polygon & polygon, std::string && ns, const int64_t & lane_id, const float & r, | ||
const float & g, const float & b); | ||
|
||
MarkerArray createObjectsMarkerArray( | ||
const PredictedObjects & objects, std::string && ns, const int64_t & lane_id, const float & r, | ||
const float & g, const float & b); | ||
|
||
} // namespace marker_utils | ||
|
||
#endif // BEHAVIOR_PATH_PLANNER__DEBUG_UTILITIES_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.