{"action":"created","comment":{"url":"https://api.github.com/repos/ros2/cartographer_ros/pulls/comments/111747894","pull_request_review_id":33010167,"id":111747894,"diff_hunk":"@@ -62,55 +66,46 @@ Node::~Node() {\n \n void Node::Initialize() {\n   carto::common::MutexLocker lock(&mutex_);\n-  submap_list_publisher_ =\n-      node_handle_.advertise<::cartographer_ros_msgs::SubmapList>(\n-          kSubmapListTopic, kLatestOnlyPublisherQueueSize);\n-  submap_query_server_ = node_handle_.advertiseService(\n-      kSubmapQueryServiceName, &Node::HandleSubmapQuery, this);\n+  submap_list_publisher_ = node_handle_->create_publisher<::cartographer_ros_msgs::msg::SubmapList>(kSubmapListTopic, rmw_qos_profile_default);\n+  submap_query_server_ = node_handle_->create_service<::cartographer_ros_msgs::srv::SubmapQuery>(kSubmapQueryServiceName,\n+        [this] (\n+                const std::shared_ptr<::cartographer_ros_msgs::srv::SubmapQuery::Request> request,\n+                std::shared_ptr<::cartographer_ros_msgs::srv::SubmapQuery::Response> response)\n+        {\n+          carto::common::MutexLocker lock(&mutex_);\n+          map_builder_bridge_.HandleSubmapQuery(request, response);\n+        });\n \n   if (options_.map_builder_options.use_trajectory_builder_2d()) {\n     occupancy_grid_publisher_ =\n-        node_handle_.advertise<::nav_msgs::OccupancyGrid>(\n-            kOccupancyGridTopic, kLatestOnlyPublisherQueueSize,\n-            true /* latched */);\n+      node_handle_->create_publisher<::nav_msgs::msg::OccupancyGrid>(kOccupancyGridTopic, rmw_qos_profile_default);\n     occupancy_grid_thread_ =\n         std::thread(&Node::SpinOccupancyGridThreadForever, this);\n   }\n \n   scan_matched_point_cloud_publisher_ =\n-      node_handle_.advertise<sensor_msgs::PointCloud2>(\n-          kScanMatchedPointCloudTopic, kLatestOnlyPublisherQueueSize);\n-\n-  wall_timers_.push_back(node_handle_.createWallTimer(\n-      ::ros::WallDuration(options_.submap_publish_period_sec),\n-      &Node::PublishSubmapList, this));\n-  wall_timers_.push_back(node_handle_.createWallTimer(\n-      ::ros::WallDuration(options_.pose_publish_period_sec),\n-      &Node::PublishTrajectoryStates, this));\n+    node_handle_->create_publisher<sensor_msgs::msg::PointCloud2>(\n+                                                                  kScanMatchedPointCloudTopic, rmw_qos_profile_default);\n+\n+  wall_timers_.push_back(node_handle_->create_wall_timer(std::chrono::milliseconds((int)(options_.submap_publish_period_sec*1000)), std::bind(&Node::PublishSubmapList, this)));","path":"cartographer_ros/cartographer_ros/node.cc","position":75,"original_position":75,"commit_id":"b7357771fdcafddab37856a9af721bfd4b1b0613","original_commit_id":"bfdf8c6e07ea620ecb4a2ebb04a734e0f60b60f5","user":{"login":"clalancette","id":163000,"avatar_url":"https://avatars3.githubusercontent.com/u/163000?v=3","gravatar_id":"","url":"https://api.github.com/users/clalancette","html_url":"https://github.com/clalancette","followers_url":"https://api.github.com/users/clalancette/followers","following_url":"https://api.github.com/users/clalancette/following{/other_user}","gists_url":"https://api.github.com/users/clalancette/gists{/gist_id}","starred_url":"https://api.github.com/users/clalancette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clalancette/subscriptions","organizations_url":"https://api.github.com/users/clalancette/orgs","repos_url":"https://api.github.com/users/clalancette/repos","events_url":"https://api.github.com/users/clalancette/events{/privacy}","received_events_url":"https://api.github.com/users/clalancette/received_events","type":"User","site_admin":false},"body":"Yeah, good point about the line length.  I'll fix that, and also change the casting style.","created_at":"2017-04-17T14:19:32Z","updated_at":"2017-04-17T14:19:33Z","html_url":"https://github.com/ros2/cartographer_ros/pull/1#discussion_r111747894","pull_request_url":"https://api.github.com/repos/ros2/cartographer_ros/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/ros2/cartographer_ros/pulls/comments/111747894"},"html":{"href":"https://github.com/ros2/cartographer_ros/pull/1#discussion_r111747894"},"pull_request":{"href":"https://api.github.com/repos/ros2/cartographer_ros/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/ros2/cartographer_ros/pulls/1","id":113042761,"html_url":"https://github.com/ros2/cartographer_ros/pull/1","diff_url":"https://github.com/ros2/cartographer_ros/pull/1.diff","patch_url":"https://github.com/ros2/cartographer_ros/pull/1.patch","issue_url":"https://api.github.com/repos/ros2/cartographer_ros/issues/1","number":1,"state":"open","locked":false,"title":"Get cartographer working under ROS2","user":{"login":"clalancette","id":163000,"avatar_url":"https://avatars3.githubusercontent.com/u/163000?v=3","gravatar_id":"","url":"https://api.github.com/users/clalancette","html_url":"https://github.com/clalancette","followers_url":"https://api.github.com/users/clalancette/followers","following_url":"https://api.github.com/users/clalancette/following{/other_user}","gists_url":"https://api.github.com/users/clalancette/gists{/gist_id}","starred_url":"https://api.github.com/users/clalancette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clalancette/subscriptions","organizations_url":"https://api.github.com/users/clalancette/orgs","repos_url":"https://api.github.com/users/clalancette/repos","events_url":"https://api.github.com/users/clalancette/events{/privacy}","received_events_url":"https://api.github.com/users/clalancette/received_events","type":"User","site_admin":false},"body":"This PR is the work I have done so far to get cartographer_ros working under ROS2.  This is the bulk of the work that needs to be done, and with this code, the cartographer_ros node builds and starts up.  I haven't been able to test it out fully yet because I still need to do some additional work to translate depth camera data to point cloud data.  I'm working on that now, but I figured I would start this review in the meantime.","created_at":"2017-03-28T19:00:02Z","updated_at":"2017-04-17T14:19:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"705088683e79a018872e5d4c80fb0f1b01c6958d","assignee":{"login":"clalancette","id":163000,"avatar_url":"https://avatars3.githubusercontent.com/u/163000?v=3","gravatar_id":"","url":"https://api.github.com/users/clalancette","html_url":"https://github.com/clalancette","followers_url":"https://api.github.com/users/clalancette/followers","following_url":"https://api.github.com/users/clalancette/following{/other_user}","gists_url":"https://api.github.com/users/clalancette/gists{/gist_id}","starred_url":"https://api.github.com/users/clalancette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clalancette/subscriptions","organizations_url":"https://api.github.com/users/clalancette/orgs","repos_url":"https://api.github.com/users/clalancette/repos","events_url":"https://api.github.com/users/clalancette/events{/privacy}","received_events_url":"https://api.github.com/users/clalancette/received_events","type":"User","site_admin":false},"assignees":[{"login":"clalancette","id":163000,"avatar_url":"https://avatars3.githubusercontent.com/u/163000?v=3","gravatar_id":"","url":"https://api.github.com/users/clalancette","html_url":"https://github.com/clalancette","followers_url":"https://api.github.com/users/clalancette/followers","following_url":"https://api.github.com/users/clalancette/following{/other_user}","gists_url":"https://api.github.com/users/clalancette/gists{/gist_id}","starred_url":"https://api.github.com/users/clalancette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clalancette/subscriptions","organizations_url":"https://api.github.com/users/clalancette/orgs","repos_url":"https://api.github.com/users/clalancette/repos","events_url":"https://api.github.com/users/clalancette/events{/privacy}","received_events_url":"https://api.github.com/users/clalancette/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ros2/cartographer_ros/pulls/1/commits","review_comments_url":"https://api.github.com/repos/ros2/cartographer_ros/pulls/1/comments","review_comment_url":"https://api.github.com/repos/ros2/cartographer_ros/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ros2/cartographer_ros/issues/1/comments","statuses_url":"https://api.github.com/repos/ros2/cartographer_ros/statuses/b7357771fdcafddab37856a9af721bfd4b1b0613","head":{"label":"ros2:ros2-devel","ref":"ros2-devel","sha":"b7357771fdcafddab37856a9af721bfd4b1b0613","user":{"login":"ros2","id":3979232,"avatar_url":"https://avatars2.githubusercontent.com/u/3979232?v=3","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"repo":{"id":85119857,"name":"cartographer_ros","full_name":"ros2/cartographer_ros","owner":{"login":"ros2","id":3979232,"avatar_url":"https://avatars2.githubusercontent.com/u/3979232?v=3","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros2/cartographer_ros","description":"Provides ROS integration for Cartographer.","fork":true,"url":"https://api.github.com/repos/ros2/cartographer_ros","forks_url":"https://api.github.com/repos/ros2/cartographer_ros/forks","keys_url":"https://api.github.com/repos/ros2/cartographer_ros/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros2/cartographer_ros/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros2/cartographer_ros/teams","hooks_url":"https://api.github.com/repos/ros2/cartographer_ros/hooks","issue_events_url":"https://api.github.com/repos/ros2/cartographer_ros/issues/events{/number}","events_url":"https://api.github.com/repos/ros2/cartographer_ros/events","assignees_url":"https://api.github.com/repos/ros2/cartographer_ros/assignees{/user}","branches_url":"https://api.github.com/repos/ros2/cartographer_ros/branches{/branch}","tags_url":"https://api.github.com/repos/ros2/cartographer_ros/tags","blobs_url":"https://api.github.com/repos/ros2/cartographer_ros/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros2/cartographer_ros/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros2/cartographer_ros/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros2/cartographer_ros/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros2/cartographer_ros/statuses/{sha}","languages_url":"https://api.github.com/repos/ros2/cartographer_ros/languages","stargazers_url":"https://api.github.com/repos/ros2/cartographer_ros/stargazers","contributors_url":"https://api.github.com/repos/ros2/cartographer_ros/contributors","subscribers_url":"https://api.github.com/repos/ros2/cartographer_ros/subscribers","subscription_url":"https://api.github.com/repos/ros2/cartographer_ros/subscription","commits_url":"https://api.github.com/repos/ros2/cartographer_ros/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros2/cartographer_ros/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros2/cartographer_ros/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros2/cartographer_ros/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros2/cartographer_ros/contents/{+path}","compare_url":"https://api.github.com/repos/ros2/cartographer_ros/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros2/cartographer_ros/merges","archive_url":"https://api.github.com/repos/ros2/cartographer_ros/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros2/cartographer_ros/downloads","issues_url":"https://api.github.com/repos/ros2/cartographer_ros/issues{/number}","pulls_url":"https://api.github.com/repos/ros2/cartographer_ros/pulls{/number}","milestones_url":"https://api.github.com/repos/ros2/cartographer_ros/milestones{/number}","notifications_url":"https://api.github.com/repos/ros2/cartographer_ros/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros2/cartographer_ros/labels{/name}","releases_url":"https://api.github.com/repos/ros2/cartographer_ros/releases{/id}","deployments_url":"https://api.github.com/repos/ros2/cartographer_ros/deployments","created_at":"2017-03-15T20:53:13Z","updated_at":"2017-03-15T20:53:15Z","pushed_at":"2017-04-12T18:36:55Z","git_url":"git://github.com/ros2/cartographer_ros.git","ssh_url":"git@github.com:ros2/cartographer_ros.git","clone_url":"https://github.com/ros2/cartographer_ros.git","svn_url":"https://github.com/ros2/cartographer_ros","homepage":"","size":402,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ros2:ros2","ref":"ros2","sha":"926afcf7eaa00cd285fc94c0380e2d4f9704c7a0","user":{"login":"ros2","id":3979232,"avatar_url":"https://avatars2.githubusercontent.com/u/3979232?v=3","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"repo":{"id":85119857,"name":"cartographer_ros","full_name":"ros2/cartographer_ros","owner":{"login":"ros2","id":3979232,"avatar_url":"https://avatars2.githubusercontent.com/u/3979232?v=3","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros2/cartographer_ros","description":"Provides ROS integration for Cartographer.","fork":true,"url":"https://api.github.com/repos/ros2/cartographer_ros","forks_url":"https://api.github.com/repos/ros2/cartographer_ros/forks","keys_url":"https://api.github.com/repos/ros2/cartographer_ros/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros2/cartographer_ros/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros2/cartographer_ros/teams","hooks_url":"https://api.github.com/repos/ros2/cartographer_ros/hooks","issue_events_url":"https://api.github.com/repos/ros2/cartographer_ros/issues/events{/number}","events_url":"https://api.github.com/repos/ros2/cartographer_ros/events","assignees_url":"https://api.github.com/repos/ros2/cartographer_ros/assignees{/user}","branches_url":"https://api.github.com/repos/ros2/cartographer_ros/branches{/branch}","tags_url":"https://api.github.com/repos/ros2/cartographer_ros/tags","blobs_url":"https://api.github.com/repos/ros2/cartographer_ros/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros2/cartographer_ros/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros2/cartographer_ros/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros2/cartographer_ros/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros2/cartographer_ros/statuses/{sha}","languages_url":"https://api.github.com/repos/ros2/cartographer_ros/languages","stargazers_url":"https://api.github.com/repos/ros2/cartographer_ros/stargazers","contributors_url":"https://api.github.com/repos/ros2/cartographer_ros/contributors","subscribers_url":"https://api.github.com/repos/ros2/cartographer_ros/subscribers","subscription_url":"https://api.github.com/repos/ros2/cartographer_ros/subscription","commits_url":"https://api.github.com/repos/ros2/cartographer_ros/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros2/cartographer_ros/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros2/cartographer_ros/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros2/cartographer_ros/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros2/cartographer_ros/contents/{+path}","compare_url":"https://api.github.com/repos/ros2/cartographer_ros/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros2/cartographer_ros/merges","archive_url":"https://api.github.com/repos/ros2/cartographer_ros/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros2/cartographer_ros/downloads","issues_url":"https://api.github.com/repos/ros2/cartographer_ros/issues{/number}","pulls_url":"https://api.github.com/repos/ros2/cartographer_ros/pulls{/number}","milestones_url":"https://api.github.com/repos/ros2/cartographer_ros/milestones{/number}","notifications_url":"https://api.github.com/repos/ros2/cartographer_ros/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros2/cartographer_ros/labels{/name}","releases_url":"https://api.github.com/repos/ros2/cartographer_ros/releases{/id}","deployments_url":"https://api.github.com/repos/ros2/cartographer_ros/deployments","created_at":"2017-03-15T20:53:13Z","updated_at":"2017-03-15T20:53:15Z","pushed_at":"2017-04-12T18:36:55Z","git_url":"git://github.com/ros2/cartographer_ros.git","ssh_url":"git@github.com:ros2/cartographer_ros.git","clone_url":"https://github.com/ros2/cartographer_ros.git","svn_url":"https://github.com/ros2/cartographer_ros","homepage":"","size":402,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ros2/cartographer_ros/pulls/1"},"html":{"href":"https://github.com/ros2/cartographer_ros/pull/1"},"issue":{"href":"https://api.github.com/repos/ros2/cartographer_ros/issues/1"},"comments":{"href":"https://api.github.com/repos/ros2/cartographer_ros/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/ros2/cartographer_ros/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/ros2/cartographer_ros/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ros2/cartographer_ros/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/ros2/cartographer_ros/statuses/b7357771fdcafddab37856a9af721bfd4b1b0613"}}}}
{"actor":{"display_login":"clalancette"}}