Skip to content
Snippets Groups Projects
Commit bb685e61 authored by Alejandro Lopez Gestoso's avatar Alejandro Lopez Gestoso
Browse files

Merge branch 'melodic_migration' into 'master'

Added a new spin function (nodelet_spin) to be used in nodelets where the...

See merge request !2
parents 1fc12a34 9386bc22
No related branches found
1 merge request!2Added a new spin function (nodelet_spin) to be used in nodelets where the...
......@@ -152,6 +152,8 @@ class IriBaseAlgorithm
*/
int spin(void);
int nodelet_spin(void);
private:
/**
* \brief ros spin thread
......@@ -380,6 +382,35 @@ int IriBaseAlgorithm<Algorithm>::spin(void)
return 0;
}
template <class Algorithm>
int IriBaseAlgorithm<Algorithm>::nodelet_spin(void)
{
ROS_DEBUG("IriBaseAlgorithm::spin");
// initialize diagnostics
this->diagnostic_.setHardwareID("none");
this->addDiagnostics();
// assign callback to dynamic reconfigure server
this->dsrv_.setCallback(boost::bind(&IriBaseAlgorithm<Algorithm>::reconfigureCallback, this, _1, _2));
// create the status thread
pthread_create(&this->thread,NULL,this->mainThread,this);
while(ros::ok())
{
// update diagnostics
this->diagnostic_.update();
ros::WallDuration(this->diagnostic_.getPeriod()).sleep();
}
// stop ros
ros::shutdown();
return 0;
}
// definition of the static Ctrl+C counter
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment