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

Bug in ScanPatternGenerator.cs #105

Closed
Autumn60 opened this issue Jan 19, 2024 · 1 comment
Closed

Bug in ScanPatternGenerator.cs #105

Autumn60 opened this issue Jan 19, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Autumn60
Copy link
Contributor

Autumn60 commented Jan 19, 2024

for (int azimuth = 0; azimuth < _azimuthAngleResolution; azimuth++)
{
if (_direction == Direction.CCW) azimuth = _azimuthAngleResolution - 1 - azimuth;
float azimuthAngle = Mathf.Lerp(_minAzimuthAngle, _maxAzimuthAngle, (float)azimuth / _azimuthAngleResolution);
foreach (float zenithAngle in _zenithAngles)
{
scan.scans[index] = Quaternion.Euler(-zenithAngle, azimuthAngle, 0) * Vector3.forward;
index++;
}
}

Loop variables "azimuth" is rewritten in the for statement. (Line 176)
This will cause an error when "_direction" value is set to "Direction.CCW".

@Autumn60 Autumn60 added the bug Something isn't working label Jan 19, 2024
@Autumn60 Autumn60 changed the title Bug in ScanPatternGenerator Bug in ScanPatternGenerator.cs Jan 19, 2024
@Autumn60 Autumn60 self-assigned this Jan 19, 2024
Autumn60 added a commit to Autumn60/UnitySensors that referenced this issue Feb 6, 2024
@Autumn60 Autumn60 linked a pull request Feb 6, 2024 that will close this issue
@Autumn60
Copy link
Contributor Author

Fixed in #113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant