Closed ftyghome closed 2 years ago
Thank you @ftyghome for this pull request.
@ftyghome Please check the direction of the axis in your urdf. Can anyone confirm this merge request is a fix?
@ftyghome Please check the direction of the axis in your urdf. Can anyone confirm this merge request is a fix?
Hi, I am sorry to leave this pull request open that long. Maybe the code is only a workaround for my buggy URDF. I am not working with ROS 1 these days, But once I am sure it was a bug, I'll clean up the code and open another request to fix it. Thank you.
Recently I am testing gmapping with ROS#. I imported the urdf of my robot, set up the navigation stack, and found everything is working fine except the LaserScanReader.
As is shown in the images below, the laser scan data is mirrored in RViz. The obstacles should be on the right side of the robot, not on the left.
After doing some debugging work, I found that this problem is caused by the fact that ROS# does not align the laser data in the same way as ROS. ROS requires that laser scan angles are measured counterclockwise[1], with 0 facing forward, but ROS# uses the clockwise alignment in Unity.
I fixed the problem in this commit. The reason for keeping the old range array is that Laser Scan Visualizer in ROS# may need the data arranged in a clockwise way.
btw, this may help solve issue #199
[1] http://wiki.ros.org/navigation/Tutorials/RobotSetup/Sensors