Skip to content

Commit

Permalink
Revert "[common] Modify index type for PCLPointField" (PointCloudLibr…
Browse files Browse the repository at this point in the history
…ary#4227)

This reverts commit ae87389.
  • Loading branch information
kunaltyagi authored Jun 25, 2020
1 parent ae87389 commit 6148799
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 13 deletions.
5 changes: 2 additions & 3 deletions common/include/pcl/PCLPointField.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include <pcl/memory.h> // for shared_ptr
#include <pcl/type_traits.h> // for asEnum_v
#include <pcl/types.h> // for index_t

#include <string> // for string
#include <ostream> // for ostream
Expand All @@ -13,9 +12,9 @@ namespace pcl
{
std::string name;

uindex_t offset = 0;
std::uint32_t offset = 0;
std::uint8_t datatype = 0;
uindex_t count = 0;
std::uint32_t count = 0;

enum PointFieldTypes { INT8 = traits::asEnum_v<std::int8_t>,
UINT8 = traits::asEnum_v<std::uint8_t>,
Expand Down
2 changes: 1 addition & 1 deletion common/include/pcl/pcl_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ namespace pcl
bool fake_indices_;

/** \brief The size of each individual field. */
std::vector<uindex_t> field_sizes_;
std::vector<int> field_sizes_;

/** \brief The x-y-z fields indices. */
index_t x_idx_, y_idx_, z_idx_;
Expand Down
2 changes: 1 addition & 1 deletion common/src/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pcl::getMinMax (const pcl::PCLPointCloud2 &cloud, int,
}
const auto field_idx = std::distance(cloud.fields.begin (), result);

for (uindex_t i = 0; i < cloud.fields[field_idx].count; ++i)
for (unsigned int i = 0; i < cloud.fields[field_idx].count; ++i)
{
float data;
// TODO: replace float with the real data type
Expand Down
4 changes: 2 additions & 2 deletions io/src/pcd_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ pcl::PCDReader::readBodyASCII (std::istream &fs, pcl::PCLPointCloud2 &cloud, int
total += cloud.fields[d].count; // jump over this many elements in the string token
continue;
}
for (uindex_t c = 0; c < cloud.fields[d].count; ++c)
for (unsigned int c = 0; c < cloud.fields[d].count; ++c)
{
switch (cloud.fields[d].datatype)
{
Expand Down Expand Up @@ -623,7 +623,7 @@ pcl::PCDReader::readBodyBinary (const unsigned char *map, pcl::PCLPointCloud2 &c
{
for (unsigned int d = 0; d < static_cast<unsigned int> (cloud.fields.size ()); ++d)
{
for (uindex_t c = 0; c < cloud.fields[d].count; ++c)
for (std::uint32_t c = 0; c < cloud.fields[d].count; ++c)
{
switch (cloud.fields[d].datatype)
{
Expand Down
2 changes: 1 addition & 1 deletion test/io/test_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ TEST (PCL, ComplexPCDFileASCII)
int fpfh_idx = pcl::getFieldIndex (blob, "fpfh");
EXPECT_EQ (fpfh_idx, 0);
float val[33];
for (uindex_t i = 0; i < blob.fields[fpfh_idx].count; ++i)
for (std::size_t i = 0; i < blob.fields[fpfh_idx].count; ++i)
memcpy (&val[i], &blob.data[0 * blob.point_step + blob.fields[fpfh_idx + 0].offset + i * sizeof (float)], sizeof (float));

EXPECT_EQ (val[0], 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ PCLHistogramVisualizer::addFeatureHistogram (

// Parse the cloud data and store it in the array
double xy[2];
for (uindex_t d = 0; d < fields[field_idx].count; ++d)
for (std::uint32_t d = 0; d < fields[field_idx].count; ++d)
{
xy[0] = d;
//xy[1] = cloud.points[index].histogram[d];
Expand Down
8 changes: 4 additions & 4 deletions visualization/src/histogram_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ pcl::visualization::PCLHistogramVisualizer::addFeatureHistogram (

// Parse the cloud data and store it in the array
double xy[2];
for (uindex_t d = 0; d < cloud.fields[field_idx].count; ++d)
for (unsigned int d = 0; d < cloud.fields[field_idx].count; ++d)
{
xy[0] = d;
float data;
Expand Down Expand Up @@ -361,7 +361,7 @@ pcl::visualization::PCLHistogramVisualizer::addFeatureHistogram (

// Parse the cloud data and store it in the array
double xy[2];
for (uindex_t d = 0; d < cloud.fields[field_idx].count; ++d)
for (unsigned int d = 0; d < cloud.fields[field_idx].count; ++d)
{
xy[0] = d;
float data;
Expand Down Expand Up @@ -405,7 +405,7 @@ pcl::visualization::PCLHistogramVisualizer::updateFeatureHistogram (

// Parse the cloud data and store it in the array
double xy[2];
for (uindex_t d = 0; d < cloud.fields[field_idx].count; ++d)
for (unsigned int d = 0; d < cloud.fields[field_idx].count; ++d)
{
xy[0] = d;
float data;
Expand Down Expand Up @@ -456,7 +456,7 @@ pcl::visualization::PCLHistogramVisualizer::updateFeatureHistogram (

// Parse the cloud data and store it in the array
double xy[2];
for (uindex_t d = 0; d < cloud.fields[field_idx].count; ++d)
for (unsigned int d = 0; d < cloud.fields[field_idx].count; ++d)
{
xy[0] = d;
float data;
Expand Down

0 comments on commit 6148799

Please sign in to comment.