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

Timestamp update #20

Merged
merged 199 commits into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
70c2e7d
first commit
h-mitsui-esol May 27, 2021
0559755
Add CI
Jul 7, 2021
b500c14
Merge pull request #2 from tier4/add-ci
wep21 Jul 7, 2021
6bd6ca7
release livox driver(beta ver.) (#1)
n-hamaike-esol Jul 27, 2021
c3fd649
fix for the issue with the termination process when powering off (#5)
n-hamaike-esol Jul 29, 2021
2a9dd3a
Refactor 1st (#6)
h-mitsui-esol Aug 10, 2021
1696207
Use default qos for imu (#8)
kosuke55 Aug 10, 2021
07f2a4d
Fix/esol/livox driver utest (#9)
h-mitsui-esol Aug 20, 2021
9040320
Livox Diagnostics (#10)
amc-nu Aug 31, 2021
71e767d
nebula structure
amc-nu Sep 27, 2021
4a086a9
nebula wip
amc-nu Oct 20, 2021
4ba703d
remove transport driver
amc-nu Oct 20, 2021
ba33855
move livox, start nebula base
Oct 26, 2021
e612a8d
reorganize pkg
Oct 26, 2021
ae3dd0f
Initial POC Hesai driver structure
amc-nu Oct 28, 2021
3022948
POC Hesai driver hw interface
amc-nu Oct 28, 2021
1c8f286
initial 'working' version
amc-nu Oct 28, 2021
2f8d520
restructuration
amc-nu Oct 29, 2021
a5fac77
README
amc-nu Oct 29, 2021
211e8fd
attempts at getting the UDP driver to work
Nov 11, 2021
04d46c3
fix hw_interface
amc-nu Nov 11, 2021
290ddf3
clang. update with t4 format
amc-nu Nov 17, 2021
30dcb7c
nebula. add missing headers
amc-nu Nov 17, 2021
32b2b56
start of packet handling
Nov 18, 2021
14e36d8
hesai_msgs. add jumbo message
amc-nu Nov 21, 2021
6445c03
hesai. add packet parsing and scan formation code
amc-nu Nov 21, 2021
7c6b9ea
apply clang formatting
amc-nu Nov 21, 2021
5c63b84
hesai_ros. reorder includes
amc-nu Nov 23, 2021
a79c1b5
hesai_ros. todo
amc-nu Nov 24, 2021
c61723e
initial working hesai udp driver
Nov 25, 2021
87b7148
Merge branch 'udpdriver' into 'nebula'
jacoblambert Nov 25, 2021
e1645c8
apply clang format
amc-nu Nov 26, 2021
546d4e8
ROS wrappers
amc-nu Dec 2, 2021
9c1db13
add hesai_decoders base and implementations
amc-nu Dec 2, 2021
b680abd
Hesai initial full working version
amc-nu Dec 8, 2021
578409d
small cleanup and standardization
Jan 18, 2022
ac5cdc9
Velodyne Release
jacoblambert Feb 8, 2022
6c00892
Merge branch 'velodyne' into 'nebula'
jacoblambert Feb 8, 2022
d3ae42f
GitLab CI YAML
amc-nu Feb 8, 2022
5ac177b
Update .gitlab-ci.yml
amc-nu Feb 8, 2022
b725414
Update README.md
jacoblambert Feb 16, 2022
75d06e7
Merge branch 'jacoblambert-nebula-patch-84707' into 'nebula'
jacoblambert Feb 16, 2022
8a35f57
overflow bug fix
Feb 16, 2022
294c120
Merge branch 'main' into nebula
amc-nu Mar 1, 2022
d648fce
Update .gitlab-ci.yml
amc-nu May 19, 2022
690ba44
velodyne. add vlp16 launch
amc-nu Jun 7, 2022
711b214
launch. add hdl32 launch file
amc-nu Jun 15, 2022
38950de
launch. add vlp16hr
Jun 15, 2022
d19c365
pandar40 decoder. fix typo
amc-nu Jul 21, 2022
a30efb4
Merge branch 'nebula' of github.com:tier4/nebula into nebula
amc-nu Jul 26, 2022
30cceeb
nebula. v2. tcp/diag/monitoring
amc-nu Sep 16, 2022
ab82bd9
Merge branch 'nebula' of github.com:tier4/nebula into nebula
amc-nu Sep 16, 2022
5aae754
v2.1. PandarAT128 Dual only support
amc-nu Sep 21, 2022
aa8141d
launch. add pandar128 sample launch
amc-nu Sep 21, 2022
e6cfd51
pandar at128. single last/strongest echo + ptp timestamp support
amc-nu Sep 22, 2022
bf09b23
fix: prevent build error from logger parenthesis
drwnz Sep 27, 2022
1b2e182
Merge pull request #8 from tier4/fix/logger_build_errors
amc-nu Sep 27, 2022
8fa248f
v2.1. hesai/velodyne setup single/dual at launch
amc-nu Sep 30, 2022
f37c34e
Bump actions/checkout from 2 to 3.1.0
dependabot[bot] Oct 5, 2022
2695db8
fix: build error from Hesai hardware interface
drwnz Oct 14, 2022
22304f0
tcp depend, readme
Dec 16, 2022
2b1e89d
move to composable node
Dec 16, 2022
a3c375a
.py launch for all sensors
Dec 16, 2022
0fd44b0
.py launch how-to
Dec 16, 2022
8afe9de
deprecate esol driver
amc-nu Dec 21, 2022
cedeb46
Bump streetsidesoftware/cspell-action from 1.1.1 to 2.15.0
dependabot[bot] Dec 22, 2022
82090d8
Merge pull request #6 from MapIV/dependabot/github_actions/actions/ch…
amc-nu Dec 23, 2022
fe7e2a7
Merge pull request #11 from MapIV/dependabot/github_actions/streetsid…
amc-nu Dec 23, 2022
1131455
Bump actions/checkout from 3.1.0 to 3.2.0
dependabot[bot] Dec 23, 2022
d22ca1d
Merge pull request #13 from MapIV/dependabot/github_actions/actions/c…
amc-nu Dec 26, 2022
3ab80b2
Nebula decoder test pr (#12)
Kyutoku Dec 27, 2022
9cd7d64
Update build-and-test.yml
amc-nu Dec 27, 2022
b127313
Bump streetsidesoftware/cspell-action from 2.15.0 to 2.15.1 (#15)
dependabot[bot] Jan 3, 2023
8fa3024
Testing decoder (AT128 & XT32M) (#14)
Kyutoku Jan 4, 2023
bda9bfa
launch. fix naming for composable nodes and simplify
amc-nu Jan 5, 2023
4f81d5d
bug. add missing streamstart for hw composable nodes
amc-nu Jan 5, 2023
ba2e7bf
apply clang format
amc-nu Jan 5, 2023
2758261
Github Actions. Run CI tests only for nebula packages
amc-nu Jan 5, 2023
ecbff70
Testing decoder (40P, 64, QT64, XT32, VLP16) (#17)
Kyutoku Jan 17, 2023
2f1010e
velodyne_http. update api to transport drivers with beast requiring n…
amc-nu Jan 30, 2023
1fa2bad
Merge branch 'main' into nebula
amc-nu Jan 30, 2023
f3145c0
Bump ros-tooling/setup-ros from 0.2 to 0.5 (#20)
dependabot[bot] Jan 30, 2023
b8e21b0
Bump streetsidesoftware/cspell-action from 2.15.1 to 2.16.0 (#18)
dependabot[bot] Jan 30, 2023
69b648e
Bump actions/checkout from 3.2.0 to 3.3.0 (#16)
dependabot[bot] Jan 30, 2023
bee1240
build_depends. update transport_drivers repo
amc-nu Jan 30, 2023
34c30c0
Testing VLS128 (#21)
Kyutoku Feb 1, 2023
595f4b0
Pandar OT 128E4X Initial support (#25)
amc-nu Feb 9, 2023
3d40cb5
Fix cpu (#27)
amc-nu Feb 15, 2023
c89a8c5
Fix velodyne cpu (#28)
tokuda99 Feb 17, 2023
52f29dc
Docs of nebula driver (#19)
Kyutoku Feb 17, 2023
aadfaed
Bump streetsidesoftware/cspell-action from 2.16.0 to 2.20.0 (#26)
dependabot[bot] Feb 17, 2023
ebc6f29
Bump ros-tooling/setup-ros from 0.5 to 0.6 (#33)
dependabot[bot] Mar 6, 2023
7a11a5e
Bump streetsidesoftware/cspell-action from 2.20.0 to 2.22.0 (#32)
dependabot[bot] Mar 6, 2023
2f8605f
Bump ros-tooling/action-ros-ci from 0.2 to 0.3 (#31)
dependabot[bot] Mar 6, 2023
c0f15ab
first commit
h-mitsui-esol May 27, 2021
f9115b1
Add CI
Jul 7, 2021
8552a8c
release livox driver(beta ver.) (#1)
n-hamaike-esol Jul 27, 2021
d10b249
fix for the issue with the termination process when powering off (#5)
n-hamaike-esol Jul 29, 2021
1bd4cd7
Refactor 1st (#6)
h-mitsui-esol Aug 10, 2021
1ef70b5
Use default qos for imu (#8)
kosuke55 Aug 10, 2021
2bd9534
Fix/esol/livox driver utest (#9)
h-mitsui-esol Aug 20, 2021
119bcef
Livox Diagnostics (#10)
amc-nu Aug 31, 2021
657e379
nebula structure
amc-nu Sep 27, 2021
bf189a6
nebula wip
amc-nu Oct 20, 2021
63ea0fd
remove transport driver
amc-nu Oct 20, 2021
c17cfb3
move livox, start nebula base
Oct 26, 2021
33cc6be
reorganize pkg
Oct 26, 2021
ff2783b
Initial POC Hesai driver structure
amc-nu Oct 28, 2021
3117833
POC Hesai driver hw interface
amc-nu Oct 28, 2021
b620e11
initial 'working' version
amc-nu Oct 28, 2021
59e5629
restructuration
amc-nu Oct 29, 2021
ba56c31
README
amc-nu Oct 29, 2021
93e902a
attempts at getting the UDP driver to work
Nov 11, 2021
f780ffd
fix hw_interface
amc-nu Nov 11, 2021
081cb3c
nebula. add missing headers
amc-nu Nov 17, 2021
a242b1c
start of packet handling
Nov 18, 2021
ea96025
hesai_msgs. add jumbo message
amc-nu Nov 21, 2021
0669204
hesai. add packet parsing and scan formation code
amc-nu Nov 21, 2021
849f87a
apply clang formatting
amc-nu Nov 21, 2021
a3521af
hesai_ros. reorder includes
amc-nu Nov 23, 2021
eafd348
hesai_ros. todo
amc-nu Nov 24, 2021
0f50706
initial working hesai udp driver
Nov 25, 2021
a1a6583
apply clang format
amc-nu Nov 26, 2021
1a327d6
ROS wrappers
amc-nu Dec 2, 2021
7030adc
add hesai_decoders base and implementations
amc-nu Dec 2, 2021
f9e7fcc
Hesai initial full working version
amc-nu Dec 8, 2021
0d4b7a7
small cleanup and standardization
Jan 18, 2022
a1f2f4b
Velodyne Release
jacoblambert Feb 8, 2022
2b87509
GitLab CI YAML
amc-nu Feb 8, 2022
4bfd93b
Update .gitlab-ci.yml
amc-nu Feb 8, 2022
b7e4ddd
Update README.md
jacoblambert Feb 16, 2022
f7195a1
overflow bug fix
Feb 16, 2022
c63b630
Update .gitlab-ci.yml
amc-nu May 19, 2022
911d025
velodyne. add vlp16 launch
amc-nu Jun 7, 2022
8f79820
launch. add hdl32 launch file
amc-nu Jun 15, 2022
7ebc773
launch. add vlp16hr
Jun 15, 2022
f1238b7
pandar40 decoder. fix typo
amc-nu Jul 21, 2022
55643b9
nebula. v2. tcp/diag/monitoring
amc-nu Sep 16, 2022
710da9f
v2.1. PandarAT128 Dual only support
amc-nu Sep 21, 2022
2a21398
launch. add pandar128 sample launch
amc-nu Sep 21, 2022
32871f6
pandar at128. single last/strongest echo + ptp timestamp support
amc-nu Sep 22, 2022
21f6631
fix: prevent build error from logger parenthesis
drwnz Sep 27, 2022
807468e
v2.1. hesai/velodyne setup single/dual at launch
amc-nu Sep 30, 2022
fa7ec78
fix: build error from Hesai hardware interface
drwnz Oct 14, 2022
6dc08cc
tcp depend, readme
Dec 16, 2022
68485bc
move to composable node
Dec 16, 2022
a859bc8
.py launch for all sensors
Dec 16, 2022
fb9b0f4
.py launch how-to
Dec 16, 2022
d85d5c0
deprecate esol driver
amc-nu Dec 21, 2022
611f01f
Bump actions/checkout from 2 to 3.1.0
dependabot[bot] Oct 5, 2022
0b58aef
Nebula decoder test pr (#12)
Kyutoku Dec 27, 2022
b1321c8
Testing decoder (AT128 & XT32M) (#14)
Kyutoku Jan 4, 2023
869c320
launch. fix naming for composable nodes and simplify
amc-nu Jan 5, 2023
77be240
bug. add missing streamstart for hw composable nodes
amc-nu Jan 5, 2023
e550799
apply clang format
amc-nu Jan 5, 2023
ead5803
Testing decoder (40P, 64, QT64, XT32, VLP16) (#17)
Kyutoku Jan 17, 2023
d96b188
velodyne_http. update api to transport drivers with beast requiring n…
amc-nu Jan 30, 2023
0b534bb
build_depends. update transport_drivers repo
amc-nu Jan 30, 2023
57b227e
Testing VLS128 (#21)
Kyutoku Feb 1, 2023
9422e60
style(pre-commit): autofix
wep21 Mar 7, 2023
3812899
style(pre-commit): autofix
tier4-nebula-app[bot] Mar 7, 2023
6d57c64
Update build_depends.repos
amc-nu Mar 16, 2023
524f42c
Bump streetsidesoftware/cspell-action from 2.22.0 to 2.24.0 (#35)
dependabot[bot] Mar 16, 2023
50c1521
Bump actions/checkout from 3.3.0 to 3.4.0 (#36)
dependabot[bot] Mar 20, 2023
1fed9ac
Add Documentation (#37)
amc-nu Mar 20, 2023
0f068ab
documentation. run only on succesful merge
amc-nu Mar 20, 2023
49b9d35
Bump actions/cache from 2 to 3 (#39)
dependabot[bot] Mar 22, 2023
bfe7ec3
Bump streetsidesoftware/cspell-action from 2.24.0 to 2.25.0 (#38)
dependabot[bot] Mar 22, 2023
4b643fd
Bump streetsidesoftware/cspell-action from 2.25.0 to 2.26.0 (#40)
dependabot[bot] Mar 30, 2023
79b1d98
Bump streetsidesoftware/cspell-action from 2.26.0 to 2.26.1 (#42)
dependabot[bot] Apr 9, 2023
74bbbc8
Point timestamp returntype update to match T4 requirements (#41)
amc-nu Apr 21, 2023
4e7af86
Merge remote-tracking branch 't4/nebula' into nebula
amc-nu Apr 21, 2023
4a65878
delete unecessary packages
amc-nu Apr 21, 2023
60acdcb
Remove old doc files
amc-nu Apr 21, 2023
86bbf51
package.xml remove unnecessary dependencies
amc-nu Apr 24, 2023
218b22f
remove deprecated packages
amc-nu Apr 24, 2023
c4499be
Add PointCloud conversion methods
amc-nu Apr 24, 2023
dacaf15
Replace AT128's PCD file to fix testing (#43)
amc-nu Apr 26, 2023
3b4b052
Cpu optimization (#44)
amc-nu May 15, 2023
fa9e4d4
style(pre-commit): autofix
amc-nu May 15, 2023
e9760f0
style(pre-commit): autofix
tier4-nebula-app[bot] May 15, 2023
5e07759
remove unnecesary dependency
amc-nu May 16, 2023
5b7116f
velodyne. add monitor to velodyne
amc-nu May 18, 2023
a9c8408
monitor. reduce reporting verbosity, frequency
amc-nu May 18, 2023
eb26fc4
style(pre-commit): autofix
amc-nu May 18, 2023
5cc608d
hesai_decoders. update timestamp calculation
amc-nu May 19, 2023
d49ce0e
hesai_decoders. update azimuth
amc-nu May 19, 2023
acb6154
fix point.azimuth of pandar64
tokuda99 May 25, 2023
9b6fbcd
Merge branch 'timestamp_update' of github.com:MapIV/nebula into times…
amc-nu May 25, 2023
2165b79
hesai_decoders. azimuth update
amc-nu May 25, 2023
b2dd3dd
update timestamping
amc-nu May 25, 2023
f2a2441
decoders. timing azimuth update
amc-nu May 25, 2023
535d0a5
Merge branch 'main' into timestamp_update
amc-nu May 25, 2023
725aed6
style(pre-commit): autofix
amc-nu May 25, 2023
b982ad7
nebula decoders. time distance update
amc-nu May 29, 2023
f6e1ef2
nebula common. change point type
amc-nu May 29, 2023
556a883
Merge remote-tracking branch 't4/timestamp_update' into timestamp_update
amc-nu May 29, 2023
5186b32
Merge branch 'main' into timestamp_update
amc-nu May 29, 2023
643140f
style(pre-commit): autofix
amc-nu May 29, 2023
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
4 changes: 2 additions & 2 deletions nebula_common/include/nebula_common/nebula_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,8 @@ inline ReturnMode ReturnModeFromString(const std::string & return_mode)
[[maybe_unused]] pcl::PointCloud<PointXYZIR>::Ptr convertPointXYZIRADTToPointXYZIR(
const pcl::PointCloud<PointXYZIRADT>::ConstPtr & input_pointcloud);

[[maybe_unused]] pcl::PointCloud<PointXYZIR>::Ptr convertPointXYZICAETRToPointXYZIR(
const pcl::PointCloud<PointXYZICAETR>::ConstPtr & input_pointcloud);
[[maybe_unused]] pcl::PointCloud<PointXYZIR>::Ptr convertPointXYZIRCAEDTToPointXYZIR(
const pcl::PointCloud<PointXYZIRCAEDT>::ConstPtr & input_pointcloud);

} // namespace drivers
} // namespace nebula
Expand Down
20 changes: 11 additions & 9 deletions nebula_common/include/nebula_common/point_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@ struct PointXYZICATR
* This point type is not using PCL_ADD_POINT4D to avoid the addition of a 32-bit dummy word.
* The fields are ordered to meet the SSE alignment.
*/
struct PointXYZICAETR
struct PointXYZIRCAEDT
{
float x;
float y;
float z;
float azimuth;
float elevation;
std::uint8_t return_type;
std::uint8_t intensity;
std::uint8_t return_type;
std::uint16_t channel;
float azimuth;
float elevation;
float distance;
std::uint32_t time_stamp;
};

Expand All @@ -54,7 +55,7 @@ struct PointXYZIRADT
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
} EIGEN_ALIGN16;

using NebulaPoint = PointXYZICAETR;
using NebulaPoint = PointXYZIRCAEDT;
using NebulaPointPtr = std::shared_ptr<NebulaPoint>;
using NebulaPointCloud = pcl::PointCloud<NebulaPoint>;
using NebulaPointCloudPtr = pcl::PointCloud<NebulaPoint>::Ptr;
Expand All @@ -80,9 +81,10 @@ POINT_CLOUD_REGISTER_POINT_STRUCT(
std::uint32_t, time_stamp, time_stamp)(std::uint8_t, return_type, return_type))

POINT_CLOUD_REGISTER_POINT_STRUCT(
nebula::drivers::PointXYZICAETR,
(float, x, x)(float, y, y)(float, z, z)(float, azimuth, azimuth)(float, elevation, elevation)(
std::uint8_t, return_type, return_type)(std::uint8_t, intensity, intensity)(
std::uint16_t, channel, channel)(std::uint32_t, time_stamp, time_stamp))
nebula::drivers::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
4 changes: 2 additions & 2 deletions nebula_common/src/nebula_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ namespace drivers
return output_pointcloud;
}

pcl::PointCloud<PointXYZIR>::Ptr convertPointXYZICAETRToPointXYZIR(
const pcl::PointCloud<PointXYZICAETR>::ConstPtr & input_pointcloud)
pcl::PointCloud<PointXYZIR>::Ptr convertPointXYZIRCAEDTToPointXYZIR(
const pcl::PointCloud<PointXYZIRCAEDT>::ConstPtr & input_pointcloud)
{
pcl::PointCloud<PointXYZIR>::Ptr output_pointcloud(new pcl::PointCloud<PointXYZIR>);
output_pointcloud->reserve(input_pointcloud->points.size());
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class HesaiScanDecoder
int last_phase_{};
bool has_scanned_{};
double dual_return_distance_threshold_{};
uint32_t first_timestamp_{};
uint32_t first_timestamp_tmp{};
double scan_timestamp_{};
drwnz marked this conversation as resolved.
Show resolved Hide resolved

/// @brief SensorConfiguration for this decoder
std::shared_ptr<drivers::HesaiSensorConfiguration> sensor_configuration_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class PandarQT128Decoder : public HesaiScanDecoder
/// @param unix_second Packet time
/// @return Point cloud
drivers::NebulaPoint build_point(
size_t block_id, size_t unit_id, bool dual_return, const uint32_t & unix_second);
size_t block_id, size_t unit_id, bool dual_return, const double & unix_second);
/// @brief Convert to point cloud
/// @param block_id target block
/// @return Point cloud
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Pandar128E4XDecoder::Pandar128E4XDecoder(

last_phase_ = 0;
has_scanned_ = false;
first_timestamp_ = 0;
scan_timestamp_ = 0;

scan_pc_.reset(new NebulaPointCloud);
scan_pc_->reserve(LASER_COUNT * MAX_AZIMUTH_STEPS);
Expand All @@ -46,7 +46,7 @@ bool Pandar128E4XDecoder::hasScanned() { return has_scanned_; }

std::tuple<drivers::NebulaPointCloudPtr, double> Pandar128E4XDecoder::get_pointcloud()
{
return std::make_tuple(scan_pc_, first_timestamp_);
return std::make_tuple(scan_pc_, scan_timestamp_);
}

bool Pandar128E4XDecoder::parsePacket(const pandar_msgs::msg::PandarPacket & raw_packet)
Expand Down Expand Up @@ -104,7 +104,7 @@ void Pandar128E4XDecoder::unpack(const pandar_msgs::msg::PandarPacket & pandar_p
overflow_pc_.reset(new NebulaPointCloud);
overflow_pc_->reserve(LASER_COUNT * MAX_AZIMUTH_STEPS);
has_scanned_ = false;
first_timestamp_ = current_unit_unix_second_;
scan_timestamp_ = current_unit_unix_second_;
}

bool dual_return = is_dual_return();
Expand All @@ -126,18 +126,18 @@ drivers::NebulaPoint Pandar128E4XDecoder::build_point(
const uint32_t & unix_second, float & out_distance)
{
NebulaPoint point{};

float xyDistance =
static_cast<float>(block.distance) * DISTANCE_UNIT * cos_elevation_angle_[laser_id];
auto unit_distance = block.distance * DISTANCE_UNIT;
float xyDistance = unit_distance * cos_elevation_angle_[laser_id];

point.x = xyDistance * sinf(azimuth_offset_rad_[laser_id] + block_azimuth_rad_[azimuth]);
point.y = xyDistance * cosf(azimuth_offset_rad_[laser_id] + block_azimuth_rad_[azimuth]);
point.z = static_cast<float>(block.distance) * DISTANCE_UNIT * sin_elevation_angle_[laser_id];
point.intensity = block.reflectivity;
point.channel = laser_id;
point.azimuth = block_azimuth_rad_[azimuth] + azimuth_offset_rad_[laser_id];
point.distance = unit_distance;
point.elevation = elevation_angle_rad_[laser_id];
point.time_stamp = unix_second + packet_.tail.timestamp_us - first_timestamp_;
point.time_stamp = unix_second + packet_.tail.timestamp_us - scan_timestamp_;
out_distance = xyDistance;
return point;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ Pandar40Decoder::Pandar40Decoder(
dual_return_distance_threshold_ = sensor_configuration_->dual_return_distance_threshold;
last_phase_ = 0;
has_scanned_ = false;
first_timestamp_tmp = std::numeric_limits<uint32_t>::max();
first_timestamp_ = first_timestamp_tmp;
scan_timestamp_ = -1;

scan_pc_.reset(new NebulaPointCloud);
scan_pc_->reserve(LASER_COUNT * MAX_AZIMUTH_STEPS);
Expand All @@ -63,7 +62,7 @@ bool Pandar40Decoder::hasScanned() { return has_scanned_; }

std::tuple<drivers::NebulaPointCloudPtr, double> Pandar40Decoder::get_pointcloud()
{
return std::make_tuple(scan_pc_, first_timestamp_);
return std::make_tuple(scan_pc_, scan_timestamp_);
}

void Pandar40Decoder::unpack(const pandar_msgs::msg::PandarPacket & pandar_packet)
Expand All @@ -73,9 +72,9 @@ void Pandar40Decoder::unpack(const pandar_msgs::msg::PandarPacket & pandar_packe
}

if (has_scanned_) {
auto unix_second = static_cast<double>(timegm(&packet_.t)); // sensor-time (ppt/gps)
scan_timestamp_ = unix_second + static_cast<double>(packet_.usec) / 1000000.f;
scan_pc_ = overflow_pc_;
first_timestamp_ = first_timestamp_tmp;
first_timestamp_tmp = std::numeric_limits<uint32_t>::max();
overflow_pc_.reset(new NebulaPointCloud);
overflow_pc_->reserve(LASER_COUNT * MAX_AZIMUTH_STEPS);
has_scanned_ = false;
Expand Down Expand Up @@ -114,9 +113,7 @@ drivers::NebulaPoint Pandar40Decoder::build_point(
const auto & block = packet_.blocks[block_id];
const auto & unit = block.units[unit_id];
auto unix_second = static_cast<double>(timegm(&packet_.t));
if (unix_second < first_timestamp_tmp) {
first_timestamp_tmp = unix_second;
}

bool dual_return = (packet_.return_mode == DUAL_RETURN);
NebulaPoint point{};

Expand All @@ -128,18 +125,28 @@ drivers::NebulaPoint Pandar40Decoder::build_point(

point.intensity = unit.intensity;
point.channel = unit_id;
point.azimuth = block_azimuth_rad_[block_id] + azimuth_offset_rad_[unit_id];
point.azimuth = block_azimuth_rad_[block.azimuth] + azimuth_offset_rad_[unit_id];
point.distance = unit.distance;
point.elevation = elevation_angle_rad_[unit_id];
point.return_type = return_type;
point.time_stamp = (static_cast<double>(packet_.usec)) / 1000000.0;

point.time_stamp -=
dual_return ? (static_cast<double>(
block_time_offset_dual_return_[block_id] + firing_time_offset_[unit_id]) /
1000000.0f)
: (static_cast<double>(
block_time_offset_single_return_[block_id] + firing_time_offset_[unit_id]) /
1000000.0f);

if (scan_timestamp_ < 0) { // invalid timestamp
scan_timestamp_ = unix_second + static_cast<double>(packet_.usec) / 1000000.f;
}
auto offset = dual_return
? (static_cast<double>(
block_time_offset_dual_return_[block_id] + firing_time_offset_[unit_id]) /
1000000.0f)
: (static_cast<double>(
block_time_offset_single_return_[block_id] + firing_time_offset_[unit_id]) /
1000000.0f);
auto point_stamp =
(unix_second + offset + static_cast<double>(packet_.usec) / 1000000.f - scan_timestamp_);
if (point_stamp < 0) {
point.time_stamp = 0;
} else {
point.time_stamp = static_cast<uint32_t>(point_stamp * 10e9);
}

return point;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ Pandar64Decoder::Pandar64Decoder(

last_phase_ = 0;
has_scanned_ = false;
first_timestamp_tmp = std::numeric_limits<uint32_t>::max();
first_timestamp_ = first_timestamp_tmp;
scan_timestamp_ = -1;
scan_pc_.reset(new NebulaPointCloud);
scan_pc_->reserve(LASER_COUNT * MAX_AZIMUTH_STEPS);
overflow_pc_.reset(new NebulaPointCloud);
Expand All @@ -60,7 +59,7 @@ bool Pandar64Decoder::hasScanned() { return has_scanned_; }

std::tuple<drivers::NebulaPointCloudPtr, double> Pandar64Decoder::get_pointcloud()
{
return std::make_tuple(scan_pc_, first_timestamp_);
return std::make_tuple(scan_pc_, scan_timestamp_);
}

void Pandar64Decoder::unpack(const pandar_msgs::msg::PandarPacket & pandar_packet)
Expand All @@ -71,8 +70,8 @@ void Pandar64Decoder::unpack(const pandar_msgs::msg::PandarPacket & pandar_packe

if (has_scanned_) {
scan_pc_ = overflow_pc_;
first_timestamp_ = first_timestamp_tmp;
first_timestamp_tmp = std::numeric_limits<uint32_t>::max();
auto unix_second = static_cast<double>(timegm(&packet_.t)); // sensor-time (ppt/gps)
scan_timestamp_ = unix_second + static_cast<double>(packet_.usec) / 1000000.f;
overflow_pc_.reset(new NebulaPointCloud);
overflow_pc_->reserve(LASER_COUNT * MAX_AZIMUTH_STEPS);
has_scanned_ = false;
Expand Down Expand Up @@ -110,9 +109,7 @@ drivers::NebulaPoint Pandar64Decoder::build_point(
const auto & block = packet_.blocks[block_id];
const auto & unit = block.units[unit_id];
auto unix_second = static_cast<double>(timegm(&packet_.t));
if (unix_second < first_timestamp_tmp) {
first_timestamp_tmp = unix_second;
}

bool dual_return = (packet_.return_mode == DUAL_RETURN);
NebulaPoint point{};

Expand All @@ -124,16 +121,26 @@ drivers::NebulaPoint Pandar64Decoder::build_point(

point.intensity = unit.intensity;
point.channel = unit_id;
point.azimuth = block_azimuth_rad_[block_id] + azimuth_offset_rad_[unit_id];
point.azimuth = block_azimuth_rad_[block.azimuth] + azimuth_offset_rad_[unit_id];
point.distance = unit.distance;
point.elevation = elevation_angle_rad_[unit_id];
point.return_type = return_type;
point.time_stamp = (static_cast<double>(packet_.usec)) / 1000000.0;
point.time_stamp +=
if (scan_timestamp_ < 0) { // invalid timestamp
scan_timestamp_ = unix_second + static_cast<double>(packet_.usec) / 1000000.f;
}
auto offset =
dual_return
? (static_cast<double>(block_time_offset_dual_[block_id] + firing_time_offset_[unit_id]) /
1000000.0f)
: (static_cast<double>(block_time_offset_single_[block_id] + firing_time_offset_[unit_id]) /
1000000.0f);
auto point_stamp =
(unix_second + offset + static_cast<double>(packet_.usec) / 1000000.f - scan_timestamp_);
if (point_stamp < 0) {
point.time_stamp = 0;
} else {
point.time_stamp = static_cast<uint32_t>(point_stamp * 10e9);
}

return point;
}
Expand All @@ -146,7 +153,7 @@ drivers::NebulaPointCloudPtr Pandar64Decoder::convert(size_t block_id)
for (size_t unit_id = 0; unit_id < LASER_COUNT; ++unit_id) {
const auto & unit = block.units[unit_id];
// skip invalid points
if (unit.distance <= 0.1 || unit.distance > 200.0) {
if (unit.distance <= MIN_RANGE || unit.distance > MAX_RANGE) {
continue;
}
block_pc->points.emplace_back(build_point(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ PandarATDecoder::PandarATDecoder(

last_phase_ = 0;
has_scanned_ = false;
first_timestamp_tmp = std::numeric_limits<uint32_t>::max();
first_timestamp_ = first_timestamp_tmp;
scan_timestamp_ = -1;
last_field_ = -1;

scan_pc_.reset(new NebulaPointCloud);
Expand All @@ -62,7 +61,7 @@ bool PandarATDecoder::hasScanned() { return has_scanned_; }

std::tuple<drivers::NebulaPointCloudPtr, double> PandarATDecoder::get_pointcloud()
{
return std::make_tuple(scan_pc_, first_timestamp_);
return std::make_tuple(scan_pc_, scan_timestamp_);
}

void PandarATDecoder::unpack(const pandar_msgs::msg::PandarPacket & pandar_packet)
Expand All @@ -74,8 +73,8 @@ void PandarATDecoder::unpack(const pandar_msgs::msg::PandarPacket & pandar_packe

if (has_scanned_) {
scan_pc_ = overflow_pc_;
first_timestamp_ = first_timestamp_tmp;
first_timestamp_tmp = std::numeric_limits<uint32_t>::max();
auto unix_second = static_cast<double>(timegm(&packet_.t)); // sensor-time (ppt/gps)
scan_timestamp_ = unix_second + static_cast<double>(packet_.usec) / 1000000.f;
overflow_pc_.reset(new NebulaPointCloud);
has_scanned_ = false;
}
Expand Down Expand Up @@ -104,7 +103,6 @@ void PandarATDecoder::unpack(const pandar_msgs::msg::PandarPacket & pandar_packe
}
last_azimuth_ = Azimuth;
last_field_ = field;
last_timestamp_ = packet_.usec;
}
}

Expand Down Expand Up @@ -163,7 +161,9 @@ void PandarATDecoder::CalcXTPointXYZIT(
correction_configuration_->azimuth[i] +
correction_configuration_->getAzimuthAdjustV3(i, Azimuth) * LIDAR_AZIMUTH_UNIT;
azimuth = (MAX_AZI_LEN + azimuth) % MAX_AZI_LEN;
point.azimuth = azimuth / 3600.f;
point.azimuth = deg2rad(azimuth / 3600.f);
point.distance = unit.distance;
point.elevation = elevation;
{
float xyDistance = unit.distance * m_cos_elevation_map_[elevation];
point.x = static_cast<float>(xyDistance * m_sin_azimuth_map_[azimuth]);
Expand All @@ -179,6 +179,7 @@ void PandarATDecoder::CalcXTPointXYZIT(
Azimuth + MAX_AZI_LEN - (azimuth_offset_[i] * 100 * LIDAR_AZIMUTH_UNIT) / 2);
azimuth = (MAX_AZI_LEN + azimuth) % MAX_AZI_LEN;
point.azimuth = azimuth / 3600.f;
point.distance = unit.distance;
point.elevation = elevation;

{
Expand All @@ -188,13 +189,18 @@ void PandarATDecoder::CalcXTPointXYZIT(
point.z = static_cast<float>(unit.distance * m_sin_elevation_map_[elevation]);
}
}

double unix_second = packet_.unix_second;
if (unix_second < first_timestamp_tmp) {
first_timestamp_tmp = unix_second;
auto unix_second = static_cast<double>(timegm(&packet_.t));
if (scan_timestamp_ < 0) { // invalid timestamp
scan_timestamp_ = unix_second + static_cast<double>(packet_.usec) / 1000000.f;
}
point.time_stamp = (static_cast<double>(packet_.usec)) / 1000000.0;
// point.return_type = packet_.return_mode;
auto point_stamp =
(unix_second + static_cast<double>(packet_.usec) / 1000000.f - scan_timestamp_);
if (point_stamp < 0) {
point.time_stamp = 0;
} else {
point.time_stamp = static_cast<uint32_t>(point_stamp * 10e9);
}

switch (packet_.return_mode) {
case STRONGEST_RETURN:
point.return_type = static_cast<uint8_t>(nebula::drivers::ReturnType::STRONGEST);
Expand Down
Loading