Skip to content

Commit

Permalink
rename the variable for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
saikishor committed Oct 8, 2024
1 parent c48e3c7 commit 6030cbc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class ChainableControllerInterface : public ControllerInterfaceBase
// END
std::vector<hardware_interface::CommandInterface::SharedPtr> ordered_reference_interfaces_;
std::unordered_map<std::string, hardware_interface::CommandInterface::SharedPtr>
reference_interfaces_ptrs_;
exported_reference_interfaces_;

private:
/// A flag marking if a chainable controller is currently preceded by another controller.
Expand Down
9 changes: 5 additions & 4 deletions controller_interface/src/chainable_controller_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ ChainableControllerInterface::export_reference_interfaces()
std::make_shared<hardware_interface::CommandInterface>(std::move(interface));
const auto interface_name = reference_interface->get_interface_name();
// check the exported interface name is unique
auto [it, succ] = reference_interfaces_ptrs_.insert({interface_name, reference_interface});
auto [it, succ] = exported_reference_interfaces_.insert({interface_name, reference_interface});
// either we have name duplicate which we want to avoid under all circumstances since interfaces
// need to be uniquely identify able or something else really went wrong. In any case abort and
// inform cm by throwing exception
Expand All @@ -174,11 +174,12 @@ ChainableControllerInterface::export_reference_interfaces()
reference_interfaces_ptrs_vec.push_back(reference_interface);
}

if (reference_interfaces_ptrs_.size() != ref_interface_size)
if (exported_reference_interfaces_.size() != ref_interface_size)
{
std::string error_msg =
"The internal storage for reference ptrs 'reference_interfaces_ptrs_' variable has size '" +
std::to_string(reference_interfaces_ptrs_.size()) +
"The internal storage for exported reference ptrs 'exported_reference_interfaces_' variable "
"has size '" +
std::to_string(exported_reference_interfaces_.size()) +
"', but it is expected to have the size '" + std::to_string(ref_interface_size) +
"' equal to the number of exported reference interfaces. Please correct and recompile the "
"controller with name '" +
Expand Down

0 comments on commit 6030cbc

Please sign in to comment.