Skip to content

Circle2D

Class that implements a 2D Circle section. More...

#include <Circle2D.h>

Inherits from PathSection

Public Functions

Name
Circle2D(double radius, double center_x, double center_y)
Constructor for the path section that assumes the plane in which the path is placed is z=0.
Circle2D(double radius, double center_x, double center_y, double z)
Constructor for the path section.
virtual Eigen::Vector3d eq_pd(double t) override
Path Section equation.
virtual Eigen::Vector3d eq_d_pd(double t) override
First derivative of the path section equation with respect to the path parameter.
virtual Eigen::Vector3d eq_dd_pd(double t) override
Second derivative of the path section equation with respect to the path parameter t.
virtual double curvature(double t) override
Compute the curvature using only the radius. Computed as 1/Radius.
virtual double getClosestPointGamma(Eigen::Vector3d & coordinate) override
Method for getting the gamma of the closest point.

Additional inherited members

Public Functions inherited from PathSection

Name
virtual double tangent(double t)
Default method for computing the tangent to the path section.
virtual double derivative_norm(double t)
Default method for computing the norm of the derivative.
bool can_be_composed()
Method to return whether a pathSection can be composed with other path sections or not.
double limitGamma(double t)
Method to limit the gamma between the minimum and maximum value By default the maximum gamma is a very high number.
double getMaxGammaValue()
Method used to get the maximum gamma allowed by the path section By the default is the maximum valid number possible in c++.
double getMinGammaValue()
Method used to get the minimum gamma allowed by the path section By default is the minimum valid number possible in c++.
virtual ~PathSection()
Virtual destructor for the abstract class.

Protected Functions inherited from PathSection

Name
PathSection(bool can_be_composed)
Constructor for the abstract class i NOTE: this class is virtual, therefore an object of type PathSection cannot be instantiated in memory. Only derivatives of the class PathSection.
bool setMaxGammaValue(double gamma_max)
Method to update the max of the gamma parameter Validates if the value received is greater than gamma_min.
bool setMinGammaValue(double gamma_min)
Method to update the min value of the gamma parameter Validades if the value is received is smaller than gamma_max.
double GradientDescent(double gamma_o, Eigen::Vector3d & x_pos, double tolerance)
Method that implements the gradient descent to minimize the error of
double getInitialGammaEstimate(Eigen::Vector3d & x_pos, int num_partitions, double min_val, double max_val)
Method to get an initial estimate for the gamma. It divides the section into n sections and search for local minimums in the function that computes the distance of the vehicle inside those sections.
double bisection(Eigen::Vector3d & x_pos, double a, double b)
Method to implement bisection method

Detailed Description

class Circle2D;

Class that implements a 2D Circle section.

Author:

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

Version: 1.0a

Date: 2021

Copyright: MIT

This class is used as a part of the sections library

Public Functions Documentation

function Circle2D

Circle2D(
    double radius,
    double center_x,
    double center_y
)

Constructor for the path section that assumes the plane in which the path is placed is z=0.

Parameters:

  • radius The radius in m of the Circle
  • center_x The x coordinate of the center of the circle
  • center_y The y coordinate of the center of the circle

function Circle2D

Circle2D(
    double radius,
    double center_x,
    double center_y,
    double z
)

Constructor for the path section.

Parameters:

  • radius The radius in m of the Circle
  • center_x The x coordinate of the center of the circle
  • center_y The y coordinate of the center of the circle
  • z The z axis where to place the circle

function eq_pd

virtual Eigen::Vector3d eq_pd(
    double t
) override

Path Section equation.

Parameters:

  • t The path parameter

Return: An Eigen::Vector3d with the values from the equation of the path

Reimplements: PathSection::eq_pd

function eq_d_pd

virtual Eigen::Vector3d eq_d_pd(
    double t
) override

First derivative of the path section equation with respect to the path parameter.

Parameters:

  • t The path parameter

Return: An Eigen::Vector3d with the values from the derivative of the equation

Reimplements: PathSection::eq_d_pd

function eq_dd_pd

virtual Eigen::Vector3d eq_dd_pd(
    double t
) override

Second derivative of the path section equation with respect to the path parameter t.

Parameters:

  • t The path parameter

Return: An Eigen::Vector3d with the values from the second derivative of the equation

Reimplements: PathSection::eq_dd_pd

function curvature

virtual double curvature(
    double t
) override

Compute the curvature using only the radius. Computed as 1/Radius.

Parameters:

  • t The path paramter

Return: A double with the curvature of that section (1/radius)

Reimplements: PathSection::curvature

function getClosestPointGamma

virtual double getClosestPointGamma(
    Eigen::Vector3d & coordinate
) override

Method for getting the gamma of the closest point.

Parameters:

  • coordinate The vehicle position

Return: A double with the gamma corresponding to the closest point in the path

Reimplements: PathSection::getClosestPointGamma

Method to return the closest point to the path By default just calls the Gradient Descent algorithm


Updated on 2022-09-15 at 17:51:30 +0000


Last update: September 15, 2022
Back to top