36 std::shared_ptr<driver_svh::SVHFingerManager>& finger_manager,
37 std::function<
void(
bool)> enable_ros_contol_loop,
38 std::function<
void(uint16_t, uint16_t)> init_controller_parameters,
41 , m_diagnostics_action_server(
47 , m_finger_manager(finger_manager)
48 , m_enable_ros_contol_loop(enable_ros_contol_loop)
49 , m_init_controller_parameters(init_controller_parameters)
56 "diagnostic_info_to_protocol", 1);
73 std::stringstream firmware;
90 schunk_svh_msgs::SVHDiagnosticsFinger finger;
91 finger.channel = channel;
92 finger.current_max_actual = 10;
93 finger.current_min_actual = 100;
94 finger.position_range_actual = 0;
95 finger.encoder =
false;
104 finger.position_range_target =
127 bool basic_test_success =
true;
145 ROS_INFO(
"SVHDiagnostics - Resetting all fingers ...");
153 schunk_svh_msgs::SVHDiagnosticsFinger finger =
m_action_feedback.fingers[channel];
155 for (
int i = 0; i <= 1; i++)
204 if (basic_test_success)
206 ROS_INFO_STREAM(
"SVHDiagnostics - Basic test by reset routine for the Hand: SVH "
208 <<
" was: " << (basic_test_success ?
"successfull" :
"FAILED!"));
217 schunk_svh_msgs::SVHDiagnosticsResult action_result;
219 action_result.result = -1;
220 action_result.channel = -1;
234 schunk_svh_msgs::SVHDiagnosticsResult action_result;
237 action_result.channel = -1;
251 ROS_WARN_STREAM(
"SVHDiagnostics::evaluateBasicTest: failure of : 1nd controller board both "
252 "encoder and motor");
253 return action_result;
265 ROS_WARN_STREAM(
"SVHDiagnostics::evaluateBasicTest: failure of : 2nd controller board both "
266 "encoder and motor");
267 return action_result;
278 ROS_WARN_STREAM(
"SVHDiagnostics::evaluateBasicTest: failure of : 1nd controller board encoder");
279 return action_result;
288 ROS_WARN_STREAM(
"SVHDiagnostics::evaluateBasicTest: failure of : 1nd controller board motor");
289 return action_result;
299 ROS_WARN_STREAM(
"SVHDiagnostics::evaluateBasicTest: failure of : 2nd controller board encoder");
300 return action_result;
308 ROS_WARN_STREAM(
"SVHDiagnostics::evaluateBasicTest: failure of : 2nd controller board motor");
309 return action_result;
319 action_result.channel = i;
321 "SVHDiagnostics::evaluateBasicTest: encoder and motor failure, finger: " << i);
322 return action_result;
331 action_result.result =
encoder;
332 action_result.channel = i;
333 ROS_WARN_STREAM(
"SVHDiagnostics::evaluateBasicTest: encoder not working, finger: " << i);
334 return action_result;
343 action_result.result =
motor;
344 action_result.channel = i;
345 ROS_WARN_STREAM(
"SVHDiagnostics::evaluateBasicTest: motor not working, finger: " << i);
346 return action_result;
359 action_result.channel = i;
361 "SVHDiagnostics::evaluateBasicTest: motor don't get enough current, finger: " << i);
362 return action_result;
373 action_result.channel = i;
375 "SVHDiagnostics::evaluateBasicTest: position range is not enough, finger: " << i);
376 return action_result;
382 ROS_DEBUG(
"No error detected! Basic test successfully");
383 return action_result;
390 schunk_svh_msgs::SVHDiagnosticsFinger finger =
m_action_feedback.fingers[channel];
391 finger.current_max_actual = 0;
392 finger.current_min_actual = 0;
393 finger.position_range_actual = 0;
394 finger.encoder =
false;
395 finger.motor =
false;
411 for (
size_t channel = 0; channel <
reset_success.size(); ++channel)
419 double desired_current_neg, desired_current_pos;
420 double max_current, min_current;
421 double max_position, min_position;
434 <<
" reset: \t" << (
reset_success[channel] ?
"OK" :
"FAILED"));
435 ROS_INFO_STREAM(
"Maximal position: " << max_position <<
"\t minimal position: " << min_position
436 <<
"\t maximal current: " << max_current <<
" / "
437 << desired_current_pos
438 <<
"\t minimal current: " << min_current <<
" / "
439 << desired_current_neg <<
" deadlock: " << deadlock);
440 ROS_INFO_STREAM(
"Position range: " << max_position - min_position <<
" max position: "
441 << max_position <<
" min position: " << min_position);