| 74 | } |
| 75 | |
| 76 | bool LocalizationNode::GetStaticMap(){ |
| 77 | static_map_srv_ = nh_.serviceClient<nav_msgs::GetMap>("static_map"); |
| 78 | ros::service::waitForService("static_map", -1); |
| 79 | nav_msgs::GetMap::Request req; |
| 80 | nav_msgs::GetMap::Response res; |
| 81 | if(static_map_srv_.call(req,res)) { |
| 82 | LOG_INFO << "Received Static Map"; |
| 83 | amcl_ptr_->HandleMapMessage(res.map, init_pose_, init_cov_); |
| 84 | first_map_received_ = true; |
| 85 | return true; |
| 86 | } else{ |
| 87 | LOG_ERROR << "Get static map failed"; |
| 88 | return false; |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | bool LocalizationNode::GetLaserPose() { |
| 93 | auto laser_scan_msg = ros::topic::waitForMessage<sensor_msgs::LaserScan>(laser_topic_); |
nothing calls this directly
no test coverage detected