Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrating pointcloud types #6996

Merged
merged 32 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a11437d
feat: changed most of sensing to the new type
knzo25 May 9, 2024
9ca55da
chore: started applying changes to the perception stack
knzo25 May 10, 2024
a3a8fcc
feat: confirmed operation until centerpoint
knzo25 May 12, 2024
1cfec28
feat: reverted to the original implementation of pointpainting
knzo25 May 13, 2024
8a37f33
chore: forgot to push a header
knzo25 May 16, 2024
511b6d8
Merge branch 'feat/sensing_point_type' of github.com:knzo25/autoware.…
knzo25 May 16, 2024
84b22cd
feat: also implemented the changes for the subsample filters that wer…
knzo25 May 17, 2024
ce3ad79
Merge branch 'feat/sensing_point_type' of github.com:knzo25/autoware.…
knzo25 May 17, 2024
06d705a
Merge branch 'main' into feat/sensing_point_type
knzo25 May 27, 2024
570be63
Merge branch 'main' into feat/sensing_point_type
knzo25 May 27, 2024
8451cde
Merge branch 'main' into feat/sensing_point_type
knzo25 Jun 7, 2024
3342631
fix: some point type changes were missing from the latest merge from …
knzo25 Jun 7, 2024
1c5c9f0
Merge branch 'main' into feat/sensing_point_type
kminoda Jun 10, 2024
c62f167
Merge branch 'main' into feat/sensing_point_type
badai-nguyen Jun 14, 2024
6793245
chore: removed unused code, added comments, and brought back a remove…
knzo25 Jun 19, 2024
c0d5d9a
Merge branch 'feat/sensing_point_type' of github.com:knzo25/autoware.…
knzo25 Jun 19, 2024
b9aa673
Merge branch 'main' into feat/sensing_point_type
badai-nguyen Jun 20, 2024
0c8b731
Merge branch 'main' into feat/sensing_point_type
knzo25 Jun 24, 2024
1606cd8
chore: replaced pointcloud_raw for pointcloud_raw_ex to avoid extra p…
knzo25 Jun 24, 2024
8c0b07f
feat: added memory layout checks
knzo25 Jun 24, 2024
ab6cfc4
chore: updated documentation regarding the point types
knzo25 Jun 24, 2024
46a720c
chore: added hyperlinks to the point definitions. will be valid only …
knzo25 Jun 24, 2024
f99f0fc
Merge branch 'main' into feat/sensing_point_type
knzo25 Jun 24, 2024
4cc4adb
fix: fixed compilation due to moving the utilities files to the base …
knzo25 Jun 24, 2024
357cdb7
Merge branch 'feat/sensing_point_type' of github.com:knzo25/autoware.…
knzo25 Jun 24, 2024
fec8ac6
chore: separated the utilities functions due to a dependency issue
knzo25 Jun 25, 2024
afd46cd
chore: forgot that perception also uses the filter class
knzo25 Jun 27, 2024
27e49f3
Merge branch 'main' into feat/sensing_point_type
badai-nguyen Jun 28, 2024
820901d
Merge branch 'main' into feat/sensing_point_type
knzo25 Jun 30, 2024
fa6a0c2
Merge branch 'main' into feat/sensing_point_type
knzo25 Jul 8, 2024
216b062
Merge branch 'main' into feat/sensing_point_type
knzo25 Jul 9, 2024
cfc4715
feature: adapted the undistortion tests to the new point type
knzo25 Jul 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,23 @@
DUAL_ONLY,
};

struct PointXYZIRC
{
float x{0.0F};
float y{0.0F};
float z{0.0F};
std::uint8_t intensity{0U};
std::uint8_t return_type{0U};
std::uint16_t channel{0U};

friend bool operator==(const PointXYZIRC & p1, const PointXYZIRC & p2) noexcept

Check warning on line 66 in common/autoware_point_types/include/autoware_point_types/types.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_point_types/include/autoware_point_types/types.hpp#L66

Added line #L66 was not covered by tests
{
return float_eq<float>(p1.x, p2.x) && float_eq<float>(p1.y, p2.y) &&
float_eq<float>(p1.z, p2.z) && p1.intensity == p2.intensity &&
p1.return_type == p2.return_type && p1.channel == p2.channel;

Check warning on line 70 in common/autoware_point_types/include/autoware_point_types/types.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_point_types/include/autoware_point_types/types.hpp#L68-L70

Added lines #L68 - L70 were not covered by tests
}
};

