Example 'Build a Map from Lidar Data Using SLAM' Confusion
Show older comments
Hi,
I'm trying to follow the example 'Build a Map from Lidar Data Using SLAM' from the computer vision toolbox.
In the function helperComputeInitialEstimateFromINS, there are three lines that I really tried to understand but without sucess.
My problem is not in the theory but in this particular implementation. Here are the lines
% The INS readings are provided with X pointing to the front, Y to the left
% and Z up. Translation below accounts for transformation into the lidar
% frame.
insToLidarOffset = [0 -0.79 -1.73]; % See DATAFORMAT.txt
Tnow = [-insData.Y(end), insData.X(end), insData.Z(end)].' + insToLidarOffset';
Tbef = [-insData.Y(1) , insData.X(1) , insData.Z(1)].' + insToLidarOffset';
- The DATAFORMAT.txt file says that the transform from IMU to lidar is [0.79 0 1.73]. Why is it not implemented this way then?
- Why are X and Y coordinates inverted and negative in Tnow and Tbef? It is clear in the DATAFORMAT.txt that the X coordinates is front, Y coordinates is left and Z coordinates is up
What makes even less sense to me is that the transformation to insToLidarOffset (i.e.: switching X,Y then put them negative) and the transformation to Tnow and Tbef (i.e.: switching X,Y then just put Y negative) is not even the same.
I appreciate the time you take to answer this question,
Marc
1 Comment
Marc Tison
on 26 Nov 2020
Answers (1)
Vinoth Venkatesan
on 2 Dec 2020
Edited: Vinoth Venkatesan
on 2 Dec 2020
0 votes
Hi Marc,
There are two things to note here:
- The Lidar coordinate system (the one which is used in the pointCloud objects returned by helperReadPointCloudFromFile) has the X-axis pointing to the right, Y-axis to the front (in the direction of motion of the ego-vehicle) and Z-axis pointing up. You can see this while visualizing the point cloud data in the "Load and Explore Recorded Data" section in the example. In order to account for this, the INS readings are switched so that INS-X -> Lidar-Y and INS-Y -> -(Lidar-X)
- The extrinsics provided in the DATAFORMATS.txt refer to the offset of the Velodyne frame w.r.t. the IMU (vehicle) frame. Since we want the offset of the IMU frame w.r.t. the Velodyne frame, the signs are switched as well, and so the offset is set to [0 -0.79 -1.73].
3 Comments
Marc Tison
on 2 Dec 2020
Edited: Marc Tison
on 2 Dec 2020
Vinoth Venkatesan
on 3 Dec 2020
I have a couple of follow-up questions:
- Could you provide more info about what you mean by "Velodyne frame transformation is being cancelled at the last line of the function"? Since the offset is relatively low compared to the actual INS datapoints, the results you observe with or without the insToLidarOffset might appear to be similar, but are not the same. Try inspecting the initTform values after setting format long in the Command Window.
- Could you provide details about the better odometry results that you were able to obtain? Also, by fixing the problem, do you mean removing the offset completely?
Marc Tison
on 3 Dec 2020
Categories
Find more on Point Cloud Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!