ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to use GetMap-Service by gmapping

asked 2016-02-29 14:36:08 -0600

Alex1209 gravatar image

I'm using gmapping to create a map. To this point everything works fine.

Now I want to call the GetMap-Service to receive the map for further investigation:

#include <nav_msgs/GetMap.h>

ros::ServiceClient client = n.serviceClient<nav_msgs::GetMap>("map");
nav_msgs::GetMap srv;

  if (client.call(srv))
  {
    ROS_INFO("Service GetMap succeeded.");
  }
  else
  {
    ROS_ERROR("Service GetMap failed.");
    return 1;
  }

But when running this node I always get "Service GetMap failed." I added gmapping to "find packages" in CMakefile and to build & runtime dependencies in package xml.

What's my fault?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-02-29 15:58:57 -0600

dornhege gravatar image

According to the documentation, the service is called dynamic_map. Try that one.

edit flag offensive delete link more

Comments

so you mean to use gmapping::dynamic_map instead of nav_msgs::GetMapas service? And include #include <gmapping/dynamic_map.h> ? Can you post a link to documentation please? If I do so I get the fault "gmapping/dynamic_map not found"

Alex1209 gravatar image Alex1209  ( 2016-03-02 12:08:55 -0600 )edit

I now found the documentation you talk about I think. Is it this? so I in cluded #include slam_gmapping.h but when i catkin_make this file cannot be found. :(

Alex1209 gravatar image Alex1209  ( 2016-03-03 15:37:15 -0600 )edit
dornhege gravatar image dornhege  ( 2016-03-04 04:41:02 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-02-29 14:36:08 -0600

Seen: 1,322 times

Last updated: Feb 29 '16