How to get a local path from teb local planner without topic?
I would like to use teb local planner separately from the general navigation stack with my own navigation algorithms. I can initialize the teb planner, set a costmap, a global plan and compute the velocity commands. The teb planner calculates the local path that is seen via Rviz and the path is valid and feasible.
However, I am interested not in getting the velocity commands but only in the local plan (that is published to the topics /local_plan (nav_msgs/Path)
or /teb_poses (geometry_msgs/PoseArray)
. I would like to get the plan not by subscribing to these topics but through code. Is there a way to do this?
I am using ROS Kinetic with Ubuntu 16.04.
Update: To be more clear, I want to get the local path calculated by teb. The local plan is published to the topic /local_plan (nav_msgs/Path)
. So basically I can write a subscriber to this topic. I am asking whether there is another way to get this path. Like there is a way to get the calculated command velocities through the function bool TebLocalPlannerROS::computeVelocityCommands(geometry_msgs::Twist& cmd_vel)
.
This sounds like a strange use case. To avoid an xy-problem, could you please update your question by editing it and explain what your actually trying to achieve with this?
@mgruhler I added an update. Hope now it is more clear.
@inaba, thanks, but I still don't understand your usecase. Are you using
move_base
withteb_local_planner
as the local planner therein? Or are you using this in your own node? How do you get to call thecomputeVelocityCommands
function? So basically: how to you plan to tap into the API ofteb_local_planner
?@mgruhler I am not using
move_base
and other navigation stack. I have my own nodes for global planner, move base and so on. I created an instance ofTebLocalPlannerROS
in my separate node (that is basically operates like a local planner), and can call the class functions likesetPlan
andcomputeVelocityCommands
from this node. The teb computes the path and publishes it to the topic for visualization purposes only as it is written in the teb tutorial. Everything works just perfect. But the problem that I am not interested in the velocity commands, I am interested in the local path. In order to get it I have to subscribe to this topic that I am trying to avoid.@inaba great. This is what was missing for me to understand your ultimate goal :-)
hi @mgruhler, can you please guide me for writing the separate node (that basically operates like a local planner), I have written my own global planer node, for obstacle avoidance we need to use the teb local planner. So please can you guide me?
@inaba I would also like to use the teb local planner without the general navigation stack(I already created the global planner and the local map). Could you create a repo uploading your solution? Or explain how best to proceed? I'm still relatively new to Ros, so it would be a good support for me to see how others have approached the problem.
@inaba I see that you have solved this problem. I would also like to do the same. Use the teb local planner without the navigation stack since I already have my own global planner. Please could you tell me how to go about this, a github repo would be awesome. Thanks in advance!