cartographer-project / cartographer_ros

Provides ROS integration for Cartographer.
Apache License 2.0
1.64k stars 1.2k forks source link

Requiring help tuning cartographer #1081

Closed frederikscholz closed 5 years ago

frederikscholz commented 5 years ago

Hello ,

I am currently testing the implementation of cartographer on Softbank Robotics' Pepper. My goal is to create a map that is good enough for the robot to navigate itself via the navigation stack to predetermined locations.

So far I have managed to create somewhat satisfying results, but I feel with proper tuning I could manage to do even better, but I have hit a wall with my limited knowledge on how high/low various parameters should be, and how they interact with each other. I'd be very thankful for any help I could get to further improve the tuning!

Unfortunately, with the platform being set, I have no possibilities to use more suitable hardware as the odometry is quite poor, for example. The laser scanners are also rather impractical for SLAM usage, which is why I use depthimage_to_laserscan, but the head in which the camera is mounted isn't 100% stable.

Thanks in advance for any help, I'll happily provide anything else that might be needed to further advance this project.

gaschler commented 5 years ago

I just had a quick look at the files you linked and pepper_2d.lua.

You could take a look at the turtlebot config: https://github.com/googlecartographer/cartographer_turtlebot/blob/master/cartographer_turtlebot/configuration_files/turtlebot_depth_camera_2d.lua

I1029 14:17:54.377303 12826 rosbag_validate_main.cc:398] Time delta histogram for consecutive messages on topic "/scan" (frame_id: "base_link"):
Count: 893  Min: 0.015077  Max: 2.497158  Mean: 0.320654

The scan topic has some large gaps, is there any way to reduce these?

TRAJECTORY_BUILDER_2D.submaps.num_range_data = 90

Reduce slightly, should be 10--30 seconds worth of data.

POSE_GRAPH.constraint_builder.sampling_ratio = 1.

This is far too high, you would end up with a huge background work queue.

TRAJECTORY_BUILDER_2D.ceres_scan_matcher.translation_weight = 3e2

Set lower. Lower means you don't trust odometry/inertial PoseExtrapolator.

use_odometry = true,

Disable, especially since you say it's poor.

TRAJECTORY_BUILDER_2D.submaps.grid_options_2d.resolution = 0.06

It's worth trying even higher, 0.08.

TRAJECTORY_BUILDER_2D.missing_data_ray_length = 0.2

I'd try 2--3 meters.

Hope this helps.

Is SLAM without loop closure ok with these parameters?

frederikscholz commented 5 years ago

Thanks for your quick input!

I based my initial configs on the turtlebot files and then got to where I was through testing, but I'll have another look and compare the hardware to see where I can make further adjustments.

The scan topic has some large gaps, is there any way to reduce these?

I'll look into it, but I think the problem is because of the limited framerate of the camera; I could maybe improve this by connecting the robot to the pc via an ethernet cable, but for it's intended use of autonomous navigation this is rather unfeasible.

Reduce slightly, should be 10--30 seconds worth of data.

Thanks, I adjusted it to 50 and now consistently get new submaps in that timeframe. Right now I've been testing with global scan matching turned off, should POSE_GRAPH.optimize_every_n_nodes match this value or was this just a coincidence in the turtle bot config?

Set lower. Lower means you don't trust odometry/inertial PoseExtrapolator.

The translational odometry is fine, but the rotational value is off by a good margin, should I adjust this anyways? Initial tests seem to improve when I lower this value, but I figured I'd ask regardless.

This is far too high, you would end up with a huge background work queue.

I wasn't aware of that at all, thanks! I adjusted this to 0.3, but this value isn't based on any data; is there a good way to go about finding a good value, or is straight up testing the best possibility?

Disable, especially since you say it's poor.

Should I still disable this even with the translational odometry being fine?

It's worth trying even higher, 0.08.

Adjusted.

I'd try 2--3 meters.

Thanks!

The biggest problem I can see right now is the boundaries of the map being very noisy (see here), do you know what could be the primary reason for this?

Again, thanks for your help!

ojura commented 5 years ago

It would be nice if we had a tuning/launch files for Pepper, feel free to open a PR.