33 #include <urdf_model/model.h>
34 #include <urdf_parser/urdf_parser.h>
58 m_hardware_ready =
false;
69 m_channel_names[channel] =
73 << channel <<
" named " << m_channel_names[channel]);
74 if (m_channel_names[channel] ==
"")
78 <<
". You will not be able to use this device with the controller!");
83 m_joint_state_interface.registerHandle(
85 &m_joint_positions[channel],
86 &m_joint_velocity[channel],
87 &m_joint_effort[channel]));
91 m_joint_state_interface.getHandle(m_channel_names[channel]),
92 &m_joint_position_commands[channel]);
93 m_position_joint_interface.registerHandle(hwi_handle);
98 registerInterface(&m_joint_state_interface);
99 registerInterface(&m_position_joint_interface);
109 if (m_svh->getFingerManager()->isConnected())
114 double cur_pos = 0.0;
115 double cur_cur = 0.0;
133 m_joint_positions[channel] = cur_pos;
134 m_joint_effort[channel] = m_svh->getFingerManager()->convertmAtoN(
138 ROS_DEBUG_STREAM(
"read Position: " << m_joint_positions[0] <<
" " << m_joint_positions[1] <<
" "
139 << m_joint_positions[2] <<
" " << m_joint_positions[3] <<
" "
140 << m_joint_positions[4] <<
" " << m_joint_positions[5] <<
" "
141 << m_joint_positions[6] <<
" " << m_joint_positions[7] <<
" "
142 << m_joint_positions[8]);
148 m_hardware_ready = m_svh->channelsEnabled();
157 << m_joint_position_commands[0] <<
" " << m_joint_position_commands[1] <<
" "
158 << m_joint_position_commands[2] <<
" " << m_joint_position_commands[3] <<
" "
159 << m_joint_position_commands[4] <<
" " << m_joint_position_commands[5] <<
" "
160 << m_joint_position_commands[6] <<
" " << m_joint_position_commands[7] <<
" "
161 << m_joint_position_commands[8]);
165 if (!m_svh->getFingerManager()->setAllTargetPositions(m_joint_position_commands))
173 ROS_ERROR(
"Number of known joints and number of commanded joints do not match!");
178 const std::list<hardware_interface::ControllerInfo>& start_list,
179 const std::list<hardware_interface::ControllerInfo>& stop_list)
185 const std::list<hardware_interface::ControllerInfo>& start_list,
186 const std::list<hardware_interface::ControllerInfo>& stop_list)
193 return m_hardware_ready;