msadowski / x2_cartographer

Using YDLIDAR X2 with Google Cartographer ROS package
16 stars 4 forks source link

TRAJECTORY_BUILDER_2D.num_accumulated_range_data = 7 #2

Open elgarbe opened 4 years ago

elgarbe commented 4 years ago

Hi, first of all I would like to thank you for your blog, it has a lot of good and well written information. I found it searching for ardusimple GPS and ROS support, but then read almost all your post.

I'm working on some robots (ASV, UAV and a rover), with odroids and raspberrys, with pixhawks and custom made FCU, with ardusimple and rplidar S1. Right now I would like to ask for some help about cartographer. I was using it on kinetic a couple of yer ago with an hokuyo urg-04x and pixhawk IMU and it perform very well. Now I have a (better?) lidar, a rplidar s1 and I'm trying to get cartogrpher working with it. I found that I can't compile the code anymore on kinetic kane. So I install a VM with ubuntu 18 and install ros melodic. I can compile cartographer_ros now. But I'm facing some problems to get it work with my lidar. The first thing I have found to make it working a little is tunning num_accumulated_range_data. I have found that if it is 1 the slam process doesn't work at all. An using 2 or 3 I get better results. But I can't found anything about tuning it in the documentation. So, how do you get your num_accumulated_range_data = 7? and how do you perform your tunning parameters?

I will be asking other questions related to other interesting blog-post soon.

Thank!

msadowski commented 4 years ago

Hi!

It's been quite a while since I made this repo but the rough description of my tuning workflow might help you:

  1. First I create a bagfile with representative data (in case of mobile robot this would be driving the robot around the room) - ideally without running SLAM
  2. After the bag is recorded I use rosbag_editor to take only the topics of interest for SLAM. If you want to do SLAM then you would most likely be interested in scan and odometry topic. Only take
  3. Create a launch file that will play the bagfile, run the SLAM node, and maybe spawn an RVIZ instance. Use --pause argument in rosbag play to make sure all the software is up before bagfile starts running
  4. Start changing the parameters to see how they affect the SLAM, tune and replay the bag until you are happy with the results
  5. Once you have the parameters tuned in bag file check them with a live system and do any adjustments if necessary

By the way: in my experience S1 is quite awful about coordinate systems. You might want to check these threads: https://github.com/Slamtec/rplidar_ros/issues/31, https://github.com/SteveMacenski/slam_toolbox/issues/198 - they might be quite relevant for you