00001 /****************************************************************************** 00002 Copyright (c) 2017, Intel Corporation 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without 00006 modification, are permitted provided that the following conditions are met: 00007 00008 1. Redistributions of source code must retain the above copyright notice, this 00009 list of conditions and the following disclaimer. 00010 00011 2. Redistributions in binary form must reproduce the above copyright notice, 00012 this list of conditions and the following disclaimer in the documentation 00013 and/or other materials provided with the distribution. 00014 00015 3. Neither the name of the copyright holder nor the names of its contributors 00016 may be used to endorse or promote products derived from this software without 00017 specific prior written permission. 00018 00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00020 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00021 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00022 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00023 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00024 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00025 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00026 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00027 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00028 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00029 *******************************************************************************/ 00030 00031 #pragma once 00032 #ifndef REALSENSE_CAMERA_SYNC_NODELET_H 00033 #define REALSENSE_CAMERA_SYNC_NODELET_H 00034 00035 #include <realsense_camera/base_nodelet.h> 00036 #include <boost/thread.hpp> 00037 00038 namespace realsense_camera 00039 { 00040 class SyncNodelet: public realsense_camera::BaseNodelet 00041 { 00042 public: 00043 // Interfaces. 00044 virtual ~SyncNodelet(); 00045 virtual void onInit(); 00046 00047 protected: 00048 boost::shared_ptr<boost::thread> topic_thread_; 00049 bool duplicate_depth_color_ = false; 00050 ros::Time topic_ts_; 00051 00052 virtual void setFrameCallbacks() { } // don't set callbacks! 00053 virtual void publishSyncTopics(); 00054 virtual void publishTopic(rs_stream stream_index); 00055 virtual void setImageData(rs_stream stream_index); 00056 }; 00057 } // namespace realsense_camera 00058 #endif // REALSENSE_CAMERA_SYNC_NODELET_H