Coder Social home page Coder Social logo

Comments (7)

ShuffleWire avatar ShuffleWire commented on June 8, 2024 1

Got the same issue here...
Never used rotating lidar, so I can't really help...

from webots.

TonyWelte avatar TonyWelte commented on June 8, 2024 1

I couldn't reproduce this on the master branch by manually compiling the project. Using the nightly build versions 2023b-rev1 seems to work fine, but version 2024a does appear to produce points rotated by 180 degrees.

Looking at the diff between master and develop, it appears there are some updates introduced on develop:

--- a/src/webots/nodes/WbLidar.cpp
+++ b/src/webots/nodes/WbLidar.cpp
@@ -362,7 +362,8 @@ void WbLidar::copyAllLayersToMemoryMappedFile() {
     maxWidth = ((double)w / 2.0) * (1.0 + ratio);
 
     double tmpAngle =
-      (fabs(mPreviousRotatingAngle / (2.0 * M_PI)) - floor(fabs(mPreviousRotatingAngle / (2.0 * M_PI)))) * (2.0 * M_PI);
+      (fabs((mPreviousRotatingAngle - M_PI) / (2.0 * M_PI)) - floor(fabs((mPreviousRotatingAngle - M_PI) / (2.0 * M_PI)))) *
+      (2.0 * M_PI);
     if (tmpAngle < 0)
       tmpAngle += 2.0 * M_PI;
     widthOffset = resolution * (tmpAngle / (2.0 * M_PI));
@@ -383,7 +384,7 @@ void WbLidar::copyAllLayersToMemoryMappedFile() {
         memcpy(data + (i + 1) * resolution + minWidth + widthOffset, mTemporaryImage + width() * (int)(i * skip) + minWidth,
                sizeof(float) * abs(minWidth + widthOffset));
         memcpy(data + i * resolution, mTemporaryImage + width() * (int)(i * skip) - widthOffset,
-               sizeof(float) * (maxWidth + widthOffset));
+               sizeof(float) * abs(maxWidth + widthOffset));
       }
     }
   }

These changes have been introduced by #6324. There must have been a conflict between the changes I made in #6417 and those of #6324. There is a missing - M_PI when theta0 is computed for rotating lidars.

Note: The "tilt angle" can also produce point clouds slightly rotated. #37

from webots.

ShuffleWire avatar ShuffleWire commented on June 8, 2024

Hello,
Take a look at #6417
Try to build webots from source on master, or get a nightly, until the new fixed version is out.

from webots.

francocipollone avatar francocipollone commented on June 8, 2024

image

@ShuffleWire Thanks for quick reply!

from webots.

francocipollone avatar francocipollone commented on June 8, 2024

@ShuffleWire When using the nightly build even tho that error is fixed I noticed now something weird going on when using rotational type.

Equal configuration than before + rotational type

image

It is like the pointcloud is rotated 180 deegres.
It even happens with the default lidar example.

from webots.

ShuffleWire avatar ShuffleWire commented on June 8, 2024

That should be it ! Could you make a quick PR to fix that ?

from webots.

ShuffleWire avatar ShuffleWire commented on June 8, 2024

Closing because PR is merged

from webots.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.