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

revert: "fix: correct azimuth offset" #134

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -231,7 +231,7 @@ void Vlp16Decoder::unpack(const velodyne_msgs::msg::VelodynePacket & velodyne_pa
const float azimuth_corrected_f =
azimuth +
(azimuth_diff * ((dsr * VLP16_DSR_TOFFSET) + (firing * VLP16_FIRING_TOFFSET)) /
VLP16_BLOCK_DURATION) - corrections.rot_correction * 180.0 / M_PI * 100;
VLP16_BLOCK_DURATION);
const uint16_t azimuth_corrected =
(static_cast<uint16_t>(round(azimuth_corrected_f))) % 36000;

Expand All @@ -247,8 +247,13 @@ void Vlp16Decoder::unpack(const velodyne_msgs::msg::VelodynePacket & velodyne_pa
// Convert polar coordinates to Euclidean XYZ.
const float cos_vert_angle = corrections.cos_vert_correction;
const float sin_vert_angle = corrections.sin_vert_correction;
const float cos_rot_angle = cos_rot_table_[azimuth_corrected];
const float sin_rot_angle = sin_rot_table_[azimuth_corrected];
const float cos_rot_correction = corrections.cos_rot_correction;
const float sin_rot_correction = corrections.sin_rot_correction;

const float cos_rot_angle = cos_rot_table_[azimuth_corrected] * cos_rot_correction +
sin_rot_table_[azimuth_corrected] * sin_rot_correction;
const float sin_rot_angle = sin_rot_table_[azimuth_corrected] * cos_rot_correction -
cos_rot_table_[azimuth_corrected] * sin_rot_correction;

// Compute the distance in the xy plane (w/o accounting for rotation).
const float xy_distance = distance * cos_vert_angle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@ void Vls128Decoder::unpack(const velodyne_msgs::msg::VelodynePacket & velodyne_p

// Correct for the laser rotation as a function of timing during the firings.
const float azimuth_corrected_f =
azimuth + (azimuth_diff * vls_128_laser_azimuth_cache_[firing_order])
- corrections.rot_correction * 180.0 / M_PI * 100;
azimuth + (azimuth_diff * vls_128_laser_azimuth_cache_[firing_order]);
const uint16_t azimuth_corrected = ((uint16_t)round(azimuth_corrected_f)) % 36000;

if (
Expand All @@ -269,8 +268,13 @@ void Vls128Decoder::unpack(const velodyne_msgs::msg::VelodynePacket & velodyne_p
// convert polar coordinates to Euclidean XYZ.
const float cos_vert_angle = corrections.cos_vert_correction;
const float sin_vert_angle = corrections.sin_vert_correction;
const float cos_rot_angle = cos_rot_table_[azimuth_corrected];
const float sin_rot_angle = sin_rot_table_[azimuth_corrected];
const float cos_rot_correction = corrections.cos_rot_correction;
const float sin_rot_correction = corrections.sin_rot_correction;

const float cos_rot_angle = cos_rot_table_[azimuth_corrected] * cos_rot_correction +
sin_rot_table_[azimuth_corrected] * sin_rot_correction;
const float sin_rot_angle = sin_rot_table_[azimuth_corrected] * cos_rot_correction -
cos_rot_table_[azimuth_corrected] * sin_rot_correction;

// Compute the distance in the xy plane (w/o accounting for rotation).
const float xy_distance = distance * cos_vert_angle;
Expand Down
Binary file modified nebula_tests/data/velodyne/vls128/1614315746748918706.pcd
Binary file not shown.
Loading