Rosanswers logo

Hello people,

I am trying to generate collision free trajectory using specific planning algorithm and i got my trajectories from my planner and now i need a path-following controller to make the car-like robot to follow the concern trajectory.

So it there any good in-built path following controller code in ROS that i can use directly? Or any suggestions which controller that i can use? ( i am already trying to built pure-pursuit controller on my own, but i am bit lost!)

Any help will be much grateful!!

Originally posted by vignesh on ROS Answers with karma: 101 on 2016-05-17

Post score: 1


1 Answer 1


Rosanswers logo

Hi vignesh,

according to your description I guess that you are looking for a path controller rather than a tracking controller. However, your specific planning algorithm returns a trajectory? The question is now: trajectory tracking (following the desired time profile) or path following. And it is further important to know, if your planner returns trajectories that are already feasible for your car-like robot or if it is just a coarse reference path without taking kinodynamic constraints into account.

Depending your problem setup you have multiple options:

  • ros_control: ros-control provides generic interfaces for controllers. Package ros_controllers already provides some common implementations (for robotic arms, and for a diff-drive robot). You could implement your controller here (e.g. your pure pursuit). Or try one of the existing controllers. Since you have a car-like robot, a simple PID controller should not fit well I guess. The choice probably depends on your reference path / trajectory.

  • ros navigation: You can wrap your specific planning algorithm into a global planner plugin in order to be compliant with move_base (refer to navigation tutorials). Afterwards you can implement your pure pursuit algorithm as local planner plugin. Using this approach you can benefit from localization, maps etc. Since you are asking for existing packages for path following: You could try teb_local_planner which supports car-like robots and also provides a path following mode in which the distance to the reference path is minimized. The reference path may also be really coarse. However, since it is an optimization based approach, the computational burden is quite large. There is a tutorial on path following. But you need the planner version 0.4 which is not yet on the public repositories. I guess a sync will not take place before kinetic is released next week. But you can compile the package from source. You might also refer to this Question.

EDIT: I found a standalone pure pursuit implementation here. The source is for ROS hydro, but it should work (with minor modifications) on newer distributions as well. But I have never used the planner and hence cannot tell anything about it.

I hope that helps.


Originally posted by croesmann with karma: 2531 on 2016-05-17

This answer was ACCEPTED on the original site

Post score: 13

Original comments

Comment by vignesh on 2016-05-17:
Thanks for the much detailed answer croesmann. My planner will give trajectory according to kinodynamic constraints of car-like robot. (but i have also taken those trajectories poses and stored as way points with nav_msgs::Path message type !). My controller just have to follow feasible path!

Comment by vignesh on 2016-05-17:
ros-control seems to be good option to proceed on but there are lot of existing controllers already in it! Do u know which controller will be feasible for car-like robot?

ros navigation won't adapt for my environment i guess and i will look into pure pursuit code!

Comment by merlinwu on 2017-10-29:
Hi Croesmann, How about robot_controller package developed by Fetch Robotics where there were some safety control features powered by Laser sensor


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.