How to call service global_localization
I'm learning navigation ,I meet a question. how to call service globallocalization. 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 globallocalization ,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 ?
Asked by SJ亮 on 2016-12-15 20:21:20 UTC
Answers
At a high level, use the "client node" example from ROS service tutorial and replace the add_two_ints service with std_srvs::Empty.
Asked by JackB on 2020-10-05 13:24:42 UTC
Comments