Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse import_state_interface_descriptions and import_command_interface_descriptions #1766

Closed
saikishor opened this issue Sep 26, 2024 · 0 comments · Fixed by #1768
Closed
Assignees

Comments

@saikishor
Copy link
Member

As we discussed in yesterday's WG meeting, once the #1688 is merged, we would like to modify the import_state_interface_descriptions and import_command_interface_descriptions instead of parsing the hardware info to them, we simply parse the hardware_info_.joints and hardware_info_.sensors and it imports accordingly etc

  void import_state_interface_descriptions(const HardwareInfo & hardware_info)
  {
    auto joint_state_interface_descriptions =
      parse_state_interface_descriptions(hardware_info.joints);
    for (const auto & description : joint_state_interface_descriptions)
    {
      joint_state_interfaces_.insert(std::make_pair(description.get_name(), description));
    }
  }
  void import_state_interface_descriptions(const std::vector<ComponentInfo> & components_info)
  {
    auto state_interface_descriptions =
      parse_state_interface_descriptions(components_info);
    for (const auto & description : state_interface_descriptions)
    {
      joint_state_interfaces_.insert(std::make_pair(description.get_name(), description));
    }
  }

import_state_interface_descriptions(info_.joints);
import_state_interface_descriptions(info_.sensors);
import_state_interface_descriptions(info_.gpios);

This can be done once the #1688 is merged! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant