Ask Your Question
1

How to use geographic_msgs?

asked 2014-09-08 04:16:39 -0500

chris gravatar image

Hi,

I'm trying to write a little client to access osm maps. What I did so far is:

ros::init(argc, argv, "Geo");
ros::NodeHandle n;
ros::ServiceClient client = n.serviceClient<geographic_msgs::GetGeographicMap>("geographic_msgs");
geographic_msgs::GetGeographicMap srv;

srv.request.url = "http://openstreetmap.org/node/123456";
if(client.call(srv))
{
     ROS_INFO("connected");
}
else
{
     ROS_ERROR("failed");
}

If I run the programm I always get "failed" as an output. Could anyone tell me how to connect to the maps correctly?

Thanks in advance, Chris

edit retag flag offensive close merge delete

Comments

1

Is the service running?

BennyRe gravatar imageBennyRe ( 2014-09-08 06:11:00 -0500 )edit

Unfortunately the service seems not to be running. I tried to run it with rosrun, but there was no executable found. I compiled the Package with catkin_make before and I had no error as a result. In addition the Package seems to be a Metapackage. So how could I start the service?

chris gravatar imagechris ( 2014-09-09 01:34:08 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-09-09 02:00:42 -0500

BennyRe gravatar image

The geographic_info metapackage does not contain any nodes for downloading maps.

Try osm_cartography instead. There's a osm_server node.

edit flag offensive delete link more

Comments

I downloaded a part of the map previously and used:

srv.request.url = "package:///home/user/map.osm";

But this is not working either.

chris gravatar imagechris ( 2014-09-09 02:44:00 -0500 )edit

If you want to call a service, a server providing that service has to be running.

BennyRe gravatar imageBennyRe ( 2014-09-09 03:05:32 -0500 )edit

Do you know how the server in this package is called and how I can run it?

chris gravatar imagechris ( 2014-09-09 04:11:50 -0500 )edit

The wiki page I linked says that the node is called osm_server. And I guess you run it with rosrun osm_cartography osm_server.

BennyRe gravatar imageBennyRe ( 2014-09-09 05:03:14 -0500 )edit

Thanks for your help

chris gravatar imagechris ( 2014-09-09 09:55:59 -0500 )edit

If your question is answered please mark this answer as correct.

BennyRe gravatar imageBennyRe ( 2014-09-09 23:25:56 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-09-08 04:16:39 -0500

Seen: 205 times

Last updated: Sep 09 '14