struct PointXYZIRADRT
{
float x{0.0F};
Expand All @@ -75,25 +92,97 @@
}
};

enum class PointIndex { X, Y, Z, Intensity, Ring, Azimuth, Distance, ReturnType, TimeStamp };
struct PointXYZIRCAEDT
{
float x{0.0F};
float y{0.0F};
float z{0.0F};
std::uint8_t intensity{0U};
std::uint8_t return_type{0U};
std::uint16_t channel{0U};
float azimuth{0.0F};
float elevation{0.0F};
float distance{0.0F};
std::uint32_t time_stamp{0U};

friend bool operator==(const PointXYZIRCAEDT & p1, const PointXYZIRCAEDT & p2) noexcept
{
return float_eq<float>(p1.x, p2.x) && float_eq<float>(p1.y, p2.y) &&
float_eq<float>(p1.z, p2.z) && p1.intensity == p2.intensity &&
p1.return_type == p2.return_type && p1.channel == p2.channel &&
float_eq<float>(p1.azimuth, p2.azimuth) && float_eq<float>(p1.distance, p2.distance) &&
p1.time_stamp == p2.time_stamp;
}
};

enum class PointXYZIIndex { X, Y, Z, Intensity };
enum class PointXYZIRCIndex { X, Y, Z, Intensity, ReturnType, Channel };
enum class PointXYZIRADRTIndex {
X,
Y,
Z,
Intensity,
Ring,
Azimuth,
Distance,
ReturnType,
TimeStamp
};
enum class PointXYZIRCAEDTIndex {
X,
Y,
Z,
Intensity,
ReturnType,
Channel,
Azimuth,
Elevation,
Distance,
TimeStamp
};

LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(azimuth);
LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(elevation);
LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(distance);
LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(return_type);
LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(time_stamp);

LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(channel);

Check warning on line 150 in common/autoware_point_types/include/autoware_point_types/types.hpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_point_types/include/autoware_point_types/types.hpp#L150

Added line #L150 was not covered by tests

using PointXYZIRCGenerator = std::tuple<
point_cloud_msg_wrapper::field_x_generator, point_cloud_msg_wrapper::field_y_generator,
point_cloud_msg_wrapper::field_z_generator, point_cloud_msg_wrapper::field_intensity_generator,
field_return_type_generator, field_channel_generator>;

using PointXYZIRADRTGenerator = std::tuple<
point_cloud_msg_wrapper::field_x_generator, point_cloud_msg_wrapper::field_y_generator,
point_cloud_msg_wrapper::field_z_generator, point_cloud_msg_wrapper::field_intensity_generator,
point_cloud_msg_wrapper::field_ring_generator, field_azimuth_generator, field_distance_generator,
field_return_type_generator, field_time_stamp_generator>;

using PointXYZIRCAEDTGenerator = std::tuple<
point_cloud_msg_wrapper::field_x_generator, point_cloud_msg_wrapper::field_y_generator,
point_cloud_msg_wrapper::field_z_generator, point_cloud_msg_wrapper::field_intensity_generator,
field_return_type_generator, field_channel_generator, field_azimuth_generator,
field_elevation_generator, field_distance_generator, field_time_stamp_generator>;

} // namespace autoware_point_types

POINT_CLOUD_REGISTER_POINT_STRUCT(
autoware_point_types::PointXYZIRC,
(float, x, x)(float, y, y)(float, z, z)(std::uint8_t, intensity, intensity)(
std::uint8_t, return_type, return_type)(std::uint16_t, channel, channel))

POINT_CLOUD_REGISTER_POINT_STRUCT(
autoware_point_types::PointXYZIRADRT,
(float, x, x)(float, y, y)(float, z, z)(float, intensity, intensity)(std::uint16_t, ring, ring)(
float, azimuth, azimuth)(float, distance, distance)(std::uint8_t, return_type, return_type)(
double, time_stamp, time_stamp))

