siemens / ros-sharp

ROS# is a set of open source software libraries and tools in C# for communicating with ROS from .NET applications, in particular Unity3D
Apache License 2.0
961 stars 365 forks source link

[Bug Fix - #361] Improper radians to degrees conversion in LaserScanReader.cs #364

Closed erdenbatuhan closed 3 years ago

erdenbatuhan commented 3 years ago

Description

Fixed the issue (#361) in LaserScanReader.cs that was causing improper radians to degrees conversion.

Screenshots

Screen Shot 2020-12-02 at 02 14 34

Test parameters

angle_min=-3.14 sample=360 angle_increment=0.01745329 angle_max=0.01745329

Observed results before the fix (As written in #361)

Read the output angle_min - angle_increment * i * 180 / Mathf.PI calculation and you'll see instead that it starts from -3.14 degrees.

Another sanity check, using the values listed above. An object directly infront of the laserScanReader you would expect values in the middle of the Ranges[] output. While currently you would find them are the beginning/end of the Range[] array.

Expected results before the fix (As written in #361)

We should expect laserScanReader to start from -3.14 (-180) and iterate through to 3.14(180)

Observed results after the fix

As can be seen in the screenshot above, laserScanReader starts from -180 degrees and iterates through to 180 degrees.

MartinBischoff commented 3 years ago

Thank you @erdenbatuhan for this fix and for the clear documentation.