Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
class ClassInstance{
   ...
   ClassInstance(){
     dynamic_reconfigure::Server<project_name::ProjectConfig> server;
     dynamic_reconfigure::Server<project_name::ProjectConfig>::CallbackType f;
     f = boost::bind(&ClassInstance::subReconfigureCallback, this, _1, _2);
     server.setCallback(f);
   }
}

This is really more a C++ issue than something to do with ROS, but: you're server variable is not a member of your class, but just an instance that has a scope that is local to the ClassInstance constructor.

On other words: server will only exist for the short time that the c'tor is executed, after which it will be destroyed.

Make server a member variable and then initialise it in your c'tor, that should resolve your issue.