Skip to content

Commit

Permalink
use motion utils function instead of shiftPose
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
  • Loading branch information
danielsanchezaran committed Jul 9, 2024
1 parent e24bd77 commit 614f87f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#endif

#include <vector>

namespace autoware::motion::control::autonomous_emergency_braking::utils
{
using autoware::universe_utils::Polygon2d;
Expand Down Expand Up @@ -82,8 +80,6 @@ Polygon2d convertBoundingBoxObjectToGeometryPolygon(
* @param obj the object
*/
Polygon2d convertObjToPolygon(const PredictedObject & obj);

Pose shiftPose(const Pose & pose, double longitudinal);
} // namespace autoware::motion::control::autonomous_emergency_braking::utils

#endif // AUTOWARE__AUTONOMOUS_EMERGENCY_BRAKING__UTILS_HPP_
5 changes: 3 additions & 2 deletions control/autoware_autonomous_emergency_braking/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -923,8 +923,9 @@ void AEB::addCollisionMarker(const ObjectData & data, MarkerArray & debug_marker
});

Check warning on line 923 in control/autoware_autonomous_emergency_braking/src/node.cpp

View check run for this annotation

Codecov / codecov/patch

control/autoware_autonomous_emergency_braking/src/node.cpp#L923

Added line #L923 was not covered by tests

if (ego_map_pose.has_value()) {
const double base_to_front_offset = vehicle_info_.front_overhang_m + vehicle_info_.wheel_base_m;
const auto ego_front_pose = utils::shiftPose(ego_map_pose.value(), base_to_front_offset);
const double base_to_front_offset = vehicle_info_.max_longitudinal_offset_m;
const auto ego_front_pose = autoware::universe_utils::calcOffsetPose(

Check warning on line 927 in control/autoware_autonomous_emergency_braking/src/node.cpp

View check run for this annotation

Codecov / codecov/patch

control/autoware_autonomous_emergency_braking/src/node.cpp#L926-L927

Added lines #L926 - L927 were not covered by tests
ego_map_pose.value(), base_to_front_offset, 0.0, 0.0, 0.0);
const auto virtual_stop_wall = autoware::motion_utils::createStopVirtualWallMarker(
ego_front_pose, "autonomous_emergency_braking", this->now(), 0);
autoware::universe_utils::appendMarkerArray(virtual_stop_wall, &debug_markers);

Check warning on line 931 in control/autoware_autonomous_emergency_braking/src/node.cpp

View check run for this annotation

Codecov / codecov/patch

control/autoware_autonomous_emergency_braking/src/node.cpp#L930-L931

Added lines #L930 - L931 were not covered by tests
Expand Down
9 changes: 0 additions & 9 deletions control/autoware_autonomous_emergency_braking/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,4 @@ Polygon2d convertObjToPolygon(const PredictedObject & obj)
}
return object_polygon;
}

Pose shiftPose(const Pose & pose, double longitudinal)
{
Pose shifted_pose = pose;
const auto yaw = tf2::getYaw(pose.orientation);
shifted_pose.position.x += std::cos(yaw) * longitudinal;
shifted_pose.position.y += std::sin(yaw) * longitudinal;
return shifted_pose;
}
} // namespace autoware::motion::control::autonomous_emergency_braking::utils

0 comments on commit 614f87f

Please sign in to comment.