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
response
const std::string response
ros::master::check
ROSCPP_DECL bool check()
Check whether the master is up.
Definition: master.cpp:115
forwards.h
ros::master::getPort
ROSCPP_DECL uint32_t getPort()
Get the port where the master runs.
Definition: master.cpp:95
ros::master::TopicInfo::TopicInfo
TopicInfo(const std::string &_name, const std::string &_datatype)
Definition: master.h:88
ros
ros::master::getTopics
ROSCPP_DECL bool getTopics(V_TopicInfo &topics)
Get the list of topics that are being published by all nodes.
Definition: master.cpp:122
ros::master::TopicInfo::TopicInfo
TopicInfo()
Definition: master.h:87
ros::master::V_TopicInfo
std::vector< TopicInfo > V_TopicInfo
Definition: master.h:99
XmlRpcValue.h
ros::master::getHost
const ROSCPP_DECL std::string & getHost()
Get the hostname where the master runs.
Definition: master.cpp:90
ros::master::execute
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
ros::master::getNodes
ROSCPP_DECL bool getNodes(V_string &nodes)
Retreives the currently-known list of nodes from the master.
Definition: master.cpp:142
ros::master::TopicInfo::datatype
std::string datatype
Datatype of the topic.
Definition: master.h:94
datatype
const char * datatype()
ros::V_string
std::vector< std::string > V_string
ros::WallDuration
ros::master::TopicInfo
Contains information retrieved from the master about a topic.
Definition: master.h:85
ros::master::getURI
const ROSCPP_DECL std::string & getURI()
Get the full URI to the master (eg. http://host:port/)
Definition: master.cpp:100
XmlRpc::XmlRpcValue
ros::master::TopicInfo::name
std::string name
Name of the topic.
Definition: master.h:93
ros::master::setRetryTimeout
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
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas , Jacob Perron
autogenerated on Thu Nov 23 2023 04:01:44