bobblehead49 / ndt_localizer

3D mapping and localization for ros using NDT with a simple edition of loop closure.
MIT License
3 stars 0 forks source link

Issue with map and pose #2

Open slamer2024 opened 5 months ago

slamer2024 commented 5 months ago

Thank you for sharing your code. I added the static transformation between velodyne and base_link in the launch file. However, after running the launch file, I noticed that there was no displacement between base_link and map. As a result, the full map did not increase. Could you please provide guidance on how to address this issue? Thank you.

bobblehead49 commented 5 months ago

I assume your lidar's frame name is "velodyne". The default frame name using the launch file will be set to "lidar". Please change the argument "lidar_frame" to "velodyne" and give it a shot.

slamer2024 commented 5 months ago

Thank you for your response, I have rechecked. I have already changed the frame name to Velodyne. However, I found that my rosbag does not contain the /odom topic. Why do ndt_mapper and ndt_localizer need to subscribe to the /odom topic? Can't they directly use the method of ndt match? Because my wheel encoder is very inaccurate and cannot provide accurate odometry

bobblehead49 commented 5 months ago

As a premise, NDT matching is optimized by iterative calculation. Think as if the matching point is sought by gradually moving its position to the optimal point. If the initial guess is far from the optimal point, the optimization will take longer time or even fail. This is why you want to use odometry for a better guess.

Now, if you don't have good odometry, you can set the initial guess to the last matched position (zero), or predict the position with uniform linear motion (linear). This can be done by changing the argument "prediction_method" to "zero" or "linear", respectively.

slamer2024 commented 5 months ago

Thank you very much for your response and explanation. I also set "prediction_method" to "zero" (tried "linear") but the AGV still did not move. I attached the result shown in RViz. There are some warnings when I compile the ndt_opt file. Could that be causing the problem? I also added the link to my rosbag here. problem problem https://drive.google.com/file/d/1vhKqErlnq-MhoyAD_eO2IeWS1NvXEtxF/view?usp=drive_link

bobblehead49 commented 5 months ago

I'm not sure whether that warning related to the version of pcl matters. But before that, just to make sure, have you set your initial position in rviz using "2D Pose Estimate"?

slamer2024 commented 5 months ago

yes, I use the pose estimate in rviz, but still the same problem.

bobblehead49 commented 4 months ago

I am terribly sorry for my late response. I've been swamped with other tasks. If you're still having the same issue, could you please provide me the rosbag once again? I can try to make things work.