Skip to content

Commit

Permalink
use unordered map and adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mamueluth committed Jan 29, 2024
1 parent 5e4118b commit b5f9b4d
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#define HARDWARE_INTERFACE__ACTUATOR_INTERFACE_HPP_

#include <limits>
#include <map>
#include <memory>
#include <string>
#include <unordered_map>
Expand Down Expand Up @@ -356,8 +355,8 @@ class ActuatorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNod

protected:
HardwareInfo info_;
std::map<std::string, InterfaceDescription> joint_state_interfaces_;
std::map<std::string, InterfaceDescription> joint_command_interfaces_;
std::unordered_map<std::string, InterfaceDescription> joint_state_interfaces_;
std::unordered_map<std::string, InterfaceDescription> joint_command_interfaces_;

std::unordered_map<std::string, std::shared_ptr<StateInterface>> actuator_states_;
std::unordered_map<std::string, std::shared_ptr<CommandInterface>> actuator_commands_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#define HARDWARE_INTERFACE__SENSOR_INTERFACE_HPP_

#include <limits>
#include <map>
#include <memory>
#include <string>
#include <unordered_map>
Expand Down Expand Up @@ -224,7 +223,7 @@ class SensorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI
protected:
HardwareInfo info_;

std::map<std::string, InterfaceDescription> sensor_state_interfaces_;
std::unordered_map<std::string, InterfaceDescription> sensor_state_interfaces_;

std::unordered_map<std::string, std::shared_ptr<StateInterface>> sensor_states_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#define HARDWARE_INTERFACE__SYSTEM_INTERFACE_HPP_

#include <limits>
#include <map>
#include <memory>
#include <string>
#include <unordered_map>
Expand Down Expand Up @@ -396,13 +395,13 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI

protected:
HardwareInfo info_;
std::map<std::string, InterfaceDescription> joint_state_interfaces_;
std::map<std::string, InterfaceDescription> joint_command_interfaces_;
std::unordered_map<std::string, InterfaceDescription> joint_state_interfaces_;
std::unordered_map<std::string, InterfaceDescription> joint_command_interfaces_;

std::map<std::string, InterfaceDescription> sensor_state_interfaces_;
std::unordered_map<std::string, InterfaceDescription> sensor_state_interfaces_;

std::map<std::string, InterfaceDescription> gpio_state_interfaces_;
std::map<std::string, InterfaceDescription> gpio_command_interfaces_;
std::unordered_map<std::string, InterfaceDescription> gpio_state_interfaces_;
std::unordered_map<std::string, InterfaceDescription> gpio_command_interfaces_;

std::unordered_map<std::string, std::shared_ptr<StateInterface>> system_states_;
std::unordered_map<std::string, std::shared_ptr<CommandInterface>> system_commands_;
Expand Down
Loading

0 comments on commit b5f9b4d

Please sign in to comment.