File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
include/hardware_interface Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -33,5 +33,8 @@ namespace hardware_interface
3333HARDWARE_INTERFACE_PUBLIC
3434std::vector<HardwareInfo> parse_control_resources_from_urdf (const std::string & urdf);
3535
36+ HARDWARE_INTERFACE_PUBLIC
37+ bool parse_bool (const std::string & bool_string);
38+
3639} // namespace hardware_interface
3740#endif // HARDWARE_INTERFACE__COMPONENT_PARSER_HPP_
Original file line number Diff line number Diff line change @@ -590,4 +590,9 @@ std::vector<HardwareInfo> parse_control_resources_from_urdf(const std::string &
590590 return hardware_info;
591591}
592592
593+ bool parse_bool (const std::string & bool_string)
594+ {
595+ return bool_string == " true" || bool_string == " True" ;
596+ }
597+
593598} // namespace hardware_interface
Original file line number Diff line number Diff line change 2424#include < string>
2525#include < vector>
2626
27+ #include " hardware_interface/component_parser.hpp"
2728#include " hardware_interface/types/hardware_interface_type_values.hpp"
2829#include " rcutils/logging_macros.h"
2930
@@ -61,8 +62,7 @@ CallbackReturn GenericSystem::on_init(const hardware_interface::HardwareInfo & i
6162 auto it = info_.hardware_parameters .find (" fake_sensor_commands" );
6263 if (it != info_.hardware_parameters .end ())
6364 {
64- // TODO(anyone): change this to parse_bool() (see ros2_control#339)
65- use_fake_sensor_command_interfaces_ = it->second == " true" || it->second == " True" ;
65+ use_fake_sensor_command_interfaces_ = hardware_interface::parse_bool (it->second );
6666 }
6767 else
6868 {
@@ -73,8 +73,7 @@ CallbackReturn GenericSystem::on_init(const hardware_interface::HardwareInfo & i
7373 it = info_.hardware_parameters .find (" fake_gpio_commands" );
7474 if (it != info_.hardware_parameters .end ())
7575 {
76- // TODO(anyone): change this to parse_bool() (see ros2_control#339)
77- use_fake_gpio_command_interfaces_ = it->second == " true" || it->second == " True" ;
76+ use_fake_gpio_command_interfaces_ = hardware_interface::parse_bool (it->second );
7877 }
7978 else
8079 {
You can’t perform that action at this time.
0 commit comments