cartographer-project / cartographer_ros

Provides ROS integration for Cartographer.
Apache License 2.0
1.66k stars 1.21k forks source link

starting with cartographer - provide imu #665

Closed iamdavidbader closed 6 years ago

iamdavidbader commented 6 years ago

Hello, I have problems getting cartographer to work. There are no error messages, but the robot frame (base_link) does not move in the map and only rotates in place. I have provided IMU data.

I have one lidar sensor in the front of a car and an IMU in the rear which is rotated 90° in yaw axis (see *urdf) Now i try to get cartographer to build me a map. Will it even work in an outdoor environment?

This is the link to my modified .urdf, .lua and launch files: Folder

I have run the rosbag_validate and it gives me the following result: File

I cannot really say what that tells me. Is my bag okay?

I hope that you could help me. Thank you.

EDIT: provided launchfiles (demo_honda_2d.launch, honda_2d.launch) with remapping of /adma_imu to /imu and the corresponding configuration files.

Screenshot: screenshot from 2018-01-13 12-55-33

gaschler commented 6 years ago

Yes, cartographer generally works also in outdoor environments. rosbag_validate looks fine. Perhaps you can show a helpful rViz screenshot that explains the behavior? Sure that no changes to the launch file are necessary (like remapping topics)? Has cartographer opened a second submap?

iamdavidbader commented 6 years ago

Thank you for your answer. I have added a screenshot and provided an update to my launch and configuration files. These should work now. Sorry about that.

Update:

After changing the paramter TRAJECTORY_BUILDER_2D.num_accumulated_range_data = 2 and the weight of the ceres_scan_matcher i got some result. But i do not quite understand the parameters. What does num_accumulated_range_data do? From what I have read the weight of the ceres_scan_matcher somehow influence how much I trust in my imu data. Is that correct?

TRAJECTORY_BUILDER_2D.ceres_scan_matcher.translation_weight = 1 TRAJECTORY_BUILDER_2D.ceres_scan_matcher.rotation_weight = 30 TRAJECTORY_BUILDER_2D.ceres_scan_matcher.occupied_space_weight = 2

This is the map i got so far. You see that in the bottom left corner the mapping fails. My pointcloud does not have good features in that area. That's why i like to trust more in my imu data. How can i achieve that?

screenshot from 2018-01-13 16-28-36

gaschler commented 6 years ago

Correct, when you increase TRAJECTORY_BUILDER_2D.ceres_scan_matcher.translation_weight or rotation_weight this will make it more costly to move away from the initial estimate before scan matching. This initial estimate is created by PoseExtrapolator and its rotation depends on IMU data (if there is an IMU). From IMU acceleration, we only use gravity direction.

If you don't see points while moving, the map will be poor in that area.

As with all tuning, please disable global slam POSE_GRAPH.optimize_every_n_nodes = 0 first. With good data and tuning, local SLAM alone should not drift for multiple submaps.

cschuet commented 6 years ago

This thread has not seen activity in a while. Please reopen if you have further questions.

Fanny-one commented 4 years ago

Hi, @cschuet @gaschler @davenass @SirVer I met similar issue above. I have one lidar sensor and an IMU in the rear which is rotated 90° in yaw axis. However, the robot frame (base_link) does not match with map_frame and odom_frame. The detai is present in https://github.com/googlecartographer/cartographer_ros/issues/1455. Thanks in advance.