Repository Summary

Checkout URI https://github.com/blackcoffeerobotics/vector_pursuit_controller.git
VCS Type git
VCS Version master
Last Updated 2025-05-30
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
vector_pursuit_controller 1.0.1

README

Line Coverage Function Coverage

Vector Pursuit Controller

This ROS2 Humble package contains a plugin for the Nav2 Controller Server that implements the Vector Pursuit path tracking algorithm. It leverages Screw Theory to achieve accurate path tracking and comes with active collision detection. The controller has a very low computational overhead and is very easy and simple to deploy. It tracks path orientation in a geometrically-meaningful way making it an ideal replacement for the Pure Pursuit Algorithm in scenarios where path following accuracy is vital. It consumes 15% of a single core on an ARM cortex-A72 CPU @ 1.8GHz and is designed to track paths at speeds upto 4.5m/s.

https://github.com/user-attachments/assets/5a660fa0-054c-4b14-aecd-d9cfe471930b

Get Started

These are minimal, to-the-point instructions for experienced ROS2/Nav2 users. Beginners are recommended to read the Quickstart Tutorial for a simple 4-step example to try out the controller in a Gazebo simulation.

  1. Install the package binaries.
    sudo apt-get install ros-humble-vector-pursuit-controller
    
  1. Edit the controller_server parameters of the Nav2 stack to include the vector pursuit plugin along with its default configuration. Nav2’s controller server supports multiple controller plugins at the same time and instructions for setting it up can be found in the official docs.

  2. Build the workspace and source it, then run the nav2 stack/controller server.

Features Offered

These are additional features on top of the core Vector Pursuit algorithm that extend its functionality. | Feature | Description | |———|————-| | Adaptive Lookahead Distance | The lookahead distance is used to find the target pose on the path. This target pose is used to guide the robot along the path. This distance can be scaled as per the robot’s velocity to ensure that the robot aims further along the path when moving at greater velocity. The adaptive lookahead distance is computed as the product of the robots current linear velocity and the value set in lookahead_time.| | Collision Aware Linear Velocity | The robot’s linear velocity is automatically scaled preemptively when in proximity to obstacles and completely halted when a collision is imminent. | | Approach Aware Linear Velocity | The robots linear velocity is automatically scaled when nearing a goal pose, this prevents overshoot. | | On Point Rotation | The controller will first rotate on point when attempting to chase a target pose at a heading which is more than the robots current heading by a configurable angle. | | Optional Reversing | The controller will output reverse velocity if the lookahead point is behind the robot (x coordinate of the lookahead point in the robot’s base_link is -ve). |

Configuration

Core Parameters

The following parameters tune the core path-tracking algorithm and are not needed by the additional features.

Parameter Description
k As per equation 3.52 of the Vector Pursuit Algorithm, k is a constant that relates the time taken for rotation and translation. The relationship is rotation_time = k * translation_time. Increasing k will result in a faster translation and decreasing k will, in turn, result in faster rotation.
desired_linear_vel Target linear velocity.
min_linear_velocity Magnitude of the minimum commandable linear velocity.
min_turning_radius Minimum turning radius. The min_turning_radius of the controller should be equal to or less than the minimum turning radius of the planner (in case it is available). This ensures the controller can follow the path generated by the planner and not get stuck in a loop.
max_lateral_accel Maximum allowed lateral acceleration. This is used to slowdown the robot while making sharp turns. Higher values result in a higher achievable linear velocity at a turn.
max_linear_accel Maximum linear acceleration.
use_interpolation Calculate lookahead point exactly at the lookahead distance. Otherwise select a discrete point on the path.
use_heading_from_path If set to true, uses the orientation from the path poses otherwise, computes appropriate orientations. Only set to true if ypu are using a planner that takes robot heading into account like Smac Planner.
max_robot_pose_search_dist Maximum search distance for target poses.

Feature Parameters

These parameters are used to tune and control the behaviour of | Feature | Parameter | Description | |———|———–|————-| | Adaptive Lookahead Distance | use_velocity_scaled_lookahead_dist | enable/disable | || min_lookahead_dist | Minimum lookahead distance. | || max_lookahead_dist | Maximum lookahead distance. | || lookahead_time | The time in seconds to integrate the current linear velocity to get the scaled lookahead distance | | Collision Aware Linear Velocity | use_collision_detection | Enable/disable collision detection. | || use_cost_regulated_linear_velocity_scaling | Enable/disable cost-regulated linear velocity scaling. | || inflation_cost_scaling_factor | Factor for inflation cost scaling. | || max_allowed_time_to_collision_up_to_target | Maximum time allowed for collision checking. | || cost_scaling_dist | Distance for cost-based velocity scaling. | || cost_scaling_gain | Gain factor for cost-based velocity scaling. | | Approach Aware Linear Velocity | approach_velocity_scaling_dist | The distance to goal at which velocity scaling will begin. Set to 0 to disable. | || min_approach_linear_velocity | The minimum velocity this scaling can produce. | | On Point Rotation | use_rotate_to_heading | Enable/disable rotate-to-heading behavior. Will override reversing if both are enabled. | || rotate_to_heading_angular_vel | Angular velocity for rotating to heading. | || rotate_to_heading_min_angle | Minimum angle to trigger rotate-to-heading behavior. | || max_angular_accel | Maximum angular acceleration. | | Optional Reversing | allow_reversing | Will move in reverse if the lookahead point is behind the robot. |

Default Parameters

```yaml controller_server: ros__parameters: use_sim_time: True controller_frequency: 20.0 min_x_velocity_threshold: 0.001 min_y_velocity_threshold: 0.5 min_theta_velocity_threshold: 0.001 failure_tolerance: 0.3 progress_checker_plugin: “progress_checker” goal_checker_plugins: [“general_goal_checker”] controller_plugins: [“FollowPath”]

# Progress checker parameters
progress_checker:
  plugin: "nav2_controller::SimpleProgressChecker"
  required_movement_radius: 0.25
  movement_time_allowance: 10.0

# Goal checker parameters
general_goal_checker:
  plugin: "nav2_controller::SimpleGoalChecker"
  xy_goal_tolerance: 0.25
  yaw_goal_tolerance: 0.25
  stateful: True

FollowPath:
  plugin: "vector_pursuit_controller::VectorPursuitController"
  k: 5.0
  desired_linear_vel: 0.5

File truncated at 100 lines see the full file

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository

Repo symbol

vector_pursuit_controller repository