-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(autonomous_emergency_braking): add predicted object support for …
…aeb (#7548) * add polling sub to predicted objects Signed-off-by: Daniel Sanchez <[email protected]> * WIP requires changing path frame to map Signed-off-by: Daniel Sanchez <[email protected]> * add parameters and reuse predicted obj speed Signed-off-by: Daniel Sanchez <[email protected]> * introduce early break to reduce computation time Signed-off-by: Daniel Sanchez <[email protected]> * resolve merge conflicts Signed-off-by: Daniel Sanchez <[email protected]> * fix guard Signed-off-by: Daniel Sanchez <[email protected]> * remove unused declaration Signed-off-by: Daniel Sanchez <[email protected]> * fix include Signed-off-by: Daniel Sanchez <[email protected]> * fix include issues Signed-off-by: Daniel Sanchez <[email protected]> * remove inline Signed-off-by: Daniel Sanchez <[email protected]> * delete unused dependencies Signed-off-by: Daniel Sanchez <[email protected]> * add utils.cpp Signed-off-by: Daniel Sanchez <[email protected]> * remove _ for non member variable Signed-off-by: Daniel Sanchez <[email protected]> --------- Signed-off-by: Daniel Sanchez <[email protected]>
- Loading branch information
1 parent
b284599
commit 51045e9
Showing
8 changed files
with
417 additions
and
27 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
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
88 changes: 88 additions & 0 deletions
88
...ware_autonomous_emergency_braking/include/autoware/autonomous_emergency_braking/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,88 @@ | ||
// 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 AUTOWARE__AUTONOMOUS_EMERGENCY_BRAKING__UTILS_HPP_ | ||
#define AUTOWARE__AUTONOMOUS_EMERGENCY_BRAKING__UTILS_HPP_ | ||
|
||
#include <autoware/universe_utils/geometry/boost_polygon_utils.hpp> | ||
|
||
#include <autoware_perception_msgs/msg/predicted_objects.hpp> | ||
#include <geometry_msgs/msg/point.hpp> | ||
#include <geometry_msgs/msg/pose.hpp> | ||
|
||
#include <boost/geometry/algorithms/correct.hpp> | ||
|
||
#include <tf2/utils.h> | ||
#ifdef ROS_DISTRO_GALACTIC | ||
#include <tf2_eigen/tf2_eigen.h> | ||
#include <tf2_geometry_msgs/tf2_geometry_msgs.h> | ||
#else | ||
#include <tf2_eigen/tf2_eigen.hpp> | ||
|
||
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp> | ||
#endif | ||
|
||
#include <vector> | ||
|
||
namespace autoware::motion::control::autonomous_emergency_braking::utils | ||
{ | ||
using autoware_perception_msgs::msg::PredictedObject; | ||
using autoware_perception_msgs::msg::PredictedObjects; | ||
using autoware_universe_utils::Point2d; | ||
using autoware_universe_utils::Polygon2d; | ||
using geometry_msgs::msg::Point; | ||
using geometry_msgs::msg::Pose; | ||
using geometry_msgs::msg::TransformStamped; | ||
|
||
/** | ||
* @brief Apply a transform to a predicted object | ||
* @param input the predicted object | ||
* @param transform_stamped the tf2 transform | ||
*/ | ||
PredictedObject transformObjectFrame( | ||
const PredictedObject & input, geometry_msgs::msg::TransformStamped transform_stamped); | ||
|
||
/** | ||
* @brief Get the predicted objects polygon as a geometry polygon | ||
* @param current_pose the predicted object's pose | ||
* @param obj_shape the object's shape | ||
*/ | ||
Polygon2d convertPolygonObjectToGeometryPolygon( | ||
const Pose & current_pose, const autoware_perception_msgs::msg::Shape & obj_shape); | ||
|
||
/** | ||
* @brief Get the predicted objects cylindrical shape as a geometry polygon | ||
* @param current_pose the predicted object's pose | ||
* @param obj_shape the object's shape | ||
*/ | ||
Polygon2d convertCylindricalObjectToGeometryPolygon( | ||
const Pose & current_pose, const autoware_perception_msgs::msg::Shape & obj_shape); | ||
|
||
/** | ||
* @brief Get the predicted objects bounding box shape as a geometry polygon | ||
* @param current_pose the predicted object's pose | ||
* @param obj_shape the object's shape | ||
*/ | ||
Polygon2d convertBoundingBoxObjectToGeometryPolygon( | ||
const Pose & current_pose, const double & base_to_front, const double & base_to_rear, | ||
const double & base_to_width); | ||
|
||
/** | ||
* @brief Get the predicted object's shape as a geometry polygon | ||
* @param obj the object | ||
*/ | ||
Polygon2d convertObjToPolygon(const PredictedObject & obj); | ||
} // namespace autoware::motion::control::autonomous_emergency_braking::utils | ||
|
||
#endif // AUTOWARE__AUTONOMOUS_EMERGENCY_BRAKING__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
Oops, something went wrong.