Skip to content

Commit

Permalink
Merge pull request #113 from Field-Robotics-Japan/feature/hdl32ScanPa…
Browse files Browse the repository at this point in the history
…ttern

Add ScanPattern for Velodyne HDL32-E
  • Loading branch information
Autumn60 authored Feb 10, 2024
2 parents fff9462 + fde6678 commit ac4947d
Show file tree
Hide file tree
Showing 7 changed files with 345,633 additions and 8 deletions.
3 changes: 1 addition & 2 deletions Assets/UnitySensors/Editor/LiDAR/ScanPatternGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ private void GenerateFromSpecification()
int index = 0;
for (int azimuth = 0; azimuth < _azimuthAngleResolution; azimuth++)
{
if (_direction == Direction.CCW) azimuth = _azimuthAngleResolution - 1 - azimuth;
float azimuthAngle = Mathf.Lerp(_minAzimuthAngle, _maxAzimuthAngle, (float)azimuth / _azimuthAngleResolution);
float azimuthAngle = Mathf.Lerp(_minAzimuthAngle, _maxAzimuthAngle, (float)(_direction == Direction.CW ? azimuth : _azimuthAngleResolution - 1 - azimuth) / _azimuthAngleResolution);
foreach (float zenithAngle in _zenithAngles)
{
scan.scans[index] = Quaternion.Euler(-zenithAngle, azimuthAngle, 0) * Vector3.forward;
Expand Down
Loading

0 comments on commit ac4947d

Please sign in to comment.