ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Yes, we knew that, but the float should be non-zero anyway. Actually using the union
typedef union
{
struct /*anonymous*/
{
unsigned char Blue;
unsigned char Green;
unsigned char Red;
unsigned char Alpha;
};
float float_value;
long long_value;
} RGBValue;
returned binary invalid types. But we've solved it converting it first to PointXYZRGB
pcl::PointCloud<pcl::pointxyzrgb>::iterator pt_iter = this->pcl_xyzrgb.begin(); for (int rr = 0; rr < (int)pcl_xyzrgb.height; ++rr) { for (int cc = 0; cc < (int)pcl_xyzrgb.width; ++cc, ++pt_iter) { pcl::PointXYZRGB &pt = pt_iter; RGBValue color; color.float_value= pt.rgb; matlab_xyzrgb << rr << " " << cc << " " << pt.x1000 << " " << pt.y1000 << " " << pt.z1000 << " " << (int)color.Red << " " << (int)color.Green << " " << (int)color.Blue << std::endl; } }
The code above works.
2 | No.2 Revision |
Yes, we knew that, but the float should be non-zero anyway. Actually using the union
typedef union
{
struct /*anonymous*/
{
unsigned char Blue;
unsigned char Green;
unsigned char Red;
unsigned char Alpha;
};
float float_value;
long long_value;
} RGBValue;
returned binary invalid types. But we've solved it converting it first to PointXYZRGB
pcl::PointCloud<pcl::pointxyzrgb>::iterator
pcl::PointCloud<pcl::PointXYZRGB>::iterator
pt_iter = this->pcl_xyzrgb.begin();
for (int rr = 0; rr < (int)pcl_xyzrgb.height; ++rr) {
for (int cc = 0; cc < (int)pcl_xyzrgb.width; ++cc, ++pt_iter) {
pcl::PointXYZRGB &pt = The code above works.