diff --git a/include/iri_base_driver/iri_base_driver_node.h b/include/iri_base_driver/iri_base_driver_node.h index 7225f9c427d60774057d5f2e14fb8f91552160bb..18437db79466ebe149047cc14ceacd4d5f60902b 100644 --- a/include/iri_base_driver/iri_base_driver_node.h +++ b/include/iri_base_driver/iri_base_driver_node.h @@ -351,6 +351,9 @@ IriBaseNodeDriver<Driver>::IriBaseNodeDriver(const ros::NodeHandle &nh) : // initialize class attributes // allow Ctrl+C management signal(SIGHUP, &IriBaseNodeDriver<Driver>::hupCalled); + + // set the diagnostic updater period + this->private_node_handle_.setParam("diagnostic_period",0.1); } template <class Driver> @@ -536,7 +539,7 @@ int IriBaseNodeDriver<Driver>::spin(void) // update diagnostics this->diagnostic_.update(); - ros::WallDuration(0.1).sleep(); + ros::WallDuration(this->diagnostic_.getPeriod()).sleep(); } // try to go to the closed state