提交 e64051d6 编写于 作者: K kechxu 提交者: Liangliang Zhang

Perception: common.h change AttributePointCloud to its base class PointCloud

上级 b178563e
...@@ -28,7 +28,6 @@ namespace common { ...@@ -28,7 +28,6 @@ namespace common {
using base::PointF; using base::PointF;
using base::PointCloud; using base::PointCloud;
using base::AttributePointCloud;
TEST(GeometryBasicTest, cross_product_test) { TEST(GeometryBasicTest, cross_product_test) {
Eigen::Vector2f p1(0.0, 0.0); Eigen::Vector2f p1(0.0, 0.0);
...@@ -153,7 +152,7 @@ TEST(GeometryBasicTest, convert_cartesian_to_polar_coordinate) { ...@@ -153,7 +152,7 @@ TEST(GeometryBasicTest, convert_cartesian_to_polar_coordinate) {
TEST(GeometryCommonTest, is_point_xy_in_polygon_2d_xy) { TEST(GeometryCommonTest, is_point_xy_in_polygon_2d_xy) {
base::PointF pt, temp; base::PointF pt, temp;
AttributePointCloud<PointF> polygon; PointCloud<PointF> polygon;
temp.x = 10.f; temp.x = 10.f;
temp.y = 10.f; temp.y = 10.f;
temp.z = 10.f; temp.z = 10.f;
...@@ -221,7 +220,7 @@ TEST(GeometryCommonTest, is_point_in_bbox) { ...@@ -221,7 +220,7 @@ TEST(GeometryCommonTest, is_point_in_bbox) {
TEST(GeometryCommonTest, calculate_bbox_size_center_2d_xy) { TEST(GeometryCommonTest, calculate_bbox_size_center_2d_xy) {
Eigen::Vector3f size; Eigen::Vector3f size;
Eigen::Vector3d center; Eigen::Vector3d center;
AttributePointCloud<PointF> cloud; PointCloud<PointF> cloud;
base::PointF temp; base::PointF temp;
temp.x = 10.f; temp.x = 10.f;
temp.y = 10.f; temp.y = 10.f;
...@@ -237,7 +236,7 @@ TEST(GeometryCommonTest, calculate_bbox_size_center_2d_xy) { ...@@ -237,7 +236,7 @@ TEST(GeometryCommonTest, calculate_bbox_size_center_2d_xy) {
cloud.push_back(temp); cloud.push_back(temp);
Eigen::Vector3f direction(1.0, 0.0, 0.0); Eigen::Vector3f direction(1.0, 0.0, 0.0);
CalculateBBoxSizeCenter2DXY<AttributePointCloud<PointF>>(cloud, direction, CalculateBBoxSizeCenter2DXY<PointCloud<PointF>>(cloud, direction,
&size, &center); &size, &center);
EXPECT_NEAR(size(0), 30.f, std::numeric_limits<float>::epsilon()); EXPECT_NEAR(size(0), 30.f, std::numeric_limits<float>::epsilon());
EXPECT_NEAR(size(1), 25.f, std::numeric_limits<float>::epsilon()); EXPECT_NEAR(size(1), 25.f, std::numeric_limits<float>::epsilon());
...@@ -283,7 +282,7 @@ TEST(GeometryCommonTest, calculate_iou_2d_xy) { ...@@ -283,7 +282,7 @@ TEST(GeometryCommonTest, calculate_iou_2d_xy) {
TEST(GeometryCommonTest, calculate_dist_and_dir_to_segs) { TEST(GeometryCommonTest, calculate_dist_and_dir_to_segs) {
Eigen::Vector3f pt(0.0, 0.0, 0.0); Eigen::Vector3f pt(0.0, 0.0, 0.0);
AttributePointCloud<PointF> cloud; PointCloud<PointF> cloud;
base::PointF temp; base::PointF temp;
temp.x = 10.f; temp.x = 10.f;
temp.y = 0.f; temp.y = 0.f;
...@@ -316,7 +315,7 @@ TEST(GeometryCommonTest, calculate_dist_and_dir_to_segs) { ...@@ -316,7 +315,7 @@ TEST(GeometryCommonTest, calculate_dist_and_dir_to_segs) {
TEST(GeometryCommonTest, calculate_dist_and_dir_to_boundary) { TEST(GeometryCommonTest, calculate_dist_and_dir_to_boundary) {
Eigen::Vector3f pt(0.0, 0.0, 0.0); Eigen::Vector3f pt(0.0, 0.0, 0.0);
AttributePointCloud<PointF> left, right; PointCloud<PointF> left, right;
base::PointF temp; base::PointF temp;
temp.x = 10.f; temp.x = 10.f;
temp.y = 0.f; temp.y = 0.f;
...@@ -350,8 +349,8 @@ TEST(GeometryCommonTest, calculate_dist_and_dir_to_boundary) { ...@@ -350,8 +349,8 @@ TEST(GeometryCommonTest, calculate_dist_and_dir_to_boundary) {
TEST(GeometryCommonTest, calculate_dist_and_dir_to_boundary_list) { TEST(GeometryCommonTest, calculate_dist_and_dir_to_boundary_list) {
Eigen::Vector3f pt(0.0, 0.0, 0.0); Eigen::Vector3f pt(0.0, 0.0, 0.0);
AttributePointCloud<PointF> left, right; PointCloud<PointF> left, right;
std::vector<AttributePointCloud<PointF>> left_list, right_list; std::vector<PointCloud<PointF>> left_list, right_list;
base::PointF temp; base::PointF temp;
temp.x = 10.f; temp.x = 10.f;
temp.y = 0.f; temp.y = 0.f;
......
...@@ -217,7 +217,7 @@ Type CalculateIOUBBox(const base::BBox2D<Type> &box1, ...@@ -217,7 +217,7 @@ Type CalculateIOUBBox(const base::BBox2D<Type> &box1,
template <typename PointT> template <typename PointT>
bool CalculateDistAndDirToSegs( bool CalculateDistAndDirToSegs(
const Eigen::Matrix<typename PointT::Type, 3, 1> &pt, const Eigen::Matrix<typename PointT::Type, 3, 1> &pt,
const base::AttributePointCloud<PointT> &segs, typename PointT::Type *dist, const base::PointCloud<PointT> &segs, typename PointT::Type *dist,
Eigen::Matrix<typename PointT::Type, 3, 1> *dir) { Eigen::Matrix<typename PointT::Type, 3, 1> *dir) {
if (segs.size() < 2) { if (segs.size() < 2) {
return false; return false;
...@@ -283,8 +283,8 @@ bool CalculateDistAndDirToSegs( ...@@ -283,8 +283,8 @@ bool CalculateDistAndDirToSegs(
template <typename PointT> template <typename PointT>
void CalculateDistAndDirToBoundary( void CalculateDistAndDirToBoundary(
const Eigen::Matrix<typename PointT::Type, 3, 1> &pt, const Eigen::Matrix<typename PointT::Type, 3, 1> &pt,
const base::AttributePointCloud<PointT> &left_boundary, const base::PointCloud<PointT> &left_boundary,
const base::AttributePointCloud<PointT> &right_boundary, const base::PointCloud<PointT> &right_boundary,
typename PointT::Type *dist, typename PointT::Type *dist,
Eigen::Matrix<typename PointT::Type, 3, 1> *dir) { Eigen::Matrix<typename PointT::Type, 3, 1> *dir) {
using Type = typename PointT::Type; using Type = typename PointT::Type;
...@@ -313,8 +313,8 @@ void CalculateDistAndDirToBoundary( ...@@ -313,8 +313,8 @@ void CalculateDistAndDirToBoundary(
template <typename PointT> template <typename PointT>
void CalculateDistAndDirToBoundary( void CalculateDistAndDirToBoundary(
const Eigen::Matrix<typename PointT::Type, 3, 1> &pt, const Eigen::Matrix<typename PointT::Type, 3, 1> &pt,
const std::vector<base::AttributePointCloud<PointT>> &left_boundary, const std::vector<base::PointCloud<PointT>> &left_boundary,
const std::vector<base::AttributePointCloud<PointT>> &right_boundary, const std::vector<base::PointCloud<PointT>> &right_boundary,
typename PointT::Type *dist, typename PointT::Type *dist,
Eigen::Matrix<typename PointT::Type, 3, 1> *dir) { Eigen::Matrix<typename PointT::Type, 3, 1> *dir) {
using Type = typename PointT::Type; using Type = typename PointT::Type;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册