Ask Your Question
0

Calling Global Localization Service in C++

asked 2012-08-07 05:32:01 -0500

pdunlap2 gravatar image

Hi all. I have found documentation on calling ros services using ros::service::call but I cannot figure out how to tell it I would like to call the /global_localization service that AMCL provides.

ros::service:call("/global_localization", ???)

What goes in place of the ???

I am working on a program that sends goals to the robot (using the /map frame) and I would like to call the service and have the robot drive around until it is localized instead of using RVIZ to give it a pose estimate manually. I know that I can use rosservice call /global_localization but I would like to do it programmatically if at all possible.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-08-07 05:43:26 -0500

dornhege gravatar image

rosservice type /global_localization will give you the service type to fill in there. You can lookup the contents of the request in the API description.

edit flag offensive delete link more
0

answered 2019-08-11 03:29:38 -0500

rajmohan747 gravatar image

On typing rosservice info /global_localization, you can observe Type: std_srvs/Empty

So you may do service call like rosservice call /global_localization "{}"

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2012-08-07 05:32:01 -0500

Seen: 686 times

Last updated: Aug 11