ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Aligning pcd with UTM frame

asked 2019-06-19 00:14:35 -0500

eduardo gravatar image

Dear community,

I'd like to use GPS data together with NDT matching for vehicle localization. Specifically, I'm using Autoware which allows to use a pose derived from GPS to correct NDT matching. However, to do that, there must be a valid transform between the pose provided by the GPS (I guess the UTM frame)_ and the PCD (I guess the map frame). I saw some given examples where the pcd that is used is already referenced in the UTM frame. That is, the pcd points are specified in UTM coordinates. However, I have built the pcd by myself using ndt mapping and, as result, it has its own frame. How would you address this issue?

So far, I computed the transformation matrix to align my pcd to the UTM frame. I did that using cloudcompare. From the transformation matrix I derived a tf transform. However, the alignment is not fully correct (reasonably good in the x-y plane, but quite bad in z). There are several places in the map where the height difference w.r.t. other points does not correspond to reality. The wrong z value makes ndt failing to initialize the mapping algorithm, although the x-y points are a pretty good initial guess. I was thinking to project the GPS point (i.e., the derived UTM coordinate) into the pcd to get the corresponding z value. Does that make sense? I feel I am missing something here and that there must be a standard way to tackle this issue.

Thanks a lot,


edit retag flag offensive close merge delete


Can't you tranform you map in z direction (or maybe in pitch and roll direction) so that height of pcd matches with GPS point?

mitsudome-r gravatar image mitsudome-r  ( 2019-06-19 02:07:07 -0500 )edit

I tried using only translation transform in z and it helps a bit, but it isn't a proper solution. I'm afraid that playing with pitch and roll might affect the current goodness of x-y values. I also noticed that, in the pcd, streets that are supposed to be flat, look slightly bent in the z axis. This is probably due to the outcome of mapping, but I guess it is a normal result, right? I think the real question is whether transforming the pcd is the best solution, or are there other alternative approches to achieve the same result?

eduardo gravatar image eduardo  ( 2019-06-19 02:15:53 -0500 )edit

Hello Eduardo, Can I ask how you set the transformation matrix to UTM coordinate? Thanks!

huifeng gravatar image huifeng  ( 2020-03-19 03:47:17 -0500 )edit

Even I faced the same problem, there seems to be some translation along the z-axis while map stitching using NDT. I tried with both, ndt_mapping and approximate_ndt_mapping.

I also tried fixing the z_pose to zero while mapping, so as to remove any translations along the z-axis. But the result was improperly stitched and still had some translations along the z-axis. I verified this translation by visualizing the ndt_pose(output pose form ndt_matching). It had some transform along z-axis.

Rather than trying to transform the pointcloud to UTM coordinates, I shifted the origin of the local "map" frame to the UTM coordinate.

Pallav gravatar image Pallav  ( 2020-03-31 04:50:21 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-06-19 03:49:34 -0500

mitsudome-r gravatar image

I also noticed that, in the pcd, streets that are supposed to be flat, look slightly bent in the z axis

I believe this is the root cause that you can't give correct z coordinate. This "bent" cannot be avoided if you are using ndt_mapping to create large maps. If you want to use gps with large environment, then best solution is to ask some companies to create accurate HD(pcd) maps for you. (like HERE, Carmera, etc.)

I was thinking to project the GPS point (i.e., the derived UTM coordinate) into the pcd to get the corresponding z value.

This could work, but it's also very likely that your x,y coordinates are wrong in some parts of your map if the map is "bent". I think it is more appropriate to find a way to get accurate pointcloud.

FYI, PCL library functions in ndt_matching uses float to express x,y,z values. If you are having very large UTM coordinate values, then that may be worsening your ndt_matching accuracy.

edit flag offensive delete link more


As you mentioned that, if we have large UTM coordinate values, then it may make the accuracy worse. I tried it, and faced the same problem. NDT matching accuracy was very poor for large UTM coordinate values. What to do in order to get a well stitched output PCD in the UTM frame? I gave the initial GPS pose values as the initial transformation, as an input to NDT mapping. The output PCD was very poorly stitched. It was just a single pointcloud scan being stitched over and over again. While this the "shift" always remained very high, around 2000. So I tried to give some low UTM coordinate values. It worked.

What should be the ideal approach to solve this problem? Were you able to solve it?

I also saw an increase in the size of the output PCD file on giving initial coordinates

Pallav gravatar image Pallav  ( 2020-04-06 00:17:38 -0500 )edit

Question Tools



Asked: 2019-06-19 00:14:35 -0500

Seen: 916 times

Last updated: Jun 19 '19