Skip to content

PathFollowing

A Base class to update the path following law. More...

#include <PathFollowing.h>

Inherited by Aguiar, Brevik, Fossen, Lapierre, Marcelo, Pramod, RelativeHeading, Romulo, Samson

Public Functions

Name
virtual ~PathFollowing()
Virtual destructor for the abstract pathfollowing class.
virtual void callPFController(double dt) =0
Method to update the path following control law.
void publish()
Method to publish the data given by the algorithm.
virtual void publish_private() =0
virtual void start() =0
Method used to setup the algorithm in the first iteration.
virtual bool stop() =0
Method used to check whether we have reached the end of the path following algorithm or not. This method will be called in every iteration of the algorithm, and when it return true, the algorithm will stop.
virtual bool reset() =0
Method used to reset the algorithm control parameters when running the algorithm more than once.
virtual bool resetVirtualTarget(float value)
Method to reset the virtual target of the vehicle (gamma) to a pre-specified value. Not all controllers need this (example: Samson, Fossen which use the closest point)
bool resetVirtualTarget()
Method to reset the virtual target of the vehicle (gamma) to zero. Not all controllers need this (example: Samson, Fossen which use the closest point)
virtual bool setPFGains(std::vector< double > gains) =0
Receives a vector of gains that should be mapped to the specific controller gains.
void UpdateVehicleState(const VehicleState & vehicle_state)
Method to update the vehicle state used by the controller.
void UpdatePathState(const PathState & path_state)
Method to update the path state used by the controller.
void setPFollowingDebugPublisher(const ros::Publisher & pfollowing_debug_pub)
Method to set common publishers.

Protected Functions

Name
double algConvert(double alg_new, double alg_old, double alg_out_old)
Auxiliar method to smooth out the angle to be used by path following algorithms.
double preventPathSectionSwitching(double gamma, double gamma_dot, double dt)
Prevent gamma from going back to a previous section.

Protected Attributes

Name
VehicleState vehicle_state_
Variable to store the state of the vehicle.
PathState path_state_
Variable to store the state of the path.
PFollowingDebug pfollowing_debug_
Variable to store the state of the path.
ros::Publisher pfollowing_debug_pub_

Detailed Description

class PathFollowing;

A Base class to update the path following law.

Author:

  • Marcelo Jacinto
  • Joao Quintas
  • Joao Cruz
  • Hung Tuan

Version: 1.0a

Date: 2021

Copyright: MIT

Public Functions Documentation

function ~PathFollowing

virtual ~PathFollowing()

Virtual destructor for the abstract pathfollowing class.

function callPFController

virtual void callPFController(
    double dt
) =0

Method to update the path following control law.

Parameters:

  • dt The time diference between the current and previous call (in seconds)

Reimplemented by: Pramod::callPFController, RelativeHeading::callPFController, Romulo::callPFController, Fossen::callPFController, Marcelo::callPFController, Brevik::callPFController, Samson::callPFController, Lapierre::callPFController, Aguiar::callPFController

function publish

void publish()

Method to publish the data given by the algorithm.

function publish_private

virtual void publish_private() =0

Reimplemented by: Pramod::publish_private, RelativeHeading::publish_private, Romulo::publish_private, Fossen::publish_private, Marcelo::publish_private, Brevik::publish_private, Samson::publish_private, Lapierre::publish_private, Aguiar::publish_private

function start

virtual void start() =0

Method used to setup the algorithm in the first iteration.

Reimplemented by: Pramod::start, RelativeHeading::start, Romulo::start, Marcelo::start, Brevik::start, Samson::start, Fossen::start, Lapierre::start, Aguiar::start

function stop

virtual bool stop() =0

Method used to check whether we have reached the end of the path following algorithm or not. This method will be called in every iteration of the algorithm, and when it return true, the algorithm will stop.

Return: A boolean that represents whether we have reached the end

Reimplemented by: Pramod::stop, RelativeHeading::stop, Romulo::stop, Marcelo::stop, Brevik::stop, Samson::stop, Fossen::stop, Lapierre::stop, Aguiar::stop

function reset

virtual bool reset() =0

Method used to reset the algorithm control parameters when running the algorithm more than once.

Return: Whether the reset was made successfully or not

Reimplemented by: Pramod::reset, RelativeHeading::reset, Romulo::reset, Marcelo::reset, Brevik::reset, Samson::reset, Fossen::reset, Lapierre::reset, Aguiar::reset

function resetVirtualTarget

virtual bool resetVirtualTarget(
    float value
)

Method to reset the virtual target of the vehicle (gamma) to a pre-specified value. Not all controllers need this (example: Samson, Fossen which use the closest point)

Return: Whether the reset was made successfully or not

Reimplemented by: RelativeHeading::resetVirtualTarget, Romulo::resetVirtualTarget, Marcelo::resetVirtualTarget, Brevik::resetVirtualTarget, Lapierre::resetVirtualTarget, Aguiar::resetVirtualTarget

function resetVirtualTarget

bool resetVirtualTarget()

Method to reset the virtual target of the vehicle (gamma) to zero. Not all controllers need this (example: Samson, Fossen which use the closest point)

Return: Whether the reset was made successfully or not

This method calls the resetVirtualTarget(float value) method which can be overriden by each pf controller

function setPFGains

virtual bool setPFGains(
    std::vector< double > gains
) =0

Receives a vector of gains that should be mapped to the specific controller gains.

Parameters:

  • gains A vector of gains for the controller

Reimplemented by: Pramod::setPFGains, RelativeHeading::setPFGains, Romulo::setPFGains, Fossen::setPFGains, Marcelo::setPFGains, Brevik::setPFGains, Samson::setPFGains, Lapierre::setPFGains, Aguiar::setPFGains

This method must be implemented by each Path Following class

function UpdateVehicleState

void UpdateVehicleState(
    const VehicleState & vehicle_state
)

Method to update the vehicle state used by the controller.

Parameters:

  • vehicle_state A structure with the current state of the vehicle

function UpdatePathState

void UpdatePathState(
    const PathState & path_state
)

Method to update the path state used by the controller.

Parameters:

  • path_state A structure with the current state of the path

function setPFollowingDebugPublisher

inline void setPFollowingDebugPublisher(
    const ros::Publisher & pfollowing_debug_pub
)

Method to set common publishers.

Protected Functions Documentation

function algConvert

double algConvert(
    double alg_new,
    double alg_old,
    double alg_out_old
)

Auxiliar method to smooth out the angle to be used by path following algorithms.

function preventPathSectionSwitching

double preventPathSectionSwitching(
    double gamma,
    double gamma_dot,
    double dt
)

Prevent gamma from going back to a previous section.

Protected Attributes Documentation

variable vehicle_state_

VehicleState vehicle_state_;

Variable to store the state of the vehicle.

variable path_state_

PathState path_state_;

Variable to store the state of the path.

variable pfollowing_debug_

PFollowingDebug pfollowing_debug_;

Variable to store the state of the path.

variable pfollowing_debug_pub_

ros::Publisher pfollowing_debug_pub_;

Updated on 2024-03-07 at 10:30:51 +0000


Last update: March 7, 2024