Giter VIP home page Giter VIP logo

Comments (8)

nickcharron avatar nickcharron commented on May 30, 2024 17

LOAM switches the axes for each scan before processing the scan. I assume the reason this is done has something to do with the standard coordinate frame from of the velodyne which I believe is z-forward. The x-forward convention is a ROS convention and I believe the ROS driver converts to the scans to the proper ROS convention. I imagine LOAM was written for the velodyne convention, not the ROS convention.

To fix this, change the lines 182-184 to:
point.x = laserCloudIn[i].x;
point.y = laserCloudIn[i].y;
point.z = laserCloudIn[i].z;
link:

point.x = laserCloudIn[i].y;

Then, since they make an assumption on which axes correspond to the horizontal and vertical axes, you also need to change the following lines:

float angle = std::atan(point.y / std::sqrt(point.x * point.x + point.z * point.z));

to:

float angle = std::atan(point.z / std::sqrt(point.y * point.y + point.x * point.x));

and

float ori = -std::atan2(point.x, point.z);

to

float ori = -std::atan2(point.y, point.x);

That should fix it! Hope this helps.

from loam_velodyne.

Zhehua-Hu avatar Zhehua-Hu commented on May 30, 2024

You can change Rviz Grid setting to 'XZ'.

from loam_velodyne.

RozDavid avatar RozDavid commented on May 30, 2024

I would have the exact same question as @ashnarayan13!

from loam_velodyne.

ashnarayan13 avatar ashnarayan13 commented on May 30, 2024

@RozDavid , I just had a static transform to handle this. But this doesn't solve the issue of the odometry being in a different frame.
@Zhehua-Hu , I want to change the odometry in the LOAM output

from loam_velodyne.

w4rlock999 avatar w4rlock999 commented on May 30, 2024

@ashnarayan13 have you resolved this problem? i'd like to know as i got this problem too

from loam_velodyne.

RozDavid avatar RozDavid commented on May 30, 2024

Hi @ashnarayan13 @w4rlock999 , I succeeded to resolve the convention issue, for changing the odometry frame a few months ago, just forgot to share it with you guys... Really sorry for that. So after including a static broadcaster in the launch file, something like this:
<node pkg="tf2_ros" type="static_transform_publisher" name="loam_broadcaster" args="0 0 0 0.5 0.5 0.5 0.5 world imu_new"/>

You still need the change the frames rotation quaternion with simply changing the axises. Either the imu or aft_mapped, both works similarly, it depends only on your purpose.

You can check my solution here:
https://github.com/RozDavid/loam-segmatch/blob/d1af9f5116e8c6fc5040d6f2f06868e905dcd7f2/src/lib/LaserOdometry.cpp#L908

In this case I included an extra frame for the static transform, then an extra static at the end, but neither of them are essential, only was important for me.

from loam_velodyne.

w4rlock999 avatar w4rlock999 commented on May 30, 2024

@RozDavid so, what is the purpose of the static broadcaster you make in the launch file? I dont understand?
And also my laserodometry.cpp already use the orientation you use like this:
laserOdometryTrans.setRotation(tf::Quaternion(-geoQuat.y, -geoQuat.z, geoQuat.x, geoQuat.w));
but it is still moving in the Z directions in the Rviz, the Odometry data (/laser_odom_to_init) also move in Z axis.
could you help me?

from loam_velodyne.

ashnarayan13 avatar ashnarayan13 commented on May 30, 2024

@nickcharron Thank you for the clarity.

from loam_velodyne.

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.