Skip to content

Commit

Permalink
video_stream: simplify callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
machinekoder committed Nov 17, 2020
1 parent 3cc7361 commit 8ab22a5
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions src/video_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,22 +375,6 @@ virtual void disconnectionCallbackImpl() {
}
}

virtual void connectionCallback(const image_transport::SingleSubscriberPublisher&) {
connectionCallbackImpl();
}

virtual void infoConnectionCallback(const ros::SingleSubscriberPublisher&) {
connectionCallbackImpl();
}

virtual void disconnectionCallback(const image_transport::SingleSubscriberPublisher&) {
disconnectionCallbackImpl();
}

virtual void infoDisconnectionCallback(const ros::SingleSubscriberPublisher&) {
disconnectionCallbackImpl();
}

virtual void configCallback(VideoStreamConfig& new_config, uint32_t level) {
NODELET_DEBUG("configCallback");

Expand Down Expand Up @@ -479,13 +463,13 @@ virtual void onInit() {
dyn_srv->setCallback(f);

image_transport::SubscriberStatusCallback connect_cb =
boost::bind(&VideoStreamNodelet::connectionCallback, this, _1);
boost::bind(&VideoStreamNodelet::connectionCallbackImpl, this);
ros::SubscriberStatusCallback info_connect_cb =
boost::bind(&VideoStreamNodelet::infoConnectionCallback, this, _1);
boost::bind(&VideoStreamNodelet::connectionCallbackImpl, this);
image_transport::SubscriberStatusCallback disconnect_cb =
boost::bind(&VideoStreamNodelet::disconnectionCallback, this, _1);
boost::bind(&VideoStreamNodelet::disconnectionCallbackImpl, this);
ros::SubscriberStatusCallback info_disconnect_cb =
boost::bind(&VideoStreamNodelet::infoDisconnectionCallback, this, _1);
boost::bind(&VideoStreamNodelet::disconnectionCallbackImpl, this);
pub = image_transport::ImageTransport(*nh).advertiseCamera(
"image_raw", 1,
connect_cb, disconnect_cb,
Expand Down

0 comments on commit 8ab22a5

Please sign in to comment.