15
15
#ifndef TEST_CONTROLLER_WITH_INTERFACES__TEST_CONTROLLER_WITH_INTERFACES_HPP_
16
16
#define TEST_CONTROLLER_WITH_INTERFACES__TEST_CONTROLLER_WITH_INTERFACES_HPP_
17
17
18
+ #include < string>
18
19
#include " controller_interface/controller_interface.hpp"
19
20
#include " controller_manager/visibility_control.h"
21
+ #include " hardware_interface/types/hardware_interface_type_values.hpp"
20
22
21
23
namespace test_controller_with_interfaces
22
24
{
23
25
// Corresponds to the name listed within the pluginglib xml
24
26
constexpr char TEST_CONTROLLER_WITH_INTERFACES_CLASS_NAME[] =
25
27
" controller_manager/test_controller_with_interfaces" ;
26
- // Corresponds to the command interface to claim
27
- constexpr char TEST_CONTROLLER_COMMAND_INTERFACE[] = " joint1/effort" ;
28
28
class TestControllerWithInterfaces : public controller_interface ::ControllerInterface
29
29
{
30
30
public:
@@ -38,7 +38,7 @@ class TestControllerWithInterfaces : public controller_interface::ControllerInte
38
38
{
39
39
return controller_interface::InterfaceConfiguration{
40
40
controller_interface::interface_configuration_type::INDIVIDUAL,
41
- {TEST_CONTROLLER_COMMAND_INTERFACE }};
41
+ {joint_name_ + " / " + hardware_interface::HW_IF_EFFORT }};
42
42
}
43
43
44
44
controller_interface::InterfaceConfiguration state_interface_configuration () const override
@@ -61,6 +61,9 @@ class TestControllerWithInterfaces : public controller_interface::ControllerInte
61
61
CONTROLLER_MANAGER_PUBLIC
62
62
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn on_cleanup (
63
63
const rclcpp_lifecycle::State & previous_state) override ;
64
+
65
+ protected:
66
+ std::string joint_name_;
64
67
};
65
68
66
69
} // namespace test_controller_with_interfaces
0 commit comments