Skip to content

Commit

Permalink
Merge pull request #358 from lucasw/image_pub_dr_private_namespace
Browse files Browse the repository at this point in the history
Use a shared_ptr for the dynamic reconfigure pointer, and create it w…
  • Loading branch information
Joshua Whitley committed Apr 25, 2019
2 parents 1a2d641 + 3427b70 commit eea2c59
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions image_publisher/src/nodelet/image_publisher_nodelet.cpp
Expand Up @@ -48,7 +48,8 @@ using namespace boost::assign;
namespace image_publisher {
class ImagePublisherNodelet : public nodelet::Nodelet
{
dynamic_reconfigure::Server<image_publisher::ImagePublisherConfig> srv;
typedef dynamic_reconfigure::Server<image_publisher::ImagePublisherConfig> ReconfigureServer;
boost::shared_ptr<ReconfigureServer> srv;

image_transport::CameraPublisher pub_;

Expand Down Expand Up @@ -184,9 +185,10 @@ class ImagePublisherNodelet : public nodelet::Nodelet

timer_ = nh_.createTimer(ros::Duration(1), &ImagePublisherNodelet::do_work, this);

dynamic_reconfigure::Server<image_publisher::ImagePublisherConfig>::CallbackType f =
srv.reset(new ReconfigureServer(getPrivateNodeHandle()));
ReconfigureServer::CallbackType f =
boost::bind(&ImagePublisherNodelet::reconfigureCallback, this, _1, _2);
srv.setCallback(f);
srv->setCallback(f);
}
};
}
Expand Down

0 comments on commit eea2c59

Please sign in to comment.