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

Ndt_mapping created pcd in wrong position

asked 2020-04-01 17:04:57 -0500

pedroexe gravatar image

updated 2020-04-08 12:21:04 -0500

Dear,

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-04-09 03:08:14 -0500

yucedagonurcan gravatar image

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?

edit flag offensive delete link more

Comments

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.

pedroexe gravatar image pedroexe  ( 2020-04-09 05:13:57 -0500 )edit

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.

yucedagonurcan gravatar image yucedagonurcan  ( 2020-04-09 05:20:26 -0500 )edit

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:

header: 
  seq: 90186
  stamp: 
    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.

pedroexe gravatar image pedroexe  ( 2020-04-09 05:59:42 -0500 )edit
1

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 ...
(more)
yucedagonurcan gravatar image yucedagonurcan  ( 2020-04-09 06:08:22 -0500 )edit

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?

pedroexe gravatar image pedroexe  ( 2020-04-09 06:10:47 -0500 )edit
1

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.

yucedagonurcan gravatar image yucedagonurcan  ( 2020-04-09 06:16:34 -0500 )edit

Oh, I see. Once I found out the proper initial position I can save it for future use. Good tip.

pedroexe gravatar image pedroexe  ( 2020-04-09 06:20:29 -0500 )edit

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 ...(more)

pedroexe gravatar image pedroexe  ( 2020-04-09 11:24:22 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-04-01 17:04:57 -0500

Seen: 529 times

Last updated: Apr 09 '20