Skip to content

Commit 26b7a0e

Browse files
saikishormergify[bot]
authored andcommitted
expose get_data_type method in loaned interfaces (#2351)
(cherry picked from commit 7f92700) # Conflicts: # hardware_interface/include/hardware_interface/loaned_command_interface.hpp # hardware_interface/include/hardware_interface/loaned_state_interface.hpp
1 parent 2a03e11 commit 26b7a0e

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

hardware_interface/include/hardware_interface/actuator_interface.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,8 @@ class ActuatorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNod
559559
return opt_value.value();
560560
}
561561

562-
void set_command(const std::string & interface_name, const double & value)
562+
template <typename T>
563+
void set_command(const std::string & interface_name, const T & value)
563564
{
564565
auto it = actuator_commands_.find(interface_name);
565566
if (it == actuator_commands_.end())

hardware_interface/include/hardware_interface/loaned_command_interface.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ class LoanedCommandInterface
180180
}
181181

182182
/**
183+
<<<<<<< HEAD
183184
* @brief Get the value of the command interface.
184185
* @tparam T The type of the value to be retrieved.
185186
* @param value The value of the command interface.
@@ -208,6 +209,12 @@ class LoanedCommandInterface
208209
}
209210
return false;
210211
}
212+
=======
213+
* @brief Get the data type of the command interface.
214+
* @return The data type of the command interface.
215+
*/
216+
HandleDataType get_data_type() const { return command_interface_.get_data_type(); }
217+
>>>>>>> 7f92700 (expose get_data_type method in loaned interfaces (#2351))
211218

212219
protected:
213220
CommandInterface & command_interface_;

hardware_interface/include/hardware_interface/loaned_state_interface.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ class LoanedStateInterface
140140
}
141141

142142
/**
143+
<<<<<<< HEAD
143144
* @brief Get the value of the state interface.
144145
* @tparam T The type of the value to be retrieved.
145146
* @param value The value of the state interface.
@@ -168,6 +169,12 @@ class LoanedStateInterface
168169
}
169170
return false;
170171
}
172+
=======
173+
* @brief Get the data type of the state interface.
174+
* @return The data type of the state interface.
175+
*/
176+
HandleDataType get_data_type() const { return state_interface_.get_data_type(); }
177+
>>>>>>> 7f92700 (expose get_data_type method in loaned interfaces (#2351))
171178

172179
protected:
173180
const StateInterface & state_interface_;

hardware_interface/include/hardware_interface/system_interface.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,8 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI
589589
return opt_value.value();
590590
}
591591

592-
void set_command(const std::string & interface_name, const double & value)
592+
template <typename T>
593+
void set_command(const std::string & interface_name, const T & value)
593594
{
594595
auto it = system_commands_.find(interface_name);
595596
if (it == system_commands_.end())

0 commit comments

Comments
 (0)