Skip to content

Commit

Permalink
Change data type of return_type to uint8 (tier4#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
miursh authored Sep 15, 2021
1 parent e45a92f commit bbdfdf5
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Pandar40Decoder : public PacketDecoder
STRONGEST,
LAST,
};
enum ReturnType : int8_t
enum ReturnType : uint8_t
{
INVALID = 0,
SINGLE_STRONGEST,
Expand All @@ -37,7 +37,7 @@ class Pandar40Decoder : public PacketDecoder

private:
bool parsePacket(const pandar_msgs::PandarPacket& raw_packet);
PointXYZIRADT build_point(int block_id, int unit_id, int8_t return_type);
PointXYZIRADT build_point(int block_id, int unit_id, uint8_t return_type);
PointcloudXYZIRADT convert(const int block_id);
PointcloudXYZIRADT convert_dual(const int block_id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace pandar_pointcloud
STRONGEST,
LAST,
};
enum ReturnType : int8_t
enum ReturnType : uint8_t
{
INVALID = 0,
SINGLE_STRONGEST,
Expand All @@ -35,7 +35,7 @@ namespace pandar_pointcloud

void unpack(const pandar_msgs::PandarPacket& raw_packet) override;

PointXYZIRADT build_point(int block_id, int unit_id, int8_t return_type);
PointXYZIRADT build_point(int block_id, int unit_id, uint8_t return_type);

bool hasScanned() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class PandarQTDecoder : public PacketDecoder
FIRST,
LAST,
};
enum ReturnType : int8_t
enum ReturnType : uint8_t
{
INVALID = 0,
SINGLE_FIRST,
Expand All @@ -30,7 +30,7 @@ class PandarQTDecoder : public PacketDecoder

PandarQTDecoder(Calibration& calibration, float scan_phase = 0.0f, double dual_return_distance_threshold = 0.1, ReturnMode return_mode = ReturnMode::DUAL);
void unpack(const pandar_msgs::PandarPacket& raw_packet) override;
PointXYZIRADT build_point(int block_id, int unit_id, int8_t return_type);
PointXYZIRADT build_point(int block_id, int unit_id, uint8_t return_type);
bool hasScanned() override;
PointcloudXYZIRADT getPointcloud() override;

Expand Down
16 changes: 10 additions & 6 deletions pandar_pointcloud/include/pandar_pointcloud/point_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct PointXYZIRADT
uint16_t ring;
float azimuth;
float distance;
int8_t return_type;
uint8_t return_type;
double time_stamp;
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
} EIGEN_ALIGN16;
Expand All @@ -34,8 +34,12 @@ POINT_CLOUD_REGISTER_POINT_STRUCT(pandar_pointcloud::PointXYZIR,
ring, ring))

POINT_CLOUD_REGISTER_POINT_STRUCT(pandar_pointcloud::PointXYZIRADT,
(float, x, x)(float, y, y)(float, z, z)(float, intensity, intensity)(
std::uint16_t, ring, ring)(float, azimuth, azimuth)(float, distance,
distance)(int8_t, return_type,
return_type)(double, time_stamp,
time_stamp))
(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))
2 changes: 1 addition & 1 deletion pandar_pointcloud/src/lib/decoder/pandar40_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void Pandar40Decoder::unpack(const pandar_msgs::PandarPacket& raw_packet)
return;
}

PointXYZIRADT Pandar40Decoder::build_point(int block_id, int unit_id, int8_t return_type)
PointXYZIRADT Pandar40Decoder::build_point(int block_id, int unit_id, uint8_t return_type)
{
const auto& block = packet_.blocks[block_id];
const auto& unit = block.units[unit_id];
Expand Down
2 changes: 1 addition & 1 deletion pandar_pointcloud/src/lib/decoder/pandar64_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ namespace pandar_pointcloud
}
}

PointXYZIRADT Pandar64Decoder::build_point(int block_id, int unit_id, int8_t return_type)
PointXYZIRADT Pandar64Decoder::build_point(int block_id, int unit_id, uint8_t return_type)
{
const auto& block = packet_.blocks[block_id];
const auto& unit = block.units[unit_id];
Expand Down
2 changes: 1 addition & 1 deletion pandar_pointcloud/src/lib/decoder/pandar_qt_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void PandarQTDecoder::unpack(const pandar_msgs::PandarPacket& raw_packet)
return;
}

PointXYZIRADT PandarQTDecoder::build_point(int block_id, int unit_id, int8_t return_type)
PointXYZIRADT PandarQTDecoder::build_point(int block_id, int unit_id, uint8_t return_type)
{
const auto& block = packet_.blocks[block_id];
const auto& unit = block.units[unit_id];
Expand Down

0 comments on commit bbdfdf5

Please sign in to comment.