47 return (
double)((int)val);
56 throw std::runtime_error(
"the value cannot be converted into double");
62 const std::string& param_name,
63 std::vector<double>& result)
67 nh.
param(param_name, v, v);
69 result.resize(v.
size());
70 for (
size_t i = 0; i < v.
size(); i++) {
85 const std::string& param_name,
86 std::vector<std::vector<double> >& result)
90 nh.
param(param_name, v_toplevel, v_toplevel);
92 result.resize(v_toplevel.
size());
93 for (
size_t i = 0; i < v_toplevel.
size(); i++) {
97 std::vector<double> nested_std_vector(nested_v.
size());
98 for (
size_t j = 0; j < nested_v.
size(); j++) {
101 result[i] = nested_std_vector;
119 const std::string& param_name,
120 std::vector<std::vector<std::string> >& result)
124 nh.
param(param_name, v_toplevel, v_toplevel);
126 result.resize(v_toplevel.
size());
127 for (
size_t i = 0; i < v_toplevel.
size(); i++) {
131 std::vector<std::string> nested_std_vector(nested_v.
size());
132 for (
size_t j = 0; j < nested_v.
size(); j++) {
134 nested_std_vector[j] = (std::string)nested_v[j];
140 result[i] = nested_std_vector;
158 const std::string& param_name,
159 std::vector<std::string>& result)
163 nh.
param(param_name, v, v);
165 result.resize(v.
size());
166 for (
size_t i = 0; i < result.size(); i++) {
168 result[i] = (std::string)v[i];
171 throw std::runtime_error(
172 "the value cannot be converted into std::string");
Type const & getType() const
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
bool hasParam(const std::string &key) const
#define ROS_ERROR_STREAM(args)