{"action":"created","issue":{"url":"https://api.github.com/repos/googlecartographer/cartographer_ros/issues/770","repository_url":"https://api.github.com/repos/googlecartographer/cartographer_ros","labels_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/issues/770/labels{/name}","comments_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/issues/770/comments","events_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/issues/770/events","html_url":"https://github.com/googlecartographer/cartographer_ros/issues/770","id":304991487,"number":770,"title":"Outdoor mapping using odometry","user":{"login":"aalapshah12297","id":24418184,"avatar_url":"https://avatars0.githubusercontent.com/u/24418184?v=4","gravatar_id":"","url":"https://api.github.com/users/aalapshah12297","html_url":"https://github.com/aalapshah12297","followers_url":"https://api.github.com/users/aalapshah12297/followers","following_url":"https://api.github.com/users/aalapshah12297/following{/other_user}","gists_url":"https://api.github.com/users/aalapshah12297/gists{/gist_id}","starred_url":"https://api.github.com/users/aalapshah12297/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalapshah12297/subscriptions","organizations_url":"https://api.github.com/users/aalapshah12297/orgs","repos_url":"https://api.github.com/users/aalapshah12297/repos","events_url":"https://api.github.com/users/aalapshah12297/events{/privacy}","received_events_url":"https://api.github.com/users/aalapshah12297/received_events","type":"User","site_admin":false},"labels":[{"id":418753827,"url":"https://api.github.com/repos/googlecartographer/cartographer_ros/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-03-14T01:26:26Z","updated_at":"2018-03-14T23:20:32Z","closed_at":null,"author_association":"NONE","body":"Hello.\r\nI have been using cartographer for SLAM on an outdoor ground robot using a laser scanner (8m range, ~13Hz) and odometry (~20Hz). My odometry data is obtained after fusing sensor data from 2 encoders and an IMU, so it is fairly accurate (positional drift is about 20m after a 1000m long run). The twist values are slightly noisy though. However, the outdoor environment is fairly sparse at some locations, so cartographer may often receive empty range data or very few points making scan matching infeasible. During such patches, I do not expect anything more than the trajectory just getting updated from the odometry data and the map->odom transform remaining pretty much the same. Thus, I have tuned cartographer to give more weight to odometry:\r\n```\r\nTRAJECTORY_BUILDER_2D.ceres_scan_matcher.translation_weight = 300\r\nTRAJECTORY_BUILDER_2D.ceres_scan_matcher.rotation_weight = 70\r\n```\r\n\r\nAs such, I mostly need cartographer to correct the global map through loop closure. The local maps don't need much correction. However, for some reason, cartographer publishes a very wrong map->odom transform. In [this](https://drive.google.com/open?id=1CG-NeJRcirXd8Iq2uICjYBGT03-DJMkB) image, without the map->odom transform given by cartographer, the scan would have clearly matched better with the map. Try the demo using my launch file and check around ROS time `1520619573` for a better picture.\r\n\r\nTo further test if my data is correct, I just superimposed the laser scans (you can set Decay Time for the laser scan to a very high value to see this yourself) in Rviz and [compared](https://drive.google.com/open?id=1zehJwlxwHMKRqsJOMQe_MBL-yBn4eE1u) the results with cartographer. The superimposed scans match better to the real environment.\r\n\r\nYou can find the relevant data here:\r\n[bag file](https://drive.google.com/open?id=1vfylEq3GWOl6rvcJz8l1KAVJ35UJHDPo), \r\n[config and launch files](https://github.com/aalapshah12297/cartographer_ros/tree/10b7df113c065e3161ce4a97a09c64f8f7916010),\r\n [output from `rosbag_validate`](https://gist.github.com/aalapshah12297/8a374bfa31b8192c1bf48bdf90768fed).\r\n\r\nSome comments regarding the output from `rosbag_validate`:\r\nThe serialization time vs sensor time problem occurs only at the beginning, so it shouldn't be an issue.\r\nThe 'exactly the same range measurements multiple times' problem may be because of almost empty range data?\r\nThe 'overlapping ranges' error seems faulty. I will add another issue for that separately."},"comment":{"url":"https://api.github.com/repos/googlecartographer/cartographer_ros/issues/comments/373207243","html_url":"https://github.com/googlecartographer/cartographer_ros/issues/770#issuecomment-373207243","issue_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/issues/770","id":373207243,"user":{"login":"aalapshah12297","id":24418184,"avatar_url":"https://avatars0.githubusercontent.com/u/24418184?v=4","gravatar_id":"","url":"https://api.github.com/users/aalapshah12297","html_url":"https://github.com/aalapshah12297","followers_url":"https://api.github.com/users/aalapshah12297/followers","following_url":"https://api.github.com/users/aalapshah12297/following{/other_user}","gists_url":"https://api.github.com/users/aalapshah12297/gists{/gist_id}","starred_url":"https://api.github.com/users/aalapshah12297/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalapshah12297/subscriptions","organizations_url":"https://api.github.com/users/aalapshah12297/orgs","repos_url":"https://api.github.com/users/aalapshah12297/repos","events_url":"https://api.github.com/users/aalapshah12297/events{/privacy}","received_events_url":"https://api.github.com/users/aalapshah12297/received_events","type":"User","site_admin":false},"created_at":"2018-03-14T23:20:32Z","updated_at":"2018-03-14T23:20:32Z","author_association":"NONE","body":"Thanks for the suggestion. I didn't know such a thing was even possible :open_mouth:. I used the code available [here](http://wiki.ros.org/rosbag/Cookbook) to fix my bagfile. I have added the fixed bagfile to my [google drive folder](https://drive.google.com/open?id=1vfylEq3GWOl6rvcJz8l1KAVJ35UJHDPo). Now rosbag_validate no longer gives the 'sensor time vs serialization time' error.\r\nUnfortunately, the results are still equally bad. [Here](https://drive.google.com/open?id=1f_kkTkqRjdId9lKp6iceg6AiihDtoQmW) is a screenshot at a point where the map->odom transform error is more prominent.\r\nThe new bag file still works fine if I just superimpose the stamps in rviz. This time, I also experimented randomly with some parameters;\r\n```\r\noptions = {\r\n...\r\n  num_subdivisions_per_laser_scan = 1,\r\n...\r\n}\r\nTRAJECTORY_BUILDER_2D.num_accumulated_range_data = 1\r\nTRAJECTORY_BUILDER_2D.ceres_scan_matcher.translation_weight = 1\r\nTRAJECTORY_BUILDER_2D.ceres_scan_matcher.rotation_weight = 1\r\n```\r\nThis (weird) choice of parameters seems to give good results for the part with high amount of range data, but even worse results for the part where there is very little range data (as expected). Moreover:\r\n- not splitting scans that are ~0.1s long is a bad practice, and\r\n- I do not wish to set the translation and rotation weights this low for reasons that I have mentioned in my first post.\r\n\r\nSo this does not solve the problem, but maybe this information can help you pinpoint the problem.\r\n\r\nTo summarize:\r\n- Timestamps are no longer a problem,\r\n- Superimposed scans give a good map (implying correct and synchronized odometry & tfs)\r\n- Cartographer + high weights -> bad map\r\n- Cartographer + low weights + no scan division -> good map,  but infeasible"}}
{"actor":{"display_login":"aalapshah12297"}}