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
33
33
HARDWARE_INTERFACE_PUBLIC
34
34
std::vector<HardwareInfo> parse_control_resources_from_urdf (const std::string & urdf);
35
35
36
+ HARDWARE_INTERFACE_PUBLIC
37
+ bool parse_bool (const std::string & bool_string);
38
+
36
39
} // namespace hardware_interface
37
40
#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 &
590
590
return hardware_info;
591
591
}
592
592
593
+ bool parse_bool (const std::string & bool_string)
594
+ {
595
+ return bool_string == " true" || bool_string == " True" ;
596
+ }
597
+
593
598
} // namespace hardware_interface
Original file line number Diff line number Diff line change 24
24
#include < string>
25
25
#include < vector>
26
26
27
+ #include " hardware_interface/component_parser.hpp"
27
28
#include " hardware_interface/types/hardware_interface_type_values.hpp"
28
29
#include " rcutils/logging_macros.h"
29
30
@@ -61,8 +62,7 @@ CallbackReturn GenericSystem::on_init(const hardware_interface::HardwareInfo & i
61
62
auto it = info_.hardware_parameters .find (" mock_sensor_commands" );
62
63
if (it != info_.hardware_parameters .end ())
63
64
{
64
- // TODO(anyone): change this to parse_bool() (see ros2_control#339)
65
- use_mock_sensor_command_interfaces_ = it->second == " true" || it->second == " True" ;
65
+ use_fake_sensor_command_interfaces_ = hardware_interface::parse_bool (it->second );
66
66
}
67
67
else
68
68
{
@@ -86,8 +86,7 @@ CallbackReturn GenericSystem::on_init(const hardware_interface::HardwareInfo & i
86
86
it = info_.hardware_parameters .find (" fake_gpio_commands" );
87
87
if (it != info_.hardware_parameters .end ())
88
88
{
89
- // TODO(anyone): change this to parse_bool() (see ros2_control#339)
90
- use_fake_gpio_command_interfaces_ = it->second == " true" || it->second == " True" ;
89
+ use_fake_gpio_command_interfaces_ = hardware_interface::parse_bool (it->second );
91
90
}
92
91
else
93
92
{
You can’t perform that action at this time.
0 commit comments