ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to get a local path from teb local planner without topic?

asked 2019-03-11 11:13:50 -0600

inaba gravatar image

updated 2019-03-12 03:10:31 -0600

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).

edit retag flag offensive close merge delete


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 gravatar image mgruhler  ( 2019-03-12 01:45:19 -0600 )edit

@mgruhler I added an update. Hope now it is more clear.

inaba gravatar image inaba  ( 2019-03-12 03:11:20 -0600 )edit

@inaba, thanks, but I still don't understand your usecase. Are you using move_base with teb_local_planner as the local planner therein? Or are you using this in your own node? How do you get to call the computeVelocityCommands function? So basically: how to you plan to tap into the API of teb_local_planner?

mgruhler gravatar image mgruhler  ( 2019-03-12 03:41:36 -0600 )edit

@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 of TebLocalPlannerROS in my separate node (that is basically operates like a local planner), and can call the class functions like setPlan and computeVelocityCommands 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 gravatar image inaba  ( 2019-03-12 03:59:57 -0600 )edit

@inaba great. This is what was missing for me to understand your ultimate goal :-)

mgruhler gravatar image mgruhler  ( 2019-03-12 04:40:47 -0600 )edit

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?

vishal@leotechsa gravatar image vishal@leotechsa  ( 2019-10-15 04:21:35 -0600 )edit

@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.

NMICHAELB gravatar image NMICHAELB  ( 2021-06-01 10:05:52 -0600 )edit

@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!

Jude Nwadiuto gravatar image Jude Nwadiuto  ( 2021-07-13 07:02:35 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2019-03-12 04:45:47 -0600

mgruhler gravatar image

updated 2019-03-12 08:10:13 -0600

Looking at the interfaces, there is no such function directly available within the teb_local_planner_ros.h. You might consider contacting the maintainer @croesmann either here on the the GitHub repo.

So you might have to implement an interface yourself...

edit flag offensive delete link more


Thank you!

inaba gravatar image inaba  ( 2019-03-12 06:23:21 -0600 )edit

Indeed, even though it would be straightforward to add an accessor method to the teb_local_planner_ros.h interface, I think you are better with simply creating your own interface to omit all navigation stack stuff (like costmaps, ...).. TebLocalPlannerROS just wrapps some simple calls to the PlannerInteface (either TebLocalPlanner or HomotopyClassPlanner, depending on what you want).You can also ahve a look at the source file test_optim_node.cpp for some ideas. Btw. I'll be right back soon to support the planner ;-)

croesmann gravatar image croesmann  ( 2019-03-12 06:37:11 -0600 )edit

THUMBS UP@croesmann. Appreciate it. Really great project you have there!

mgruhler gravatar image mgruhler  ( 2019-03-12 08:09:44 -0600 )edit

@croesmann Thank you! I did this - wrote my own wrapper with an additional function to get the teb optimal path - and it works))

inaba gravatar image inaba  ( 2019-03-14 04:46:43 -0600 )edit

answered 2020-12-22 08:24:33 -0600

DiegoGuffanti gravatar image

Try to remap the /cmd_vel topic to another different i.e. /teb_cmd_vel. Then you will be able to control your robot by sending your own velocity commands using the /cmd_vel topic.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-03-11 11:13:50 -0600

Seen: 743 times

Last updated: Dec 22 '20