routing

package
v0.0.0-...-4a99d7a Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CloseThreth   int8 = 90     //これより大きいと通れない  [0,100]
	MaxTimeLength int  = 100000 //これ以上のtを計算しない

	MaxSearchTimeStep int = 1000 //これ以上先の時間を計算しない

	MaxStopCount int = 10 //これ以上ストップしない
)

Variables

This section is empty.

Functions

func A

func A(x, y float64) float64

func B

func B(x, y float64) float64

func Convert23DPoint

func Convert23DPoint(obj [][2]float64) (obj3d [][]float64)

func Convert2DPoint

func Convert2DPoint(obj [][2]float64) (obj2d [][]float64)

func Convert32DPoint

func Convert32DPoint(obj [][3]float64) (obj2d [][]float64)

func Convert3DPoint

func Convert3DPoint(obj [][3]float64) (obj3d [][]float64)

func MaxFloat

func MaxFloat(a []float64) float64

func MinFloat

func MinFloat(a []float64) float64

Types

type GridMap

type GridMap struct {
	Resolution float64
	Origin     Point
	Width      int
	Height     int
	MapOrigin  Point

	CurrentMinTime float64

	//TRW       TimeRobotMap // ロボットが占有してるかどうかのマップ
	MaxT      int    // =MaxTimeLenghth
	ObjectMap ObjMap //元からある障害物ならTrue
}

func NewGridMap

func NewGridMap(m MapMeta, robotRadius float64) *GridMap

initialize grid map using map resolution not using now

func NewGridMapReso

func NewGridMapReso(m MapMeta, robotRadius float64, resolution float64, objMap [][2]float64) *GridMap

initialize gridmap by custom resolution using main

func NewGridMapResoHexa

func NewGridMapResoHexa(m MapMeta, robotRadius float64, resolution float64, objMap [][2]float64) *GridMap

initialize custom resolution using main

func (GridMap) ConvertObjMap2Point

func (m GridMap) ConvertObjMap2Point() (obj2d [][]float64)

func (GridMap) ConvertObjMap2PointHexa

func (m GridMap) ConvertObjMap2PointHexa() (obj2d [][]float64)

func (GridMap) ConvertObjMap3Point

func (m GridMap) ConvertObjMap3Point() (obj3d [][]float64)

func (GridMap) ConvertObjMap3PointHexa

func (m GridMap) ConvertObjMap3PointHexa() (obj3d [][]float64)

func (GridMap) Ind2Pos

func (g GridMap) Ind2Pos(xId, yId int) (float64, float64)

func (GridMap) Plan

func (m GridMap) Plan(sx, sy, gx, gy int, TRW TimeRobotMap) (route [][3]int, oerr error)

func (GridMap) PlanHexa

func (m GridMap) PlanHexa(id int, sa, sb, ga, gb int, v, w, timeStep float64, TRW TimeRobotMap, otherRobot map[Index]bool) (route [][3]int, oerr error)

func (GridMap) Pos2Ind

func (g GridMap) Pos2Ind(x, y float64) (int, int)

func (GridMap) Pos2IndHexa

func (g GridMap) Pos2IndHexa(x, y float64) (int, int)

func (GridMap) Route2Pos

func (g GridMap) Route2Pos(minT float64, route [][3]int) [][3]float64

func (GridMap) Route2PosHexa

func (g GridMap) Route2PosHexa(minT float64, timeStep float64, route [][3]int) [][3]float64

func (GridMap) UpdateStep

func (g GridMap) UpdateStep(TW TimeRobotMap, step int)

func (GridMap) UpdateTimeObjMapHexa

func (g GridMap) UpdateTimeObjMapHexa(TW TimeRobotMap, route [][3]int, robotRadius float64)

type Index

type Index struct {
	X int
	Y int
}

type IndexT

type IndexT struct {
	X int
	Y int
	T int
}

func NewIndexT

func NewIndexT(t, x, y int) *IndexT

type MapMeta

type MapMeta struct {
	W      int
	H      int
	Origin Point
	Reso   float64
	Data   []int8
}

func LoadROSMap

func LoadROSMap(grid ros.OccupancyGrid, closeThreth int) *MapMeta

func ReadStaticMapImage

func ReadStaticMapImage(yamlFile, mapFile string, closeThreth float64) (*MapMeta, error)

read image file of ROS format

func (MapMeta) GetObjectMap

func (m MapMeta) GetObjectMap() [][2]float64

type MapYaml

type MapYaml struct {
	Image          string     `yaml:"image"`
	FreeThresh     float64    `yaml:"free_thresh"`
	OccupiedThresh float64    `yaml:"occupied_thresh"`
	Origin         [3]float64 `yaml:"origin"`
	Resolution     float64    `yaml:"resolution"`
	Negate         float64    `yaml:"negate"`
}

func ReadImageYaml

func ReadImageYaml(filename string) MapYaml

type Node

type Node struct {
	T   int `json:"t"` //time
	XId int `json:"x"`
	YId int `json:"y"`

	Cost      float64 `json:"cost"`
	StopCount int

	Parent *Node
}

func (*Node) Around

func (n *Node) Around(g *GridMap, minTime int, TRW TimeRobotMap) []*Node

func (Node) AroundHexa

func (n Node) AroundHexa(g *GridMap, minTime int, v, w, timeStep float64, TRW TimeRobotMap, otherRobot map[Index]bool) []*Node

func (*Node) NewNode

func (s *Node) NewNode(t, x, y int, cost float64) *Node

type ObjMap

type ObjMap map[Index]bool

type Point

type Point struct {
	X float64
	Y float64
}

type TimeRobotMap

type TimeRobotMap map[IndexT]bool

type CostMap map[Index]uint8

func NewTRW

func NewTRW(t, w, h int) TimeRobotMap

func TRWCopy

func TRWCopy(current TimeRobotMap) TimeRobotMap

Jump to

Keyboard shortcuts

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