Skip to content
Snippets Groups Projects
Commit 442e7d16 authored by Joan Perez Ibarz's avatar Joan Perez Ibarz
Browse files

- fixing bug for base algorithm. Pure virtual function was called in...

- fixing bug for base algorithm. Pure virtual function was called in reconfigure callback. Now initialization is done in spin instead of constructor
parent 9e8800a4
No related branches found
No related tags found
No related merge requests found
......@@ -310,8 +310,8 @@ IriBaseAlgorithm<Algorithm>::IriBaseAlgorithm() :
this->thread_server_->create_thread(this->main_thread_id_);
this->thread_server_->attach_thread(this->main_thread_id_, this->mainThread, this);
// assign callback to dynamic reconfigure server
dsrv_.setCallback(boost::bind(&IriBaseAlgorithm<Algorithm>::reconfigureCallback, this, _1, _2));
// // assign callback to dynamic reconfigure server
// dsrv_.setCallback(boost::bind(&IriBaseAlgorithm<Algorithm>::reconfigureCallback, this, _1, _2));
}
template <class Algorithm>
......@@ -325,8 +325,11 @@ IriBaseAlgorithm<Algorithm>::~IriBaseAlgorithm()
template <class Algorithm>
void IriBaseAlgorithm<Algorithm>::reconfigureCallback(Config &config, uint32_t level)
{
node_config_update(config, level);
ROS_INFO("IriBaseAlgorithm::reconfigureCallback");
this->node_config_update(config, level);
ROS_INFO("IriBaseAlgorithm::reconfigureCallback: node_config_update");
this->alg_.config_update(config, level);
ROS_INFO("IriBaseAlgorithm::reconfigureCallback: alg_.config_update");
}
template <class Algorithm>
......@@ -368,7 +371,10 @@ int IriBaseAlgorithm<Algorithm>::spin(void)
// launch ros spin in different thread
this->ros_thread_.reset( new boost::thread(boost::bind(&ros::spin)) );
assert(ros_thread_);
// assign callback to dynamic reconfigure server
this->dsrv_.setCallback(boost::bind(&IriBaseAlgorithm<Algorithm>::reconfigureCallback, this, _1, _2));
// launch node thread
this->thread_server_->start_thread( this->main_thread_id_);
......
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