path

package
v0.0.0-...-dd7b263 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CubicA_Pos1 = -2.0
	CubicA_Pos0 = 2.0
	CubicB_Pos1 = 3.0
	CubicB_Pos0 = -3.0
	CubicB_Vel0 = -2.0

	QuinticA_Pos0 = -6.0
	QuinticA_Vel0 = -3.0
	QuinticA_Acc0 = -0.5
	QuinticA_Pos1 = 6.0
	QuinticA_Vel1 = -3.0
	QuinticA_Acc1 = 0.5
	QuinticB_Pos0 = 15.0
	QuinticB_Vel0 = 8.0
	QuinticB_Acc0 = 1.5
	QuinticB_Pos1 = -15.0
	QuinticB_Vel1 = 7.0
	QuinticB_Acc1 = -1.0
	QuinticC_Pos0 = -10.0
	QuinticC_Vel0 = -6.0
	QuinticC_Acc0 = -1.5
	QuinticC_Pos1 = 10.0
	QuinticC_Vel1 = -4.0
	QuinticC_Acc1 = 0.5
	QuinticD_Acc0 = 0.5
)

Variables

This section is empty.

Functions

func Cos

func Cos(p Pose) float64

func Dist

func Dist(start Pose, end Pose) float64

func PlotSpline

func PlotSpline(s Spline, name string, path string)

func PlotSplines

func PlotSplines(splines []Spline, name string, path string)

func Sin

func Sin(p Pose) float64

Types

type CubicSpline

type CubicSpline struct {
	//Spline coefficients
	//x(t) = Ax*t^3 + Bx*t^2 + Cx*t + Dx
	//y(t) = Ay*t^3 + By*t^2 + Cy*t + Dy
	Ax, Bx, Cx, Dx float64
	Ay, By, Cy, Dy float64
}

func GenerateCubicSpline

func GenerateCubicSpline(start Pose, end Pose) *CubicSpline

func (*CubicSpline) GetCurvature

func (this *CubicSpline) GetCurvature(t float64) float64

func (*CubicSpline) GetPose

func (this *CubicSpline) GetPose(t float64) Pose

t ranges from 0 to 1

func (*CubicSpline) String

func (this *CubicSpline) String() string

type Pose

type Pose struct {
	X, Y, Theta float64
}

struct representing a Pose (position + heading in a 2D plane). X and Y are unitless, but Theta has to be in radians.

func (*Pose) String

func (this *Pose) String() string

type QuinticSpline

type QuinticSpline struct {
	//x(t) = Ax*t^5 + Bx*t^4 + Cx*t^3 + Dx*t^2 + Ex*t + F
	//y(t) = Ay*t^5 + By*t^4 + Cy*t^3 + Dy*t^2 + Ey*t + F
	Ax, Bx, Cx, Dx, Ex, Fx float64
	Ay, By, Cy, Dy, Ey, Fy float64
}

func GenerateQuinticSpline

func GenerateQuinticSpline(start Pose, end Pose) *QuinticSpline

func (*QuinticSpline) GetCurvature

func (this *QuinticSpline) GetCurvature(t float64) float64

func (*QuinticSpline) GetPose

func (this *QuinticSpline) GetPose(t float64) Pose

func (*QuinticSpline) String

func (this *QuinticSpline) String() string

type Spline

type Spline interface {
	GetPose(t float64) Pose
	GetCurvature(t float64) float64
	String() string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL