rapid
A ROS robotics library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
params.h
Go to the documentation of this file.
1 #ifndef _RAPID_PARAMS_H_
2 #define _RAPID_PARAMS_H_
3 
4 #include <map>
5 #include <string>
6 #include <vector>
7 
8 #include "XmlRpcValue.h"
9 
10 namespace rapid {
11 // ---------------------------------------------------------------------------
12 // Functions to get a parameter from the ROS parameter server that throw
13 // std::runtime_error if the parameter is not found. We recommend applications
14 // explicitly list parameters in config files (i.e., in launch files or YAML
15 // files) rather than relying on default values set in code.
16 
23 std::string GetStringParamOrThrow(const std::string& name);
24 
31 double GetDoubleParamOrThrow(const std::string& name);
32 
39 float GetFloatParamOrThrow(const std::string& name);
40 
47 int GetIntParamOrThrow(const std::string& name);
48 
55 bool GetBoolParamOrThrow(const std::string& name);
56 
63 XmlRpc::XmlRpcValue GetXmlRpcParamOrThrow(const std::string& name);
64 
71 std::vector<std::string> GetStringVectorParamOrThrow(const std::string& name);
72 
79 std::vector<double> GetDoubleVectorParamOrThrow(const std::string& name);
80 
87 std::vector<float> GetFloatVectorParamOrThrow(const std::string& name);
88 
95 std::vector<int> GetIntVectorParamOrThrow(const std::string& name);
96 
103 std::vector<bool> GetBoolVectorParamOrThrow(const std::string& name);
104 
111 std::map<std::string, std::string> GetStringMapParamOrThrow(
112  const std::string& name);
113 
120 std::map<std::string, double> GetDoubleMapParamOrThrow(const std::string& name);
121 
128 std::map<std::string, float> GetFloatMapParamOrThrow(const std::string& name);
129 
136 std::map<std::string, int> GetIntMapParamOrThrow(const std::string& name);
137 
144 std::map<std::string, bool> GetBoolMapParamOrThrow(const std::string& name);
145 } // namespace rapid
146 
147 #endif // _RAPID_PARAMS_H_
float GetFloatParamOrThrow(const std::string &name)
Gets a float from the parameter server.
std::map< std::string, int > GetIntMapParamOrThrow(const std::string &name)
Gets a map from strings to ints from the parameter server.
double GetDoubleParamOrThrow(const std::string &name)
Gets a double from the parameter server.
std::map< std::string, double > GetDoubleMapParamOrThrow(const std::string &name)
Gets a map from strings to doubles from the parameter server.
std::map< std::string, float > GetFloatMapParamOrThrow(const std::string &name)
Gets a map from strings to floats from the parameter server.
int GetIntParamOrThrow(const std::string &name)
Gets an int from the parameter server.
std::vector< bool > GetBoolVectorParamOrThrow(const std::string &name)
Gets a vector of bools from the parameter server.
std::map< std::string, std::string > GetStringMapParamOrThrow(const std::string &name)
Gets a map from strings to string from the parameter server.
std::vector< double > GetDoubleVectorParamOrThrow(const std::string &name)
Gets a vector of doubles from the parameter server.
std::vector< int > GetIntVectorParamOrThrow(const std::string &name)
Gets a vector of ints from the parameter server.
XmlRpc::XmlRpcValue GetXmlRpcParamOrThrow(const std::string &name)
Gets an XML-RPC value from the parameter server.
std::vector< float > GetFloatVectorParamOrThrow(const std::string &name)
Gets a vector of floats from the parameter server.
std::vector< std::string > GetStringVectorParamOrThrow(const std::string &name)
Gets a vector of strings from the parameter server.
std::string GetStringParamOrThrow(const std::string &name)
Gets a string from the parameter server.
std::map< std::string, bool > GetBoolMapParamOrThrow(const std::string &name)
Gets a map from strings to bools from the parameter server.
bool GetBoolParamOrThrow(const std::string &name)
Gets a bool from the parameter server.