Skip to content

Commit

Permalink
in read/write, replace if-else clauses with if clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
Nibanovic committed Jul 31, 2024
1 parent 44b901d commit ffc3c74
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions admittance_controller/src/admittance_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,13 @@ void AdmittanceController::read_state_from_hardware(
state_interfaces_[pos_ind * num_joints_ + joint_ind].get_value();
nan_position |= std::isnan(state_current.positions[joint_ind]);
}
else if (has_velocity_state_interface_)
if (has_velocity_state_interface_)
{
state_current.velocities[joint_ind] =
state_interfaces_[vel_ind * num_joints_ + joint_ind].get_value();
nan_velocity |= std::isnan(state_current.velocities[joint_ind]);
}
else if (has_acceleration_state_interface_)
if (has_acceleration_state_interface_)
{
state_current.accelerations[joint_ind] =
state_interfaces_[acc_ind * num_joints_ + joint_ind].get_value();
Expand Down Expand Up @@ -528,12 +528,12 @@ void AdmittanceController::write_state_to_hardware(
command_interfaces_[pos_ind * num_joints_ + joint_ind].set_value(
state_commanded.positions[joint_ind]);
}
else if (has_velocity_command_interface_)
if (has_velocity_command_interface_)
{
command_interfaces_[vel_ind * num_joints_ + joint_ind].set_value(
state_commanded.velocities[joint_ind]);
}
else if (has_acceleration_command_interface_)
if (has_acceleration_command_interface_)
{
command_interfaces_[acc_ind * num_joints_ + joint_ind].set_value(
state_commanded.accelerations[joint_ind]);
Expand Down

0 comments on commit ffc3c74

Please sign in to comment.