organized_cloudXYZIR.cc
Go to the documentation of this file.
1 
3 
4 namespace velodyne_pointcloud
5 {
6 
8  const double max_range, const double min_range,
9  const std::string& target_frame, const std::string& fixed_frame,
10  const unsigned int num_lasers, const unsigned int scans_per_block,
12  : DataContainerBase(
13  max_range, min_range, target_frame, fixed_frame,
14  num_lasers, 0, false, scans_per_block, tf_ptr, 6,
15  "x", 1, sensor_msgs::PointField::FLOAT32,
16  "y", 1, sensor_msgs::PointField::FLOAT32,
17  "z", 1, sensor_msgs::PointField::FLOAT32,
18  "intensity", 1, sensor_msgs::PointField::FLOAT32,
19  "ring", 1, sensor_msgs::PointField::UINT16,
20  "time", 1, sensor_msgs::PointField::FLOAT32),
21  iter_x(cloud, "x"), iter_y(cloud, "y"), iter_z(cloud, "z"),
22  iter_intensity(cloud, "intensity"), iter_ring(cloud, "ring"), iter_time(cloud, "time")
23  {
24  }
25 
27  {
34  ++cloud.height;
35  }
36 
37  void OrganizedCloudXYZIR::setup(const velodyne_msgs::VelodyneScan::ConstPtr& scan_msg){
38  DataContainerBase::setup(scan_msg);
45  }
46 
47 
48  void OrganizedCloudXYZIR::addPoint(float x, float y, float z,
49  const uint16_t ring, const uint16_t /*azimuth*/, const float distance, const float intensity, const float time)
50  {
57  if (pointInRange(distance))
58  {
59  if(config_.transform)
60  transformPoint(x, y, z);
61 
62  *(iter_x+ring) = x;
63  *(iter_y+ring) = y;
64  *(iter_z+ring) = z;
65  *(iter_intensity+ring) = intensity;
66  *(iter_ring+ring) = ring;
67  *(iter_time+time) = time;
68  }
69  else
70  {
71  *(iter_x+ring) = nanf("");
72  *(iter_y+ring) = nanf("");
73  *(iter_z+ring) = nanf("");
74  *(iter_intensity+ring) = nanf("");
75  *(iter_ring+ring) = ring;
76  *(iter_time+time) = time;
77  }
78  }
79 }
80 
sensor_msgs::PointCloud2Iterator< float > iter_time
virtual void addPoint(float x, float y, float z, const uint16_t ring, const uint16_t azimuth, const float distance, const float intensity, const float time)
sensor_msgs::PointCloud2Iterator< float > iter_intensity
virtual void setup(const velodyne_msgs::VelodyneScan::ConstPtr &scan_msg)
sensor_msgs::PointCloud2Iterator< float > iter_x
void transformPoint(float &x, float &y, float &z)
sensor_msgs::PointCloud2Iterator< float > iter_z
bool transform
enable / disable transform points
sensor_msgs::PointCloud2Iterator< float > iter_y
sensor_msgs::PointCloud2Iterator< uint16_t > iter_ring
OrganizedCloudXYZIR(const double max_range, const double min_range, const std::string &target_frame, const std::string &fixed_frame, const unsigned int num_lasers, const unsigned int scans_per_block, boost::shared_ptr< tf::TransformListener > tf_ptr=boost::shared_ptr< tf::TransformListener >())


velodyne_pointcloud
Author(s): Jack O'Quin, Piyush Khandelwal, Jesse Vera, Sebastian Pütz
autogenerated on Sun Sep 6 2020 03:25:30