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.

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, Brevik::callPFController, Marcelo::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, Brevik::publish_private, Marcelo::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, Brevik::start, Marcelo::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, Brevik::stop, Marcelo::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, Brevik::reset, Marcelo::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, Brevik::resetVirtualTarget, Marcelo::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, Brevik::setPFGains, Marcelo::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.

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 2022-09-15 at 17:51:33 +0000


Last update: September 15, 2022
Back to top