52 bool get(
const std::string &parent_name,
const ros::NodeHandle &nh,
const std::string ¶m_name,
bool &value)
67 bool get(
const std::string &parent_name,
const ros::NodeHandle &nh,
const std::string ¶ms_namespace,
68 std::map<std::string, bool> ¶meters)
74 << params_namespace <<
"'.");
77 nh.
getParam(params_namespace, parameters);
80 for (std::map<std::string, bool>::const_iterator param_it = parameters.begin(); param_it != parameters.end();
84 << param_it->first <<
"' with value " << param_it->second);
90 bool get(
const std::string &parent_name,
const ros::NodeHandle &nh,
const std::string ¶m_name,
double &value)
105 bool get(
const std::string &parent_name,
const ros::NodeHandle &nh,
const std::string ¶m_name,
106 std::vector<double> &values)
126 bool get(
const std::string &parent_name,
const ros::NodeHandle &nh,
const std::string ¶m_name,
int &value)
141 bool get(
const std::string &parent_name,
const ros::NodeHandle &nh,
const std::string ¶m_name, std::size_t &value)
150 nh.
getParam(param_name, nonsigned_value);
151 value = nonsigned_value;
158 bool get(
const std::string &parent_name,
const ros::NodeHandle &nh,
const std::string ¶m_name, std::string &value)
174 std::vector<std::string> &values)
203 nh.
getParam(param_name, temp_value);
213 bool get(
const std::string &parent_name,
const ros::NodeHandle &nh,
const std::string ¶m_name,
214 Eigen::Isometry3d &value)
216 std::vector<double> values;
239 bool get(
const std::string &parent_name,
const ros::NodeHandle &nh,
const std::string ¶m_name,
240 geometry_msgs::Pose &value)
242 Eigen::Isometry3d eigen_pose;
243 if (!
get(parent_name, nh, param_name, eigen_pose))
252 std::stringstream debug_values;
253 for (std::size_t i = 0; i < values.size(); ++i)
255 debug_values << values[i] <<
",";
257 return debug_values.str();
262 std::stringstream debug_values;
263 for (std::size_t i = 0; i < values.size(); ++i)
265 debug_values << values[i] <<
",";
267 return debug_values.str();
270 bool convertDoublesToEigen(
const std::string &parent_name, std::vector<double> values, Eigen::Isometry3d &transform)
272 if (values.size() == 6)
275 Eigen::AngleAxisd roll_angle(values[3], Eigen::Vector3d::UnitX());
276 Eigen::AngleAxisd pitch_angle(values[4], Eigen::Vector3d::UnitY());
277 Eigen::AngleAxisd yaw_angle(values[5], Eigen::Vector3d::UnitZ());
278 Eigen::Quaternion<double> quaternion = roll_angle * pitch_angle * yaw_angle;
280 transform = Eigen::Translation3d(values[0], values[1], values[2]) * quaternion;
284 else if (values.size() == 7)
287 transform = Eigen::Translation3d(values[0], values[1], values[2]) *
288 Eigen::Quaterniond(values[3], values[4], values[5], values[6]);
293 ROS_ERROR_STREAM_NAMED(parent_name,
"Invalid number of doubles provided for transform, size=" << values.size());
298 void shutdownIfError(
const std::string &parent_name, std::size_t error_count)
303 ROS_ERROR_STREAM_NAMED(parent_name,
"Missing " << error_count <<
" ros parameters that are required. Shutting down "
304 "to prevent undefined behaviors");