1919#include < vector>
2020
2121#include " hardware_interface/macros.hpp"
22- #include " rcutils/logging_macros.h "
22+ #include " rclcpp/rclcpp.hpp "
2323
2424namespace hardware_interface
2525{
@@ -80,8 +80,9 @@ RobotHardware::get_joint_state_handle(
8080 const std::string & name, const JointStateHandle ** joint_state_handle)
8181{
8282 if (name.empty ()) {
83- RCUTILS_LOG_ERROR_NAMED (
84- " joint state handle" , " cannot get handle! No name given" );
83+ RCLCPP_ERROR (
84+ rclcpp::get_logger (" joint state handle" ),
85+ " cannot get handle! No name given" );
8586 return HW_RET_ERROR;
8687 }
8788
@@ -94,8 +95,9 @@ RobotHardware::get_joint_state_handle(
9495 });
9596
9697 if (handle_pos == registered_joint_state_handles_.end ()) {
97- RCUTILS_LOG_ERROR_NAMED (
98- " joint state handle" , " cannot get handle. No joint %s found.\n " , name.c_str ());
98+ RCLCPP_ERROR (
99+ rclcpp::get_logger (" joint state handle" ),
100+ " cannot get handle. No joint %s found.\n " , name.c_str ());
99101 return HW_RET_ERROR;
100102 }
101103
@@ -108,8 +110,9 @@ RobotHardware::get_joint_command_handle(
108110 const std::string & name, JointCommandHandle ** joint_command_handle)
109111{
110112 if (name.empty ()) {
111- RCUTILS_LOG_ERROR_NAMED (
112- " joint cmd handle" , " cannot get handle! No name given" );
113+ RCLCPP_ERROR (
114+ rclcpp::get_logger (" joint cmd handle" ),
115+ " cannot get handle! No name given" );
113116 return HW_RET_ERROR;
114117 }
115118
@@ -122,8 +125,9 @@ RobotHardware::get_joint_command_handle(
122125 });
123126
124127 if (handle_pos == registered_joint_command_handles_.end ()) {
125- RCUTILS_LOG_ERROR_NAMED (
126- " joint cmd handle" , " cannot get handle. No joint %s found.\n " , name.c_str ());
128+ RCLCPP_ERROR (
129+ rclcpp::get_logger (" joint cmd handle" ),
130+ " cannot get handle. No joint %s found.\n " , name.c_str ());
127131 return HW_RET_ERROR;
128132 }
129133
@@ -136,8 +140,9 @@ RobotHardware::get_operation_mode_handle(
136140 const std::string & name, OperationModeHandle ** operation_mode_handle)
137141{
138142 if (name.empty ()) {
139- RCUTILS_LOG_ERROR_NAMED (
140- " joint operation mode handle" , " cannot get handle! No name given" );
143+ RCLCPP_ERROR (
144+ rclcpp::get_logger (" joint operation mode handle" ),
145+ " cannot get handle! No name given" );
141146 return HW_RET_ERROR;
142147 }
143148
@@ -150,8 +155,9 @@ RobotHardware::get_operation_mode_handle(
150155 });
151156
152157 if (handle_pos == registered_operation_mode_handles_.end ()) {
153- RCUTILS_LOG_ERROR_NAMED (
154- " joint operation mode handle" , " cannot get handle. No joint %s found.\n " , name.c_str ());
158+ RCLCPP_ERROR (
159+ rclcpp::get_logger (" joint operation mode handle" ),
160+ " cannot get handle. No joint %s found.\n " , name.c_str ());
155161 return HW_RET_ERROR;
156162 }
157163
0 commit comments