Skip to content

Commit a9bc501

Browse files
committed
CHG: print modbus config in hardware_interface
1 parent c04b706 commit a9bc501

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

robotiq_hande_driver/hardware/include/robotiq_hande_driver/communication.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,6 @@ class Communication {
8585
int configure() {
8686
int result;
8787

88-
printf(
89-
"Connecting to: %s, %d, %c, %d, %d\n",
90-
tty_port_,
91-
baudrate_,
92-
parity_,
93-
data_bits_,
94-
stop_bit_);
9588
mb_ = modbus_new_rtu(tty_port_, baudrate_, parity_, data_bits_, stop_bit_);
9689
modbus_set_slave(mb_, slave_id_);
9790
modbus_set_debug(mb_, DEBUG_MODBUS);

robotiq_hande_driver/hardware/src/hande_hardware_interface.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,21 @@ HWI::CallbackReturn RobotiqHandeHardwareInterface::on_configure(
7474
const rlccp_lc::State& /*previous_state*/) {
7575
int result;
7676

77+
RCLCPP_INFO(
78+
get_logger(),
79+
"Connecting to tty:%s, baudrate:%d, parity:%c, data_bits:%d, stop_bit:%d",
80+
tty_port_.c_str(),
81+
baudrate_,
82+
parity_,
83+
data_bits_,
84+
stop_bit_);
7785
result = gripper_driver_.configure();
7886

79-
RCLCPP_INFO(get_logger(), "Configured Hand-E Gripper: %d", result);
80-
if(result == FAILURE_MODBUS) return HWI::CallbackReturn::FAILURE;
87+
if(result == FAILURE_MODBUS) {
88+
RCLCPP_INFO(get_logger(), "Failed to configure Hand-E Gripper");
89+
return HWI::CallbackReturn::FAILURE;
90+
}
91+
RCLCPP_INFO(get_logger(), "Configured Hand-E Gripper");
8192
return HWI::CallbackReturn::SUCCESS;
8293
}
8394

0 commit comments

Comments
 (0)