Skip to content

Commit

Permalink
Satisfy clang 18 (#467)
Browse files Browse the repository at this point in the history
(cherry picked from commit ff8dd8b)
  • Loading branch information
christophfroehlich authored and mergify[bot] committed Mar 11, 2024
1 parent 5b7ff59 commit 2973a09
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions example_8/hardware/rrbot_transmissions_system_position_only.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ hardware_interface::return_type RRBotTransmissionsSystemPositionOnlyHardware::re
{
// actuator: state -> transmission
std::for_each(
actuator_interfaces_.begin(), actuator_interfaces_.end(),
[](auto & actuator_interface)
actuator_interfaces_.begin(), actuator_interfaces_.end(), [](auto & actuator_interface)
{ actuator_interface.transmission_passthrough_ = actuator_interface.state_; });

// transmission: actuator -> joint
Expand All @@ -242,8 +241,7 @@ hardware_interface::return_type RRBotTransmissionsSystemPositionOnlyHardware::re

// joint: transmission -> state
std::for_each(
joint_interfaces_.begin(), joint_interfaces_.end(),
[](auto & joint_interface)
joint_interfaces_.begin(), joint_interfaces_.end(), [](auto & joint_interface)
{ joint_interface.state_ = joint_interface.transmission_passthrough_; });

// log state data
Expand All @@ -253,8 +251,7 @@ hardware_interface::return_type RRBotTransmissionsSystemPositionOnlyHardware::re
{
// again, this only for simple transmissions, we know there is only one joint
const auto joint_interface = std::find_if(
joint_interfaces_.cbegin(), joint_interfaces_.cend(),
[&](const auto & joint_interface)
joint_interfaces_.cbegin(), joint_interfaces_.cend(), [&](const auto & joint_interface)
{ return joint_interface.name_ == transmission_info.joints[0].name; });

const auto actuator_interface = std::find_if(
Expand All @@ -279,8 +276,7 @@ hardware_interface::return_type RRBotTransmissionsSystemPositionOnlyHardware::wr
{
// joint: command -> transmission
std::for_each(
joint_interfaces_.begin(), joint_interfaces_.end(),
[](auto & joint_interface)
joint_interfaces_.begin(), joint_interfaces_.end(), [](auto & joint_interface)
{ joint_interface.transmission_passthrough_ = joint_interface.command_; });

// transmission: joint -> actuator
Expand All @@ -290,8 +286,7 @@ hardware_interface::return_type RRBotTransmissionsSystemPositionOnlyHardware::wr

// actuator: transmission -> command
std::for_each(
actuator_interfaces_.begin(), actuator_interfaces_.end(),
[](auto & actuator_interface)
actuator_interfaces_.begin(), actuator_interfaces_.end(), [](auto & actuator_interface)
{ actuator_interface.command_ = actuator_interface.transmission_passthrough_; });

// simulate motor motion
Expand All @@ -311,8 +306,7 @@ hardware_interface::return_type RRBotTransmissionsSystemPositionOnlyHardware::wr
{
// again, this only for simple transmissions, we know there is only one joint
const auto joint_interface = std::find_if(
joint_interfaces_.cbegin(), joint_interfaces_.cend(),
[&](const auto & joint_interface)
joint_interfaces_.cbegin(), joint_interfaces_.cend(), [&](const auto & joint_interface)
{ return joint_interface.name_ == transmission_info.joints[0].name; });

const auto actuator_interface = std::find_if(
Expand Down

0 comments on commit 2973a09

Please sign in to comment.