Rosanswers logo


First of all, I'm using Autoware 1.12 and Ubuntu 16.

I created a point cloud map using the ndt_mapping while reproducing a bag file from the autoware data website. However, when reproducing the bag simulation with the pcd map loaded, the zero (origin) of the /map is too far away from the /base_link, such that the car and its lidar point cloud never overlap the cloud map.

The procedure was the following:

  1. Simulation tab -> Play and pause the bag file.

  2. Setup tab -> Start TF (Baselink to localizer) using the transform contained in the bag file (x=1.2 y=0 z=2.35).

  3. Setup tab -> Start the vehicle model (left blank, using the default model I guess).

  4. Quick Start tab -> Run my_sensing.launch (the same from the autoware sample), because otherwise the ndt_mapping does not even compute anything.

  5. Computing tab -> start the ndt_mapping.

  6. Simulation tab -> play the bag file for a while.

  7. Simulation tab -> stop the simulation.

  8. Computing tab -> ndt_mapping -> app -> export the pcd file.

  9. Restart autoware from scratch

  10. Simulation tab -> start the simulation and pause

  11. Quick start -> run my_map, to load the map, and my_sensing to make lidar work.

  12. Simulation tab -> play the simulation and watch it on rviz

Any ideas on what the problem could be?

I thank you in advance for any suggestions.

Update: Did the same with a bag created with the kitti dataset, using the kitti2bag tool.

The map is near the car in this case (probably because there is no gps data in the rosbag file, and both are placed in x=0, y=0, z=0), but when reproducing, the car is not aligned with the map (figure attached). The car indeed goes to the left (of the figure), while it should be going to the right (of the figure), where it went when the map was created.

Since I'm reproducing over the map generated with the same rosbag file, I don't understand why that happens. Do I have to manually rotate/replace the map everytime I generate it with ndt_mapping?

image description

Again, thank you.

Originally posted by pedroexe on ROS Answers with karma: 50 on 2020-04-01

Post score: 0


1 Answer 1


Rosanswers logo

Hello pedroexe, maybe you are giving reverse direction on RViz? I noticed there is an reverse in X direction on point cloud? For example I can see you give the direction from right to the left, but point cloud is obviously will be okay if you give the Pose Estimation as left to right.

Or you can share the rosbag and the pcd file?

Originally posted by yucedagonurcan with karma: 46 on 2020-04-09

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by pedroexe on 2020-04-09:
Hi @yucedagonurcan, thank you for taking the time to answer me.

Regarding your question, I'm not sure if I'm giving reverse direction. I'm not setting an initial pose at all. As in the Moryama sample, I'd like the map and the car to be aligned in the startup. Indeed the bag has nmea_sentences topic, and ndt_mapping using GPS is failing to overlap the car with the map even though. I think there is some problem with my transforms (tf), that should properly set this alignment.

You can find the bag file I'm using here and the map file here

This data regards to autoware-20180205150908.bag file, not the kitti example in the picture. I think this bag and map illustrate the problem more clearly since the car and the map are too far away from each other in this case.

Comment by yucedagonurcan on 2020-04-09:
Okay I see, just for proof of concept can you filter out the nmea_sentences from the RosBAG and give 2D pose manually from Rviz? So we can understand this problem is because of the nme_sentences; if manual 2D pose estimate is correct.

Comment by pedroexe on 2020-04-09:
Ok, I was mistaken. There was no nmea_senteces in this specific bag, sorry (probably saw in another one I was trying). But there was /ndt_pose and /localizer_pose, which I filtered out. Selecting a 2D pose didn't work, but I'm not very confident of my pose guess. I tried posing (several times) whereby the same point the map started being created, but the car does not stay there or follow the road from that on. /ndt_stats reports:

  seq: 90186
    secs: 1517811143
    nsecs: 393114000
  frame_id: ''
exe_time: 33.7470016479
iteration: 2
score: 0.201534792781
velocity: 3.94953489304
acceleration: -2.56295537949
use_predict_pose: 0

But the car and the map just randomly move in rviz. If the case is to find a good initial pose, I'm afraid this would make the bag file simulation very time consuming to set up every time.

Comment by yucedagonurcan on 2020-04-09:
It's just how ndt_matching algorithm works, it will try to match the points_raw with the pcd to localize ego vehicle. You can always add the initial pose in your launch file like this:

 <!-- Preconfigured initial pose -->
  <node pkg="rostopic" type="rostopic" name="initialPose"
        args="pub -l /initialpose geometry_msgs/PoseWithCovarianceStamped
        '{header:  {seq: 2, stamp: {secs: 1576766523, nsecs: 804232569}, frame_id: 'world'}, pose: {pose: {position: {x: -0.457015991211, y: 0.0367670059204, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.00127136290632, w: 0.999999191818}}, covariance: [0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.06853891945200942]}}' "/>

Comment by pedroexe on 2020-04-09:
Thank you for your feedback. Are those values set to the map/bag file I sent? How can I found out the values of x,y,z, and covariance to set up and try it?

Comment by yucedagonurcan on 2020-04-09:
No I didn't tried you rosbag yet still downloading, you can set the initial pose in the rviz and echo the "/initialpose" topic to get the message of initialpose.

Comment by pedroexe on 2020-04-09:
Oh, I see. Once I found out the proper initial position I can save it for future use. Good tip.

Comment by pedroexe on 2020-04-09:
Hi, @yucedagonurcan just an update to you and anyone that might have this problem in the future. The bag file I sent you had a tf transform between world and map (which I didn't know how to setup when reproducing). To ignore that, I filtered the tf from the bag file, as also the ndt_pose and localization_pose. Then I re-mapped from scratch with ndt_mapping using my own tf map/world with everything set to 0.

Now when I load/playing the map/bag the /base_link and the /map are near eachother, and it is easier to set the initial position. I could set the initial pose 2D through rviz, started ndt_matching, and it worked very well! Your colaboration for the proconfigured initial pose will also be of great value to me, thank you!

The only drawback is that I don't know what to do in cases where there is a nmea_sentence, if the world/map static transform must be set accordingly to the gps coordinates or something like that, but that's a future's problem.

Again, thanks for all the help!

Comment by yucedagonurcan on 2020-04-09:
I am glad you fixed the problem, about the second problem you know you will be facing: Autoware plans to add an another plane for custom places outside the Japan. But for now you can change a plane in nmea2tfpose with your corresponding initial position lat long. And of course you need to consider the rotation as well for this reason you need to change the geo_pos_conv little bit.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.