Skip to content
Snippets Groups Projects
Commit dcaedf54 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Changed the point where the thread is started (from the constructor to the...

Changed the point where the thread is started (from the constructor to the main ROS loop) to avoid executing the thread before ROS is correctly set up.
parent 3fb3b43b
No related branches found
No related tags found
No related merge requests found
......@@ -286,9 +286,6 @@ IriBaseAlgorithm<Algorithm>::IriBaseAlgorithm() :
{
ROS_DEBUG("IriBaseAlgorithm::Constructor");
// create the status thread
pthread_create(&this->thread,NULL,this->mainThread,this);
// // assign callback to dynamic reconfigure server
// dsrv_.setCallback(boost::bind(&IriBaseAlgorithm<Algorithm>::reconfigureCallback, this, _1, _2));
......@@ -354,6 +351,9 @@ int IriBaseAlgorithm<Algorithm>::spin(void)
// 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() && !ctrl_c_hit_count_)
{
// update diagnostics
......
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