Ask Your Question
0

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

Comments

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

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

inaba gravatar imageinaba ( 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 imagemgruhler ( 2019-03-12 03:41:36 -0600 )edit
1

@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 imageinaba ( 2019-03-12 03:59:57 -0600 )edit

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

mgruhler gravatar imagemgruhler ( 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 imagevishal@leotechsa ( 2019-10-15 04:21:35 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

Comments

Thank you!

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

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 imagecroesmann ( 2019-03-12 06:37:11 -0600 )edit

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

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

@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 imageinaba ( 2019-03-14 04:46:43 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 96 times

Last updated: Mar 12