mux_nodelet.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2013, Ryohei Ueda and JSK Lab
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/o2r other materials provided
16  * with the distribution.
17  * * Neither the name of the JSK Lab nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 #ifndef MUX_NODELET_H_
36 #define MUX_NODELET_H_
37 
38 #include <nodelet/nodelet.h>
40 
41 #include <topic_tools/MuxSelect.h>
42 #include <topic_tools/MuxAdd.h>
43 #include <topic_tools/MuxDelete.h>
44 #include <topic_tools/MuxList.h>
45 
46 namespace jsk_topic_tools
47 {
48  class MUX : public nodelet::Nodelet
49  {
50  public:
52  virtual void onInit();
53  virtual bool selectTopicCallback(topic_tools::MuxSelect::Request &req,
54  topic_tools::MuxSelect::Response &res);
55  virtual bool addTopicCallback(topic_tools::MuxAdd::Request& req,
56  topic_tools::MuxAdd::Response& res);
57  virtual bool deleteTopicCallback(topic_tools::MuxDelete::Request& req,
58  topic_tools::MuxDelete::Response& res);
59  virtual bool listTopicCallback(topic_tools::MuxList::Request& req,
60  topic_tools::MuxList::Response& res);
62  protected:
63  virtual void connectCb(const ros::SingleSubscriberPublisher& pub);
64  virtual void subscribeSelectedTopic();
67  std::vector<std::string> topics_;
68  std::string selected_topic_;
75  };
76 }
77 
78 #endif
boost::shared_ptr< ros::Subscriber > sub_
Definition: mux_nodelet.h:69
virtual void inputCallback(const boost::shared_ptr< topic_tools::ShapeShifter const > &msg)
std::vector< std::string > topics_
Definition: mux_nodelet.h:67
ros::Publisher pub_
Definition: mux_nodelet.h:71
ros::MessageEvent< topic_tools::ShapeShifter > ShapeShifterEvent
Definition: mux_nodelet.h:51
ros::ServiceServer ss_del_
Definition: mux_nodelet.h:74
ros::Publisher pub_selected_
Definition: mux_nodelet.h:70
ros::ServiceServer ss_add_
Definition: mux_nodelet.h:74
virtual bool selectTopicCallback(topic_tools::MuxSelect::Request &req, topic_tools::MuxSelect::Response &res)
Definition: mux_nodelet.cpp:93
ros::NodeHandle pnh_
Definition: mux_nodelet.h:72
virtual void subscribeSelectedTopic()
virtual void connectCb(const ros::SingleSubscriberPublisher &pub)
Definition: mux_nodelet.cpp:68
std::string selected_topic_
Definition: mux_nodelet.h:68
virtual void onInit()
Definition: mux_nodelet.cpp:44
ros::ServiceServer ss_list_
Definition: mux_nodelet.h:74
ros::ServiceServer ss_select_
Definition: mux_nodelet.h:74
virtual bool deleteTopicCallback(topic_tools::MuxDelete::Request &req, topic_tools::MuxDelete::Response &res)
virtual bool listTopicCallback(topic_tools::MuxList::Request &req, topic_tools::MuxList::Response &res)
virtual bool addTopicCallback(topic_tools::MuxAdd::Request &req, topic_tools::MuxAdd::Response &res)
ros::TransportHints th_
Definition: mux_nodelet.h:73


jsk_topic_tools
Author(s): Kei Okada , Yusuke Furuta
autogenerated on Tue Feb 6 2018 03:45:19