Skip to content

Commit 77212df

Browse files
Rename local variables
1 parent 2531973 commit 77212df

File tree

3 files changed

+23
-20
lines changed

3 files changed

+23
-20
lines changed

ackermann_steering_controller/src/ackermann_steering_controller.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,28 +62,29 @@ bool AckermannSteeringController::update_odometry(const rclcpp::Duration & perio
6262
}
6363
else
6464
{
65-
const double rear_right_wheel_value = state_interfaces_[STATE_TRACTION_RIGHT_WHEEL].get_value();
66-
const double rear_left_wheel_value = state_interfaces_[STATE_TRACTION_LEFT_WHEEL].get_value();
67-
const double front_right_steer_position =
68-
state_interfaces_[STATE_STEER_RIGHT_WHEEL].get_value();
69-
const double front_left_steer_position = state_interfaces_[STATE_STEER_LEFT_WHEEL].get_value();
65+
const double traction_right_wheel_value =
66+
state_interfaces_[STATE_TRACTION_RIGHT_WHEEL].get_value();
67+
const double traction_left_wheel_value =
68+
state_interfaces_[STATE_TRACTION_LEFT_WHEEL].get_value();
69+
const double right_steer_position = state_interfaces_[STATE_STEER_RIGHT_WHEEL].get_value();
70+
const double left_steer_position = state_interfaces_[STATE_STEER_LEFT_WHEEL].get_value();
7071
if (
71-
!std::isnan(rear_right_wheel_value) && !std::isnan(rear_left_wheel_value) &&
72-
!std::isnan(front_right_steer_position) && !std::isnan(front_left_steer_position))
72+
!std::isnan(traction_right_wheel_value) && !std::isnan(traction_left_wheel_value) &&
73+
!std::isnan(right_steer_position) && !std::isnan(left_steer_position))
7374
{
7475
if (params_.position_feedback)
7576
{
7677
// Estimate linear and angular velocity using joint information
7778
odometry_.update_from_position(
78-
rear_right_wheel_value, rear_left_wheel_value, front_right_steer_position,
79-
front_left_steer_position, period.seconds());
79+
traction_right_wheel_value, traction_left_wheel_value, right_steer_position,
80+
left_steer_position, period.seconds());
8081
}
8182
else
8283
{
8384
// Estimate linear and angular velocity using joint information
8485
odometry_.update_from_velocity(
85-
rear_right_wheel_value, rear_left_wheel_value, front_right_steer_position,
86-
front_left_steer_position, period.seconds());
86+
traction_right_wheel_value, traction_left_wheel_value, right_steer_position,
87+
left_steer_position, period.seconds());
8788
}
8889
}
8990
}

bicycle_steering_controller/src/bicycle_steering_controller.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,19 @@ bool BicycleSteeringController::update_odometry(const rclcpp::Duration & period)
6060
}
6161
else
6262
{
63-
const double rear_wheel_value = state_interfaces_[STATE_TRACTION_WHEEL].get_value();
63+
const double traction_wheel_value = state_interfaces_[STATE_TRACTION_WHEEL].get_value();
6464
const double steer_position = state_interfaces_[STATE_STEER_AXIS].get_value();
65-
if (!std::isnan(rear_wheel_value) && !std::isnan(steer_position))
65+
if (!std::isnan(traction_wheel_value) && !std::isnan(steer_position))
6666
{
6767
if (params_.position_feedback)
6868
{
6969
// Estimate linear and angular velocity using joint information
70-
odometry_.update_from_position(rear_wheel_value, steer_position, period.seconds());
70+
odometry_.update_from_position(traction_wheel_value, steer_position, period.seconds());
7171
}
7272
else
7373
{
7474
// Estimate linear and angular velocity using joint information
75-
odometry_.update_from_velocity(rear_wheel_value, steer_position, period.seconds());
75+
odometry_.update_from_velocity(traction_wheel_value, steer_position, period.seconds());
7676
}
7777
}
7878
}

tricycle_steering_controller/src/tricycle_steering_controller.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,26 @@ bool TricycleSteeringController::update_odometry(const rclcpp::Duration & period
6060
}
6161
else
6262
{
63-
const double rear_right_wheel_value = state_interfaces_[STATE_TRACTION_RIGHT_WHEEL].get_value();
64-
const double rear_left_wheel_value = state_interfaces_[STATE_TRACTION_LEFT_WHEEL].get_value();
63+
const double traction_right_wheel_value =
64+
state_interfaces_[STATE_TRACTION_RIGHT_WHEEL].get_value();
65+
const double traction_left_wheel_value =
66+
state_interfaces_[STATE_TRACTION_LEFT_WHEEL].get_value();
6567
const double steer_position = state_interfaces_[STATE_STEER_AXIS].get_value();
6668
if (
67-
!std::isnan(rear_right_wheel_value) && !std::isnan(rear_left_wheel_value) &&
69+
!std::isnan(traction_right_wheel_value) && !std::isnan(traction_left_wheel_value) &&
6870
!std::isnan(steer_position))
6971
{
7072
if (params_.position_feedback)
7173
{
7274
// Estimate linear and angular velocity using joint information
7375
odometry_.update_from_position(
74-
rear_right_wheel_value, rear_left_wheel_value, steer_position, period.seconds());
76+
traction_right_wheel_value, traction_left_wheel_value, steer_position, period.seconds());
7577
}
7678
else
7779
{
7880
// Estimate linear and angular velocity using joint information
7981
odometry_.update_from_velocity(
80-
rear_right_wheel_value, rear_left_wheel_value, steer_position, period.seconds());
82+
traction_right_wheel_value, traction_left_wheel_value, steer_position, period.seconds());
8183
}
8284
}
8385
}

0 commit comments

Comments
 (0)