diff --git a/planning/obstacle_avoidance_planner/include/obstacle_avoidance_planner/node.hpp b/planning/obstacle_avoidance_planner/include/obstacle_avoidance_planner/node.hpp index 6f38883aa4790..d93cc890054a5 100644 --- a/planning/obstacle_avoidance_planner/include/obstacle_avoidance_planner/node.hpp +++ b/planning/obstacle_avoidance_planner/include/obstacle_avoidance_planner/node.hpp @@ -51,6 +51,10 @@ template double lerpTwistX( const T & points, const geometry_msgs::msg::Point & target_pos, const size_t closest_seg_idx) { + if (points.size() == 1) { + return points.at(0).longitudinal_velocity_mps; + } + constexpr double epsilon = 1e-6; const double closest_to_target_dist = @@ -70,6 +74,10 @@ template double lerpPoseZ( const T & points, const geometry_msgs::msg::Point & target_pos, const size_t closest_seg_idx) { + if (points.size() == 1) { + return points.at(0).pose.position.z; + } + constexpr double epsilon = 1e-6; const double closest_to_target_dist =