diff --git a/ada_feeding/ada_feeding/behaviors/move_to.py b/ada_feeding/ada_feeding/behaviors/move_to.py index e53c7162..b6f0c36f 100644 --- a/ada_feeding/ada_feeding/behaviors/move_to.py +++ b/ada_feeding/ada_feeding/behaviors/move_to.py @@ -426,15 +426,13 @@ def scale_velocity(traj: JointTrajectory, scale_factor: float) -> None: point.time_from_start.nanosec = int(nsec - sec * 10.0**9) # Scale the velocities - for i in range( - len(point.velocities) - ): # pylint: disable=consider-using-enumerate + # pylint: disable=consider-using-enumerate + # Necessary because we want to destructively modify the trajectory + for i in range(len(point.velocities)): point.velocities[i] *= scale_factor # Scale the accelerations - for i in range( - len(point.accelerations) - ): # pylint: disable=consider-using-enumerate + for i in range(len(point.accelerations)): point.accelerations[i] *= scale_factor**2