Skip to content

Commit

Permalink
reference in for
Browse files Browse the repository at this point in the history
  • Loading branch information
kminoda authored Nov 16, 2022
1 parent 5759326 commit 74d38f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions localization/gyro_odometer/src/gyro_odometer_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ geometry_msgs::msg::TwistWithCovarianceStamped get_twist_from_velocity_buffer(
}

int n = static_cast<int>(velocity_buffer.size());
for (const auto vel : velocity_buffer) {
for (const auto & vel : velocity_buffer) {
twist_with_cov.twist.twist.linear.x += vel.twist.twist.linear.x;
twist_with_cov.twist.covariance[0] += vel.twist.covariance[0];
}
Expand All @@ -57,7 +57,7 @@ geometry_msgs::msg::TwistWithCovarianceStamped get_twist_from_gyro_buffer(
}

int n = static_cast<int>(gyro_buffer.size());
for (const auto gyro : gyro_buffer) {
for (const auto & gyro : gyro_buffer) {
twist_with_cov.twist.twist.angular.x += gyro.twist.twist.angular.x;
twist_with_cov.twist.twist.angular.y += gyro.twist.twist.angular.y;
twist_with_cov.twist.twist.angular.z += gyro.twist.twist.angular.z;
Expand Down

0 comments on commit 74d38f4

Please sign in to comment.