Commit 05c6c6b 1 parent 37c1caa commit 05c6c6b Copy full SHA for 05c6c6b
File tree 3 files changed +11
-4
lines changed
include/hardware_interface
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 (" fake_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_fake_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
{
@@ -73,8 +73,7 @@ CallbackReturn GenericSystem::on_init(const hardware_interface::HardwareInfo & i
73
73
it = info_.hardware_parameters .find (" fake_gpio_commands" );
74
74
if (it != info_.hardware_parameters .end ())
75
75
{
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 );
78
77
}
79
78
else
80
79
{
You can’t perform that action at this time.
0 commit comments