master.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009, Willow Garage, Inc.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  * * Redistributions of source code must retain the above copyright notice,
7  * this list of conditions and the following disclaimer.
8  * * Redistributions in binary form must reproduce the above copyright
9  * notice, this list of conditions and the following disclaimer in the
10  * documentation and/or other materials provided with the distribution.
11  * * Neither the names of Stanford University or Willow Garage, Inc. nor the names of its
12  * contributors may be used to endorse or promote products derived from
13  * this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25  * POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #ifndef ROSCPP_MASTER_H
29 #define ROSCPP_MASTER_H
30 
31 #include "forwards.h"
32 #include "xmlrpcpp/XmlRpcValue.h"
33 #include "common.h"
34 
35 namespace ros
36 {
37 
41 namespace master
42 {
43 
54 ROSCPP_DECL bool execute(const std::string& method, const XmlRpc::XmlRpcValue& request, XmlRpc::XmlRpcValue& response, XmlRpc::XmlRpcValue& payload, bool wait_for_master);
55 
60 ROSCPP_DECL const std::string& getHost();
65 ROSCPP_DECL uint32_t getPort();
69 ROSCPP_DECL const std::string& getURI();
70 
80 ROSCPP_DECL bool check();
81 
85 struct ROSCPP_DECL TopicInfo
86 {
87  TopicInfo() {}
88  TopicInfo(const std::string& _name, const std::string& _datatype /*, const std::string& _md5sum*/)
89  : name(_name)
90  , datatype(_datatype)
91  //, md5sum(_md5sum)
92  {}
93  std::string name;
94  std::string datatype;
95 
96  // not possible yet unfortunately (master does not have this information)
97  //std::string md5sum; ///< md5sum of the topic
98 };
99 typedef std::vector<TopicInfo> V_TopicInfo;
100 
113 ROSCPP_DECL bool getTopics(V_TopicInfo& topics);
114 
118 ROSCPP_DECL bool getNodes(V_string& nodes);
119 
124 ROSCPP_DECL void setRetryTimeout(ros::WallDuration timeout);
125 
126 } // namespace master
127 
128 } // namespace ros
129 
130 #endif
ROSCPP_DECL uint32_t getPort()
Get the port where the master runs.
Definition: master.cpp:95
ROSCPP_DECL void setRetryTimeout(ros::WallDuration timeout)
Set the max time this node should spend looping trying to connect to the master.
Definition: master.cpp:105
ROSCPP_DECL const std::string & getURI()
Get the full URI to the master (eg. http://host:port/)
Definition: master.cpp:100
ROSCPP_DECL bool check()
Check whether the master is up.
Definition: master.cpp:115
ROSCPP_DECL bool getTopics(V_TopicInfo &topics)
Get the list of topics that are being published by all nodes.
Definition: master.cpp:122
std::vector< TopicInfo > V_TopicInfo
Definition: master.h:99
std::string datatype
Datatype of the topic.
Definition: master.h:94
std::vector< std::string > V_string
const char * datatype()
ROSCPP_DECL bool execute(const std::string &method, const XmlRpc::XmlRpcValue &request, XmlRpc::XmlRpcValue &response, XmlRpc::XmlRpcValue &payload, bool wait_for_master)
Execute an XMLRPC call on the master.
Definition: master.cpp:175
ROSCPP_DECL const std::string & getHost()
Get the hostname where the master runs.
Definition: master.cpp:90
TopicInfo(const std::string &_name, const std::string &_datatype)
Definition: master.h:88
ROSCPP_DECL bool getNodes(V_string &nodes)
Retreives the currently-known list of nodes from the master.
Definition: master.cpp:142
std::string name
Name of the topic.
Definition: master.h:93
Contains information retrieved from the master about a topic.
Definition: master.h:85
const std::string response


roscpp
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas
autogenerated on Mon Feb 28 2022 23:33:27