POINT_CLOUD_REGISTER_POINT_STRUCT(
autoware_point_types::PointXYZIRCAEDT,
(float, x, x)(float, y, y)(float, z, z)(std::uint8_t, intensity, intensity)(
std::uint8_t, return_type,
return_type)(std::uint16_t, channel, channel)(float, azimuth, azimuth)(
float, elevation, elevation)(float, distance, distance)(std::uint32_t, time_stamp, time_stamp))
#endif // AUTOWARE_POINT_TYPES__TYPES_HPP_
9 changes: 9 additions & 0 deletions common/autoware_point_types/test/test_point_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ TEST(PointEquality, PointXYZIRADRT)
EXPECT_EQ(pt0, pt1);
}

TEST(PointEquality, PointXYZIRCAEDT)
{
using autoware_point_types::PointXYZIRCAEDT;

PointXYZIRCAEDT pt0{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
PointXYZIRCAEDT pt1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
EXPECT_EQ(pt0, pt1);
}

TEST(PointEquality, FloatEq)
{
// test template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class ScanGroundFilterComponent : public pointcloud_preprocessor::Filter
int y_offset_;
int z_offset_;
int intensity_offset_;
int intensity_type_;
bool offset_initialized_;

void set_field_offsets(const PointCloud2ConstPtr & input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@
int intensity_index = pcl::getFieldIndex(*input, "intensity");
if (intensity_index != -1) {
intensity_offset_ = input->fields[intensity_index].offset;
intensity_type_ = input->fields[intensity_index].datatype;

Check warning on line 99 in perception/ground_segmentation/src/scan_ground_filter_nodelet.cpp

View check run for this annotation

Codecov / codecov/patch

perception/ground_segmentation/src/scan_ground_filter_nodelet.cpp#L99

Added line #L99 was not covered by tests
} else {
intensity_offset_ = z_offset_ + sizeof(float);
intensity_offset_ = -1;
}
offset_initialized_ = true;
}
Expand Down Expand Up @@ -569,6 +570,7 @@
PointCloud2 & out_object_cloud)
{
size_t output_data_size = 0;

for (const auto & i : in_indices.indices) {
std::memcpy(
&out_object_cloud.data[output_data_size], &in_cloud_ptr->data[i * in_cloud_ptr->point_step],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,13 @@ void PointPaintingFusionNode::fuseOnSingleImage(
// tf2::doTransform(painted_pointcloud_msg, transformed_pointcloud, transform_stamped);

const auto x_offset =
painted_pointcloud_msg.fields.at(static_cast<size_t>(autoware_point_types::PointIndex::X))
painted_pointcloud_msg.fields.at(static_cast<size_t>(autoware_point_types::PointXYZIRCIndex::X))
.offset;
const auto y_offset =
painted_pointcloud_msg.fields.at(static_cast<size_t>(autoware_point_types::PointIndex::Y))
painted_pointcloud_msg.fields.at(static_cast<size_t>(autoware_point_types::PointXYZIRCIndex::Y))
.offset;
const auto z_offset =
painted_pointcloud_msg.fields.at(static_cast<size_t>(autoware_point_types::PointIndex::Z))
painted_pointcloud_msg.fields.at(static_cast<size_t>(autoware_point_types::PointXYZIRCIndex::Z))
.offset;
const auto class_offset = painted_pointcloud_msg.fields.at(4).offset;
const auto p_step = painted_pointcloud_msg.point_step;
Expand Down
24 changes: 23 additions & 1 deletion perception/lidar_apollo_instance_segmentation/src/detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#include "lidar_apollo_instance_segmentation/feature_map.hpp"

#include <sensor_msgs/point_cloud2_iterator.hpp>

#include <NvCaffeParser.h>
#include <NvInfer.h>
#include <pcl_conversions/pcl_conversions.h>
Expand Down Expand Up @@ -126,7 +128,27 @@

// convert from ros to pcl
pcl::PointCloud<pcl::PointXYZI>::Ptr pcl_pointcloud_raw_ptr(new pcl::PointCloud<pcl::PointXYZI>);
pcl::fromROSMsg(transformed_cloud, *pcl_pointcloud_raw_ptr);
// pcl::fromROSMsg(transformed_cloud, *pcl_pointcloud_raw_ptr);

auto pcl_pointcloud_raw = *pcl_pointcloud_raw_ptr;
pcl_pointcloud_raw.width = transformed_cloud.width;
pcl_pointcloud_raw.height = transformed_cloud.height;
pcl_pointcloud_raw.is_dense = transformed_cloud.is_dense == 1;
pcl_pointcloud_raw.resize(transformed_cloud.width * transformed_cloud.height);

Check warning on line 137 in perception/lidar_apollo_instance_segmentation/src/detector.cpp

View check run for this annotation

Codecov / codecov/patch

perception/lidar_apollo_instance_segmentation/src/detector.cpp#L133-L137

Added lines #L133 - L137 were not covered by tests

sensor_msgs::PointCloud2ConstIterator<float> it_x(transformed_cloud, "x");
sensor_msgs::PointCloud2ConstIterator<float> it_y(transformed_cloud, "y");
sensor_msgs::PointCloud2ConstIterator<float> it_z(transformed_cloud, "z");
sensor_msgs::PointCloud2ConstIterator<uint8_t> it_intensity(transformed_cloud, "intensity");

Check warning on line 142 in perception/lidar_apollo_instance_segmentation/src/detector.cpp

View check run for this annotation

Codecov / codecov/patch

perception/lidar_apollo_instance_segmentation/src/detector.cpp#L139-L142

Added lines #L139 - L142 were not covered by tests

for (; it_x != it_x.end(); ++it_x, ++it_y, ++it_z, ++it_intensity) {
pcl::PointXYZI point;
point.x = *it_x;
point.y = *it_y;
point.z = *it_z;
point.intensity = static_cast<float>(*it_intensity);

Check warning on line 149 in perception/lidar_apollo_instance_segmentation/src/detector.cpp

View check run for this annotation

Codecov / codecov/patch

perception/lidar_apollo_instance_segmentation/src/detector.cpp#L146-L149

Added lines #L146 - L149 were not covered by tests
pcl_pointcloud_raw.emplace_back(std::move(point));
}

// generate feature map
std::shared_ptr<FeatureMapInterface> feature_map_ptr =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include <lidar_apollo_segmentation_tvm/lidar_apollo_segmentation_tvm.hpp>
#include <tvm_utility/pipeline.hpp>

#include <sensor_msgs/point_cloud2_iterator.hpp>

#include <memory>
#include <string>
#include <vector>
Expand Down Expand Up @@ -173,7 +175,29 @@
sensor_msgs::msg::PointCloud2 transformed_cloud;
ApolloLidarSegmentation::transformCloud(input, transformed_cloud, z_offset_);
// convert from ros to pcl
pcl::fromROSMsg(transformed_cloud, *pcl_pointcloud_ptr_);
// pcl::fromROSMsg(
// transformed_cloud, *pcl_pointcloud_ptr_); // Manual conversion is needed since intensity
// comes as an uint8_t

auto pcl_pointcloud = *pcl_pointcloud_ptr_;
pcl_pointcloud.width = input.width;
pcl_pointcloud.height = input.height;
pcl_pointcloud.is_dense = input.is_dense == 1;

Check warning on line 185 in perception/lidar_apollo_segmentation_tvm/src/lidar_apollo_segmentation_tvm.cpp

View check run for this annotation

Codecov / codecov/patch

perception/lidar_apollo_segmentation_tvm/src/lidar_apollo_segmentation_tvm.cpp#L183-L185

Added lines #L183 - L185 were not covered by tests
pcl_pointcloud.resize(input.width * input.height);

sensor_msgs::PointCloud2ConstIterator<float> it_x(input, "x");
sensor_msgs::PointCloud2ConstIterator<float> it_y(input, "y");
sensor_msgs::PointCloud2ConstIterator<float> it_z(input, "z");
sensor_msgs::PointCloud2ConstIterator<uint8_t> it_intensity(input, "intensity");

for (; it_x != it_x.end(); ++it_x, ++it_y, ++it_z, ++it_intensity) {
pcl::PointXYZI point;
point.x = *it_x;
point.y = *it_y;
point.z = *it_z;

Check warning on line 197 in perception/lidar_apollo_segmentation_tvm/src/lidar_apollo_segmentation_tvm.cpp

View check run for this annotation

Codecov / codecov/patch

perception/lidar_apollo_segmentation_tvm/src/lidar_apollo_segmentation_tvm.cpp#L196-L197

Added lines #L196 - L197 were not covered by tests
point.intensity = static_cast<float>(*it_intensity);
pcl_pointcloud.emplace_back(std::move(point));
}

// inference pipeline
auto output = pipeline->schedule(pcl_pointcloud_ptr_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@
RCLCPP_WARN(get_logger(), "Invalid point cloud data. point_step is less than 16.");
return true;
}
for (sensor_msgs::PointCloud2ConstIterator<float> iter(cluster, "intensity"); iter != iter.end();
++iter) {
mean_intensity += *iter;
for (sensor_msgs::PointCloud2ConstIterator<uint8_t> iter(cluster, "intensity");
iter != iter.end(); ++iter) {
mean_intensity += static_cast<float>(*iter);

Check warning on line 128 in perception/raindrop_cluster_filter/src/low_intensity_cluster_filter.cpp

View check run for this annotation

Codecov / codecov/patch

perception/raindrop_cluster_filter/src/low_intensity_cluster_filter.cpp#L126-L128

Added lines #L126 - L128 were not covered by tests
}
const size_t num_points = cluster.width * cluster.height;
mean_intensity /= static_cast<double>(num_points);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@

namespace pointcloud_preprocessor
{
using autoware_point_types::PointXYZI;
using autoware_point_types::PointXYZIRC;
using point_cloud_msg_wrapper::PointCloud2Modifier;

/** \brief @b PointCloudConcatenateDataSynchronizerComponent is a special form of data
Expand Down Expand Up @@ -169,7 +169,7 @@ class PointCloudConcatenateDataSynchronizerComponent : public rclcpp::Node
sensor_msgs::msg::PointCloud2::SharedPtr & concat_cloud_ptr);
void publish();

void convertToXYZICloud(
void convertToXYZIRCCloud(
const sensor_msgs::msg::PointCloud2::SharedPtr & input_ptr,
sensor_msgs::msg::PointCloud2::SharedPtr & output_ptr);
void setPeriod(const int64_t new_period);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

namespace pointcloud_preprocessor
{
using autoware_point_types::PointXYZI;
using autoware_point_types::PointXYZIRC;
using point_cloud_msg_wrapper::PointCloud2Modifier;
/** \brief @b PointCloudConcatenationComponent is a special form of data
* synchronizer: it listens for a set of input PointCloud messages on the same topic,
Expand Down Expand Up @@ -160,7 +160,7 @@ class PointCloudConcatenationComponent : public rclcpp::Node
void combineClouds(sensor_msgs::msg::PointCloud2::SharedPtr & concat_cloud_ptr);
void publish();

void convertToXYZICloud(
void convertToXYZIRCCloud(
const sensor_msgs::msg::PointCloud2::SharedPtr & input_ptr,
sensor_msgs::msg::PointCloud2::SharedPtr & output_ptr);
void setPeriod(const int64_t new_period);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public:
FasterVoxelGridDownsampleFilter();
void set_voxel_size(float voxel_size_x, float voxel_size_y, float voxel_size_z);
void set_field_offsets(const PointCloud2ConstPtr & input);
void set_field_offsets(const PointCloud2ConstPtr & input, const rclcpp::Logger & logger);
void filter(
const PointCloud2ConstPtr & input, PointCloud2 & output, const TransformInfo & transform_info,
const rclcpp::Logger & logger);
Expand All @@ -48,7 +48,7 @@
float intensity;
uint32_t point_count_;

Centroid() : x(0), y(0), z(0), intensity(-1.0) {}
Centroid() : x(0), y(0), z(0), intensity(0) {}

Check warning on line 51 in sensing/pointcloud_preprocessor/include/pointcloud_preprocessor/downsample_filter/faster_voxel_grid_downsample_filter.hpp

View check run for this annotation

Codecov / codecov/patch

sensing/pointcloud_preprocessor/include/pointcloud_preprocessor/downsample_filter/faster_voxel_grid_downsample_filter.hpp#L51

Added line #L51 was not covered by tests
Centroid(float _x, float _y, float _z, float _intensity)
: x(_x), y(_y), z(_z), intensity(_intensity)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@

namespace pointcloud_preprocessor
{
using autoware_point_types::PointXYZI;
using point_cloud_msg_wrapper::PointCloud2Modifier;

class RingOutlierFilterComponent : public pointcloud_preprocessor::Filter
{
protected:
using InputPointIndex = autoware_point_types::PointXYZIRCAEDTIndex;
using InputPointType = autoware_point_types::PointXYZIRCAEDT;
using OutputPointType = autoware_point_types::PointXYZIRC;

virtual void filter(
const PointCloud2ConstPtr & input, const IndicesPtr & indices, PointCloud2 & output);

Expand Down Expand Up @@ -83,8 +86,10 @@
{
if (walk_size > num_points_threshold_) return true;

auto first_point = reinterpret_cast<const PointXYZI *>(&input->data[data_idx_both_ends.first]);
auto last_point = reinterpret_cast<const PointXYZI *>(&input->data[data_idx_both_ends.second]);
auto first_point =
reinterpret_cast<const InputPointType *>(&input->data[data_idx_both_ends.first]);

Check warning on line 90 in sensing/pointcloud_preprocessor/include/pointcloud_preprocessor/outlier_filter/ring_outlier_filter_nodelet.hpp

View check run for this annotation

Codecov / codecov/patch

sensing/pointcloud_preprocessor/include/pointcloud_preprocessor/outlier_filter/ring_outlier_filter_nodelet.hpp#L90

Added line #L90 was not covered by tests
auto last_point =
reinterpret_cast<const InputPointType *>(&input->data[data_idx_both_ends.second]);

Check warning on line 92 in sensing/pointcloud_preprocessor/include/pointcloud_preprocessor/outlier_filter/ring_outlier_filter_nodelet.hpp

View check run for this annotation

Codecov / codecov/patch

sensing/pointcloud_preprocessor/include/pointcloud_preprocessor/outlier_filter/ring_outlier_filter_nodelet.hpp#L92

Added line #L92 was not covered by tests

const auto x = first_point->x - last_point->x;
const auto y = first_point->y - last_point->y;
Expand All @@ -94,8 +99,7 @@
}

void setUpPointCloudFormat(
const PointCloud2ConstPtr & input, PointCloud2 & formatted_points, size_t points_size,
size_t num_fields);
const PointCloud2ConstPtr & input, PointCloud2 & formatted_points, size_t points_size);
float calculateVisibilityScore(const PointCloud2 & input);

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@

namespace pointcloud_preprocessor
{
using autoware_point_types::PointXYZI;
using autoware_point_types::PointXYZIRC;
using point_cloud_msg_wrapper::PointCloud2Modifier;
// cspell:ignore Yoshi
/** \brief @b PointCloudDataSynchronizerComponent is a special form of data
Expand Down Expand Up @@ -166,7 +166,7 @@ class PointCloudDataSynchronizerComponent : public rclcpp::Node
std::map<std::string, sensor_msgs::msg::PointCloud2::SharedPtr> synchronizeClouds();
void publish();

void convertToXYZICloud(
void convertToXYZIRCCloud(
const sensor_msgs::msg::PointCloud2::SharedPtr & input_ptr,
sensor_msgs::msg::PointCloud2::SharedPtr & output_ptr);
void setPeriod(const int64_t new_period);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ bool is_data_layout_compatible_with_PointXYZI(const sensor_msgs::msg::PointCloud
* is to say whether you can memcpy from the PointCloud2 data buffer to a PointXYZIRADRT */
bool is_data_layout_compatible_with_PointXYZIRADRT(const sensor_msgs::msg::PointCloud2 & input);

/** \brief Return whether the input PointCloud2 data has the same layout than PointXYZIRCAEDT. That
* is to say whether you can memcpy from the PointCloud2 data buffer to a PointXYZIRCAEDT */
bool is_data_layout_compatible_with_PointXYZIRCAEDT(const sensor_msgs::msg::PointCloud2 & input);

} // namespace pointcloud_preprocessor::utils

#endif // POINTCLOUD_PREPROCESSOR__UTILITY__UTILITIES_HPP_
Loading
Loading