Ask Your Question

How to call service global_localization

asked 2016-12-15 19:21:20 -0500

SJ亮 gravatar image

I'm learning navigation ,I meet a question. how to call service global_localization. Because now the robot doesn't know its
position when the power switch is on ,I have to put it in the origin of map.if not ,the robot will deem that the position where when the power switch is on is the origin of map .Then the robot can't reach the accurate position .So ,I want to write a c++ code to make the robot know its position when the power switch is on .I have found some information ,some argue that in RVIZ click the position estimated .Some argue that call service global_localization ,but this call in the terminal input "rosservice call /global_localization".These are not that i want to use .Maybe there are other solutions to my demand. Please help me to analyze it .Thanks .

Now,I have wrote a node to call service global_localization.However,some problems appeared .sometime the robot warn "Unable to get starting pose of robot, unable to create global plan" ,then the robot can't move .Sometime the service call failed .I don't know why ?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-10-05 13:24:42 -0500

JackB gravatar image

At a high level, use the "client node" example from ROS service tutorial and replace the add_two_ints service with std_srvs::Empty.

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

1 follower


Asked: 2016-12-15 19:21:20 -0500

Seen: 586 times

Last updated: Oct 05 '20