From 4016e26c0a5c70309d7ccbe3e3b27fba24c71854 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Mon, 9 Dec 2024 11:05:44 +0000 Subject: [PATCH] Use explicit iterator difference --- joint_trajectory_controller/src/trajectory.cpp | 4 ++-- .../test/test_trajectory_controller_utils.hpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/joint_trajectory_controller/src/trajectory.cpp b/joint_trajectory_controller/src/trajectory.cpp index f91eb3e9d9..57366f88a8 100644 --- a/joint_trajectory_controller/src/trajectory.cpp +++ b/joint_trajectory_controller/src/trajectory.cpp @@ -175,8 +175,8 @@ bool Trajectory::sample( interpolate_between_points(t0, point, t1, next_point, sample_time, output_state); } - start_segment_itr = begin() + static_cast(i); - end_segment_itr = begin() + static_cast(i + 1); + start_segment_itr = begin() + static_cast(i); + end_segment_itr = begin() + static_cast(i + 1); if (search_monotonically_increasing) { last_sample_idx_ = i; diff --git a/joint_trajectory_controller/test/test_trajectory_controller_utils.hpp b/joint_trajectory_controller/test/test_trajectory_controller_utils.hpp index 656bed11d5..b0e66394d1 100644 --- a/joint_trajectory_controller/test/test_trajectory_controller_utils.hpp +++ b/joint_trajectory_controller/test/test_trajectory_controller_utils.hpp @@ -468,7 +468,8 @@ class TrajectoryControllerTest : public ::testing::Test { traj_msg.joint_names = { joint_names_.begin(), - joint_names_.begin() + static_cast(points_positions[0].size())}; + joint_names_.begin() + + static_cast::difference_type>(points_positions[0].size())}; } else {