tier4 / nebula

Apache License 2.0
38 stars 39 forks source link

Bug in EIGEN_ALIGN16 #157

Open veqcc opened 1 month ago

veqcc commented 1 month ago

There is a known bug in EIGEN_ALIGN16 in PCL: https://github.com/leggedrobotics/tensorflow-cpp/blob/master/ISSUES.md

Due to the bug, the clang-tidy make the following CRITICAL warning

expected ';' after struct
'alignas' attribute only applies to variables, data members and tag types

in https://github.com/tier4/nebula/blob/main/nebula_common/include/nebula_common/point_types.hpp

struct PointXYZIR
{
  PCL_ADD_POINT4D;
  float intensity;
  uint16_t ring;
  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
} EIGEN_ALIGN16;
...
struct PointXYZIRADT
{
  PCL_ADD_POINT4D;
  float intensity;
  uint16_t ring;
  float azimuth;
  float distance;
  uint8_t return_type;
  double time_stamp;
  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
} EIGEN_ALIGN16;

Could you avoid the bug?

mojomex commented 1 month ago

Hi, thanks for bringing attention to this!

This is a known issue - I would love to use all the Clang tooling for Nebula - but even when fixing this, I found that transport_drivers also does not compile with Clang so I gave up for the time being. I will look into this some time in the near future. If you want a fix now, please feel free to PR :bowing_man:

veqcc commented 1 month ago

@mojomex Thank you for your quick reply!!

My first concern is whether the struct PointXYZIR and PointXYZIRADT are aligned, in spite of the pcl bug?

If they are NOT aligned, it should be solved soon.

If they are aligned, then I think we have two options:

  1. use pcl>=v1.10.0 It is reccomnended here: https://github.com/leggedrobotics/tensorflow-cpp/blob/master/ISSUES.md
  2. do nothing for now, and look into in some future as you say
veqcc commented 3 weeks ago

May I close it?

mojomex commented 3 weeks ago

@veqcc The fix is currently merged into develop, we'll close the issue once it is merged into main!