Skip to content

Commit cabbb8a

Browse files
committed
small improvements for clang-tidy
Signed-off-by: Maxime CLEMENT <maxime.clement@tier4.jp>
1 parent afd80e0 commit cabbb8a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

common/motion_utils/include/motion_utils/factor/velocity_factor_interface.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ using geometry_msgs::msg::Pose;
3636
class VelocityFactorInterface
3737
{
3838
public:
39-
VelocityFactor get() const { return velocity_factor_; }
40-
void init(const VelocityFactorBehavior behavior) { behavior_ = behavior; }
39+
[[nodiscard]] VelocityFactor get() const { return velocity_factor_; }
40+
void init(const VelocityFactorBehavior & behavior) { behavior_ = behavior; }
4141
void reset() { velocity_factor_.behavior = PlanningBehavior::UNKNOWN; }
4242

4343
void set(
4444
const std::vector<autoware_auto_planning_msgs::msg::PathPointWithLaneId> & points,
4545
const Pose & curr_pose, const Pose & stop_pose, const VelocityFactorStatus status,
46-
const std::string detail = "");
46+
const std::string & detail = "");
4747

4848
private:
4949
VelocityFactorBehavior behavior_{VelocityFactor::UNKNOWN};

common/motion_utils/src/factor/velocity_factor_interface.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ namespace motion_utils
2020
void VelocityFactorInterface::set(
2121
const std::vector<autoware_auto_planning_msgs::msg::PathPointWithLaneId> & points,
2222
const Pose & curr_pose, const Pose & stop_pose, const VelocityFactorStatus status,
23-
const std::string detail)
23+
const std::string & detail)
2424
{
2525
const auto & curr_point = curr_pose.position;
2626
const auto & stop_point = stop_pose.position;
2727
velocity_factor_.behavior = behavior_;
2828
velocity_factor_.pose = stop_pose;
29-
velocity_factor_.distance = motion_utils::calcSignedArcLength(points, curr_point, stop_point);
29+
velocity_factor_.distance =
30+
static_cast<float>(motion_utils::calcSignedArcLength(points, curr_point, stop_point));
3031
velocity_factor_.status = status;
3132
velocity_factor_.detail = detail;
3233
}

0 commit comments

Comments
 (0)