forked from autowarefoundation/autoware.universe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(radar_object_tracker): fix lanelet based filter and add test (au…
…towarefoundation#7047) * feat: change lanelet filtering method to remove unintened objects output Signed-off-by: yoshiri <[email protected]> * refactor: move util-like function to util folder Signed-off-by: yoshiri <[email protected]> * feat: add test Signed-off-by: yoshiri <[email protected]> --------- Signed-off-by: yoshiri <[email protected]>
- Loading branch information
Showing
6 changed files
with
382 additions
and
161 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
77 changes: 77 additions & 0 deletions
77
...on/radar_object_tracker/include/radar_object_tracker/utils/radar_object_tracker_utils.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,77 @@ | ||
// Copyright 2024 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 RADAR_OBJECT_TRACKER__UTILS__RADAR_OBJECT_TRACKER_UTILS_HPP_ | ||
#define RADAR_OBJECT_TRACKER__UTILS__RADAR_OBJECT_TRACKER_UTILS_HPP_ | ||
|
||
#include <lanelet2_extension/utility/query.hpp> | ||
#include <lanelet2_extension/utility/utilities.hpp> | ||
|
||
#include <geometry_msgs/msg/transform.hpp> | ||
|
||
#include <boost/optional.hpp> | ||
|
||
#include <lanelet2_core/LaneletMap.h> | ||
#include <lanelet2_core/geometry/BoundingBox.h> | ||
#include <lanelet2_core/geometry/Lanelet.h> | ||
#include <lanelet2_core/geometry/Point.h> | ||
#include <lanelet2_core/primitives/Lanelet.h> | ||
|
||
#ifdef ROS_DISTRO_GALACTIC | ||
#include <tf2_geometry_msgs/tf2_geometry_msgs.h> | ||
#else | ||
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp> | ||
#endif | ||
|
||
#include <rclcpp/rclcpp.hpp> | ||
#include <tier4_autoware_utils/geometry/geometry.hpp> | ||
#include <tier4_autoware_utils/math/unit_conversion.hpp> | ||
|
||
#include <autoware_auto_perception_msgs/msg/tracked_object.hpp> | ||
|
||
#include <tf2/LinearMath/Transform.h> | ||
#include <tf2/convert.h> | ||
#include <tf2/transform_datatypes.h> | ||
#include <tf2_ros/buffer.h> | ||
|
||
#include <string> | ||
#include <utility> | ||
namespace radar_object_tracker_utils | ||
{ | ||
|
||
boost::optional<geometry_msgs::msg::Transform> getTransformAnonymous( | ||
const tf2_ros::Buffer & tf_buffer, const std::string & source_frame_id, | ||
const std::string & target_frame_id, const rclcpp::Time & time); | ||
|
||
bool isDuplicated( | ||
const std::pair<double, lanelet::ConstLanelet> & target_lanelet, | ||
const lanelet::ConstLanelets & lanelets); | ||
|
||
bool checkCloseLaneletCondition( | ||
const std::pair<double, lanelet::Lanelet> & lanelet, | ||
const autoware_auto_perception_msgs::msg::TrackedObject & object, | ||
const double max_distance_from_lane, const double max_angle_diff_from_lane); | ||
|
||
lanelet::ConstLanelets getClosestValidLanelets( | ||
const autoware_auto_perception_msgs::msg::TrackedObject & object, | ||
const lanelet::LaneletMapPtr & lanelet_map_ptr, const double max_distance_from_lane, | ||
const double max_angle_diff_from_lane); | ||
|
||
bool hasValidVelocityDirectionToLanelet( | ||
const autoware_auto_perception_msgs::msg::TrackedObject & object, | ||
const lanelet::ConstLanelets & lanelets, const double max_lateral_velocity); | ||
|
||
} // namespace radar_object_tracker_utils | ||
|
||
#endif // RADAR_OBJECT_TRACKER__UTILS__RADAR_OBJECT_TRACKER_UTILS_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.