Skip to content

Commit

Permalink
fix(tier4_autoware_utils): fix -Werror=float-conversion (#5301)
Browse files Browse the repository at this point in the history
fix(tier4_autoware_utils): fix

Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota authored Oct 13, 2023
1 parent d9abd59 commit c03b5ac
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,29 +261,29 @@ inline void setOrientation(const geometry_msgs::msg::Quaternion & orientation, T
}

template <class T>
void setLongitudinalVelocity([[maybe_unused]] const double velocity, [[maybe_unused]] T & p)
void setLongitudinalVelocity([[maybe_unused]] const float velocity, [[maybe_unused]] T & p)
{
static_assert(sizeof(T) == 0, "Only specializations of getLongitudinalVelocity can be used.");
throw std::logic_error("Only specializations of getLongitudinalVelocity can be used.");
}

template <>
inline void setLongitudinalVelocity(
const double velocity, autoware_auto_planning_msgs::msg::TrajectoryPoint & p)
const float velocity, autoware_auto_planning_msgs::msg::TrajectoryPoint & p)
{
p.longitudinal_velocity_mps = velocity;
}

template <>
inline void setLongitudinalVelocity(
const double velocity, autoware_auto_planning_msgs::msg::PathPoint & p)
const float velocity, autoware_auto_planning_msgs::msg::PathPoint & p)
{
p.longitudinal_velocity_mps = velocity;
}

template <>
inline void setLongitudinalVelocity(
const double velocity, autoware_auto_planning_msgs::msg::PathPointWithLaneId & p)
const float velocity, autoware_auto_planning_msgs::msg::PathPointWithLaneId & p)
{
p.point.longitudinal_velocity_mps = velocity;
}
Expand Down

0 comments on commit c03b5ac

Please sign in to comment.