diff --git a/ur_rtde_driver/include/ur_rtde_driver/ur/calibration_checker.h b/ur_rtde_driver/include/ur_rtde_driver/ur/calibration_checker.h index 81b823d..4f0827f 100644 --- a/ur_rtde_driver/include/ur_rtde_driver/ur/calibration_checker.h +++ b/ur_rtde_driver/include/ur_rtde_driver/ur/calibration_checker.h @@ -33,27 +33,63 @@ namespace ur_driver { + /*! + * \brief The CalibrationChecker class consumes primary packages ignoring all but KinematicsInfo + * packages. These are then checked against the used kinematics to see if the correct calibration + * is used. + */ class CalibrationChecker : public comm::IConsumer> { public: + /*! + * \brief Creates a new CalibrationChecker object with an expected hash calculated from the used + * kinematics. + * + * \param expected_hash The expected kinematics hash + */ CalibrationChecker(const std::string& expected_hash); virtual ~CalibrationChecker() = default; + /*! + * \brief Empty setup function, as no setup is needed. + */ virtual void setupConsumer() { } + /*! + * \brief Tears down the consumer. + */ virtual void teardownConsumer() { } + /*! + * \brief Stops the consumer. + */ virtual void stopConsumer() { } + /*! + * \brief Handles timeouts. + */ virtual void onTimeout() { } + /*! + * \brief Consumes a package, checking its hash if it is a KinematicsInfo package. If the hash + * does not match the expected hash, an error is logged. + * + * \param product The package to consume + * + * \returns True, if the package was consumed correctly + */ virtual bool consume(std::shared_ptr> product); + /*! + * \brief Used to make sure the calibration check is not performed several times. + * + * \returns True, if the calibration was already checked, false otherwise + */ bool isChecked() { return checked_; diff --git a/ur_rtde_driver/include/ur_rtde_driver/ur/ur_driver.h b/ur_rtde_driver/include/ur_rtde_driver/ur/ur_driver.h index 554cde0..9128ea5 100644 --- a/ur_rtde_driver/include/ur_rtde_driver/ur/ur_driver.h +++ b/ur_rtde_driver/include/ur_rtde_driver/ur/ur_driver.h @@ -113,10 +113,24 @@ public: */ bool stopControl(); + /*! + * \brief Starts the watchdog checking if the URCaps program is running on the robot and it is + * ready to receive control commands. + */ void startWatchdog(); + /*! + * \brief Checks if the kinematics information in the used model fits the actual robot. + * + * \param checksum Hash of the used kinematics information + */ void checkCalibration(const std::string& checksum); + /*! + * \brief Getter for the RTDE writer used to write to the robot's RTDE interface. + * + * \returns The active RTDE writer + */ rtde_interface::RTDEWriter& getRTDEWriter(); /*!