#ifndef COMMON_H #define COMMON_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; struct PointPoseInfo { double x; double y; double z; double qw; double qx; double qy; double qz; int idx; double time; EIGEN_MAKE_ALIGNED_OPERATOR_NEW } EIGEN_ALIGN16; POINT_CLOUD_REGISTER_POINT_STRUCT (PointPoseInfo, (double, x, x) (double, y, y) (double, z, z) (double, qw, qw) (double, qx, qx) (double, qy, qy) (double, qz, qz) (int, idx, idx) (double, time, time) ) // PCL point types using pcl::PointXYZI; using pcl::PointXYZINormal; typedef pcl::PointXYZINormal PointType; // Get parameters from yaml file template bool getParameter(const std::string& paramName, class_name& param) { std::string nodeName = ros::this_node::getName(); std::string paramKey; if (!ros::param::search(paramName, paramKey)) { ROS_ERROR("%s: Failed to search for parameter '%s'.", nodeName.c_str(), paramName.c_str()); return false; } if (!ros::param::has(paramKey)) { ROS_ERROR("%s: Missing required parameter '%s'.", nodeName.c_str(), paramName.c_str()); return false; } if (!ros::param::get(paramKey, param)) { ROS_ERROR("%s: Failed to get parameter '%s'.", nodeName.c_str(), paramName.c_str()); return false; } return true; } #endif // COMMON_H