10 #include <mrpt/version.h> 11 #include <mrpt/maps/CSimplePointsMap.h> 12 #include <pcl/conversions.h> 13 #include <pcl/point_cloud.h> 19 pcl::PointCloud<pcl::PointXYZ> point_cloud;
21 point_cloud.height = 10;
22 point_cloud.width = 10;
23 point_cloud.is_dense =
true;
25 int num_points = point_cloud.height * point_cloud.width;
26 point_cloud.points.resize(num_points);
29 for (
int i = 0; i < num_points; i++)
31 pcl::PointXYZ& point = point_cloud.points[i];
48 for (
int i = 0; i < num_points; i++)
50 float mrpt_x, mrpt_y, mrpt_z;
51 mrpt_pc.
getPoint(i, mrpt_x, mrpt_y, mrpt_z);
PointCloud2_< std::allocator< void > > PointCloud2
bool copy(const sensor_msgs::PointCloud2 &msg, mrpt::maps::CSimplePointsMap &obj)
unsigned long getPoint(size_t index, float &x, float &y, float &z) const
void toROSMsg(const sensor_msgs::PointCloud2 &cloud, sensor_msgs::Image &image)
#define EXPECT_FLOAT_EQ(val1, val2)
TEST(PointCloud2, basicTest)