Vector Pursuit v/s Pure Pursuit ROS2 Controller Plugins

August 13, 2024

Authors: Arthur Gomes, Kostubh Khandelwal

Read time: 5 mins

Vector Pursuit is a geometric path-tracking algorithm that is based on the  Theory of Screws and was first introduced in the paper: Vector Pursuit Path Tracking For Autonomous Ground Vehicles. Vector Pursuit is used to track paths with a high degree of accuracy and relatively fast speeds while being computationally light and very simple to deploy. It simultaneously tracks both orientation and position on a path in a geometrically meaningful way.

The open-source ROS2 ecosystem contains several well regarded mobile robot controllers. ROS2 Navigation Stack (Nav2) is the de-facto navigation software for a variety of robots. Keeping this in mind, we have engineered a Vector Pursuit as a Nav2 plugin, so that it can be easily integrated with a range of ROS2 applications with ease. Our implementation outperforms existing Nav2 controllers in various metrics as discussed later in the article.

Working Principle and Feature Offerings

Vector Pursuit uses a look-ahead distance to define a current goal pose on the path it is required to follow. It calculates the desired motion of the vehicle to reach this goal by considering both its location and orientation while remaining geometrically meaningful and computationally efficient. Vector Pursuit is based on Screw Theory, which describes the instantaneous motion of a rigid body relative to a coordinate system as a screw-like movement around a fixed axis. This controller is applicable to differential, legged and Ackermann mobile robots.

Additional Features Offered

In addition to the core path-tracking algorithm, the Vector Pursuit plugin also offers additional features which are described in brief. All these features can be toggled and tuned using ROS2 parameters.

  • Look-ahead distance scaling: The look-ahead distance is scaled proportionally to the robot’s current linear velocity.
  • Collision awareness: The robot’s velocity is automatically lowered in proximity to obstacles and can be halted completely to avoid imminent collision.
  • Goal overshoot prevention: To avoid overshoot, the controller will lower its approach velocity when nearing a final goal pose.
  • On point rotation: When the trajectory to a look-ahead point deviates from the robot’s current heading by more than a certain angle, the controller will first rotate on point to avoid a large turning arc.
  • Optional reversing: The controller is capable of generating reverse velocity if the path demands it.

Controller Comparison

Two test setups were employed to conduct a comparison of some controllers offered by Nav2 against Vector Pursuit. One was a Gazebo simulation and the other was a real-life, skid-steer robot. Certain controllers like Regulated Pure Pursuit and Dynamic Window Approach have comparable characteristics while others like MPPI are vastly different. The controllers tested against Vector Pursuit are described below.

  • Regulated Pure Pursuit(RPP) is used in path following scenarios with low compute resources. It is easy to tune but it does not take into account the orientation of the path and circumvent obstacles.
  • Dynamic Window Approach(DWB) is used for path following scenarios where highly customizable behavior is required. Although it requires considerably more compute and tuning effort than RPP, it performs better for complex path-tracking and can circumvent obstacles.
  • Model Predictive Path Integral(MPPI) is a path following controller which is ‘critic based’. It considers path orientation and has obstacle avoidance, which comes at a cost of high computation and considerable tuning.

Tracking A Sharp Turn At High Speeds

The objective of this test is to compare the two most computationally efficient controllers Vector Pursuit and Regulated Pure Pursuit in terms of path-tracking quality. They are subjected to identical test conditions. In the figures below, the red line(composed of arrows) represents the odometry of the robot. The green line represents the desired path to be followed. In cases where the red line completely overlaps the green line the path is followed perfectly, deviations from the path will result in a visible green line.

  • At 1 m/s, Pure Pursuit begins to show slight deviations from the path and unwanted oscillations.
Vector Pursuit v/s pure pursuit ros2 path tracking at 1m/s.
Pure Pursuit v/s Vector Pursuit path tracking at 1m/s.
  • At 1.5 m/s, Pure Pursuit shows complete failure in path-tracking with dramatic oscillations. Meanwhile, Vector Pursuit shows almost identical performance.
Vector Pursuit v/s Pure Pursuit ros2 path tracking at 1.m/s.
Pure Pursuit v/s Vector Pursuit path tracking at 1.5m/s

Recorded Computation

This test is meant to showcase the significant differences in CPU usage between the controllers. The Nav2 stack was run without composition on an Intel i5–1135G7 CPU at 2.40GHz with 16GB RAM. The CPU usage of the controller process was logged using the top command line utility and plotted using Python with a sliding window approach for smoothening. The same method was used to test the controllers on an ARM Cortex-A72 CPU @ 1.8 GHz with 8GB RAM.

Testing Vector Pursuit on a real robot.

Testing vector Pursuit on a simulated robot.

CPU usage comparison from an arm64 RPI CPU on a real robot.
CPU usage comparison from an arm64 RPI CPU on a real robot.

CPU usage comparison from an x86 Intel CPU with a simulated robot.
CPU usage comparison from an x86 Intel CPU with a simulated robot.

Inferences

As observed in the above experiments, Vector Pursuit is a robust replacement for Regulated Pure Pursuit (RPP) which struggles to provide reliable turning at high speed. Vector Pursuit displays comparable path-tracking performance to DWB while being simpler and easier to deploy and offers a much lower computational cost.

Conclusion

The release of the Vector Pursuit Plugin addresses the need for a computationally efficient, performant Nav2 controller. Leveraging the principle of Screw Theory, Vector Pursuit offers an optimal balance between precision and resource consumption, making it ideal for systems with limited computational power or scenarios demanding rapid response times.

We at Black Coffee Robotics, are excited to offer this controller to the open-source robotics community and look forward to seeing how it enhances various autonomous navigation projects. The Vector Pursuit Controller is available on GitHub as an industry ready controller plugin for Nav2 with 90% code coverage. We encourage developers to explore, utilize, and contribute to its continuous improvement.

Do you require optimized mobile robot control for your next robotics project? Reach out to us!

Want to reduce costs and time to market for your autonomous robots?