reedsshepp

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 1 Imported by: 1

README

reedsshepp

Pure Golang implementation of Reeds Shepp Path, based on C++ ompl ReedsSheppState

Installation

go get github.com/dohyeunglee/reedsshepp

API

Visit https://pkg.go.dev/github.com/dohyeunglee/reedsshepp

Test

go test

Demo

A demo is available in demo/main.go

Benchmark

go test -bench .

WIP

Documentation

Overview

Package reedsshepp implements ReedsSheppPath planning based on [ompl](https://github.com/ompl/ompl) library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Direction

type Direction bool

Direction represents path's direction: forward or backward.

const (
	ForwardDirection  Direction = true
	BackwardDirection Direction = false
)

type Path

type Path struct {
	// contains filtered or unexported fields
}

Path corresponds to ReedsSheppPath.

func AvailablePaths

func AvailablePaths(start State, goal State, turningRadius float64) []Path

AvailablePaths returns all possible ReedsSheppPaths that can reach the `goal` state from the `start` state, given a `turningRadius`.

func MinLengthPath

func MinLengthPath(start State, goal State, turningRadius float64) (Path, bool)

MinLengthPath returns the shortest `ReedsSheppPath` among all possible paths from the `start` state to the `goal` state, given a `turningRadius`. In case there are multiple paths with the same length, one of them is randomly selected and returned. The shortest ReedsSheppPath length can be obtained using the `Length` function of the returned `ReedsSheppPath`.

func (*Path) Interpolate

func (p *Path) Interpolate(stepSize float64) []StateWithDirection

Interpolate interpolates ReedsSheppPath by `stepSize`, returning `StateWithDirection` list.

func (*Path) IsZero

func (p *Path) IsZero() bool

IsZero checks whether `Path` is default(zero) value.

func (*Path) Length

func (p *Path) Length() float64

Length returns the total length of ReedsSheppPath.

func (*Path) Segments

func (p *Path) Segments() []PathSegment

Segments returns all `PathSegment` information about ReedsSheppPath.

type PathCourseType

type PathCourseType int

PathCourseType represents ReedsSheppPath segment course type: L, S, R.

const (
	CourseTypeNone PathCourseType = iota
	CourseTypeLeft
	CourseTypeStraight
	CourseTypeRight
)

type PathSegment

type PathSegment struct {
	Length     float64
	CourseType PathCourseType
}

func (PathSegment) Direction

func (s PathSegment) Direction() Direction

Direction returns `Direction` information(forward or backward) about the segment.

type State

type State struct {
	X   float64
	Y   float64
	Yaw float64
}

State represents the 3D state, x, y coordinate and yaw angle.

type StateWithDirection

type StateWithDirection struct {
	State
	Direction Direction
}

StateWithDirection represents `State` information with `Direction` information

Directories

Path Synopsis
demo module

Jump to

Keyboard shortcuts

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