Skip to content

Commit

Permalink
fix(odrive_can_driver): use reference in loop for exporting state and…
Browse files Browse the repository at this point in the history
… command interfaces
  • Loading branch information
Wihmajster committed Dec 4, 2024
1 parent a0e6e82 commit ba48869
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions odrive_can_driver/src/odrive_hardware_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ std::vector<hardware_interface::StateInterface> OdriveHardwareInterface::export_
{
std::vector<hardware_interface::StateInterface> state_interfaces;
state_interfaces.reserve(static_cast<size_t>(motor_axis_interface_.size() * 3));
for (auto axis_interface : motor_axis_interface_) {
for (auto & axis_interface : motor_axis_interface_) {
state_interfaces.emplace_back(
axis_interface.JointName(), hardware_interface::HW_IF_POSITION,
&axis_interface.position_state);
Expand All @@ -209,7 +209,7 @@ OdriveHardwareInterface::export_command_interfaces()
{
std::vector<hardware_interface::CommandInterface> command_interfaces;
command_interfaces.reserve(static_cast<size_t>(motor_axis_interface_.size() * 3));
for (auto axis_interface : motor_axis_interface_) {
for (auto & axis_interface : motor_axis_interface_) {
command_interfaces.emplace_back(
axis_interface.JointName(), hardware_interface::HW_IF_POSITION,
&axis_interface.position_command);
Expand Down

0 comments on commit ba48869

Please sign in to comment.