rosjava: how to call Services of move_base
I want to call the costmapclear service of a rosndk native movebase node from ROSjava. I found an example in the Rosjava docu. But i cant see the service when i start movebase. Its not listed in rosnode info and not in rosservice list. I tried starting the movebase node on my pc but still no services.... Do i have to somehow start the service before i can call it? Thanks in advance
EDIT: only 2 services are listed under movebase: /movebase/getloggers /movebase/setloggerlevel
Asked by manster2209 on 2018-10-02 10:38:47 UTC
Answers
Hi @manster2209,
If you start the node but you don't see the service listed in move_base
, it's likely that something went wrong during the initialization.
move_base
should provide the service server for that service; if that part doesn't start you won't be able to call it using rosjava nor anything else.
Take a look at the documentation for move_base
: http://wiki.ros.org/move_base. Then take a look at the output of your program. Do you see any errors? For the current kinetic
branch, the code starting the service server is here: https://github.com/ros-planning/navigation/blob/73d46b69e20a039f8a35a3f78145ac84a643720b/move_base/src/move_base.cpp#L146. There are a bunch of conditions that may cause the node to exit before getting there, so I'd start looking at that.
Once you see the service listed, calling it using Rosjava is a separate problem.
Asked by jubeira on 2018-10-02 12:19:41 UTC
Comments
Well the thing is otherwise move_base works as it is supposed to. I can drive my robot around and all. I just don't see the services... no errors
Asked by manster2209 on 2018-10-04 01:55:24 UTC
Which version of move_base are you using? the cross compiled one in https://github.com/ekumenlabs/roscpp_android ?
Asked by jubeira on 2018-10-04 07:15:53 UTC
yes that one!
Asked by manster2209 on 2018-10-23 06:22:30 UTC
I just checked and the version that is being cross compiled is move_base 1.12.3. The source code looks similar at that place: https://github.com/ros-planning/navigation/blob/1.12.3/move_base/src/move_base.cpp#L175 so the service should be available. If you don't see it, you should see some error log
Asked by jubeira on 2018-10-30 14:23:11 UTC
Comments