@@ -341,8 +341,8 @@ return_type URPositionHardwareInterface::start()
341341 ur_driver_ = std::make_unique<urcl::UrDriver>(
342342 robot_ip, script_filename, output_recipe_filename, input_recipe_filename,
343343 std::bind (&URPositionHardwareInterface::handleRobotProgramState, this , std::placeholders::_1), headless_mode,
344- std::move (tool_comm_setup), calibration_checksum, (uint32_t )reverse_port, (uint32_t )script_sender_port,
345- servoj_gain, servoj_lookahead_time, non_blocking_read_);
344+ std::move (tool_comm_setup), (uint32_t )reverse_port, (uint32_t )script_sender_port, servoj_gain ,
345+ servoj_lookahead_time, non_blocking_read_);
346346 } catch (urcl::ToolCommNotAvailable& e) {
347347 RCLCPP_FATAL_STREAM (rclcpp::get_logger (" URPositionHardwareInterface" ), " See parameter use_tool_communication" );
348348
@@ -351,6 +351,28 @@ return_type URPositionHardwareInterface::start()
351351 RCLCPP_FATAL_STREAM (rclcpp::get_logger (" URPositionHardwareInterface" ), e.what ());
352352 return return_type::ERROR;
353353 }
354+ RCLCPP_INFO (rclcpp::get_logger (" URPositionHardwareInterface" ), " Calibration checksum: '%s'." ,
355+ calibration_checksum.c_str ());
356+ // check calibration
357+ // https://github.com/UniversalRobots/Universal_Robots_ROS_Driver/blob/c3378599d5fa73a261328b326392e847f312ab6b/ur_robot_driver/src/hardware_interface.cpp#L296-L309
358+ if (ur_driver_->checkCalibration (calibration_checksum)) {
359+ RCLCPP_INFO (rclcpp::get_logger (" URPositionHardwareInterface" ), " Calibration checked successfully." );
360+ } else {
361+ RCLCPP_ERROR_STREAM (rclcpp::get_logger (" URPositionHardwareInterface" ), " The calibration parameters of the "
362+ " connected robot don't match the ones from "
363+ " the given kinematics "
364+ " config file. Please be aware that this can "
365+ " lead to critical inaccuracies of tcp "
366+ " positions. Use "
367+ " the ur_calibration tool to extract the "
368+ " correct calibration from the robot and "
369+ " pass that into the "
370+ " description. See "
371+ " [https://github.com/UniversalRobots/"
372+ " Universal_Robots_ROS_Driver#extract-"
373+ " calibration-information] "
374+ " for details." );
375+ }
354376
355377 ur_driver_->startRTDECommunication ();
356378
0 commit comments