How to connect to roscore with roslibpy and without a full ROS installation?
I need to query roscore (from Linux and/or windows) and get the path (getpath). I found https://answers.ros.org/question/330609/how-can-i-use-getplan-service-in-python/ this question/answer, which would do exactly what I need.
For a couple of reasons, it is hard to do a full ROS install. But I did manage to install roslibpy and would like to use it to talk to roscoare to get the path.
What is the surrounding glue code to connect with roslibpy
to roscore from locahost or elsewhere and submit this message (and get the answer):
get_plan = rospy.ServiceProxy('/move_base/make_plan', nav_msgs.GetPlan)
req = nav_msgs.GetPlan()
req.start = start
req.goal = Goal
req.tolerance = .5
resp = get_plan(req.start, req.goal, req.tolerance)
print(resp)
Asked by stockh0lm on 2023-03-03 10:46:43 UTC
Comments
Whenever I see Python, ROS and "I don't want to / can't install ROS", I tend to suggest rospypi/simple.
It's exactly
rospy
, but without a "ROS install". Works on all OS with a Python interpreter (have tested Linux, Windows and macOS). Uses the exact same messages, same API, same config, etc.Asked by gvdhoorn on 2023-03-05 11:53:48 UTC