Documentation ¶
Overview ¶
Package tpspace defines an assortment of precomputable trajectories which can be used to plan nonholonomic 2d motion
Index ¶
- func NewPTGFrameFromKinematicOptions(name string, logger logging.Logger, ...) (referenceframe.Frame, error)
- func PTGSegmentMetric(segment *ik.Segment) float64
- type PTG
- func NewCCPTG(maxMMPS, maxRPS float64) PTG
- func NewCCSPTG(maxMMPS, maxRPS float64) PTG
- func NewCSPTG(maxMMPS, maxRPS float64) PTG
- func NewCirclePTG(maxMMPS, maxRPS float64) PTG
- func NewDiffDrivePTG(maxMMPS, maxRPS float64) PTG
- func NewSideSOverturnPTG(maxMMPS, maxRPS float64) PTG
- func NewSideSPTG(maxMMPS, maxRPS float64) PTG
- type PTGProvider
- type PTGSolver
- type TrajNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPTGFrameFromKinematicOptions ¶ added in v0.9.0
func NewPTGFrameFromKinematicOptions( name string, logger logging.Logger, velocityMMps, angVelocityDegps, turnRadMeters float64, trajCount int, geoms []spatialmath.Geometry, diffDriveOnly bool, ) (referenceframe.Frame, error)
NewPTGFrameFromKinematicOptions will create a new Frame which is also a PTGProvider. It will precompute the default set of trajectories out to a given distance, or a default distance if the given distance is <= 0.
func PTGSegmentMetric ¶ added in v0.12.0
PTGSegmentMetric is a metric which returns the TP-space distance traversed in a segment. Since PTG inputs are relative, the distance travelled is the distance field of the ending configuration.
Types ¶
type PTG ¶
type PTG interface { // Velocities returns the linear and angular velocity at a specific point along a trajectory Velocities(alpha, dist float64) (float64, float64, error) Transform([]referenceframe.Input) (spatialmath.Pose, error) }
PTG is a Parameterized Trajectory Generator, which defines how to map back and forth from cartesian space to TP-space PTG coordinates are specified in polar coordinates (alpha, d) One of these is needed for each sort of motion that can be done.
func NewCirclePTG ¶
NewCirclePTG creates a new PTG of type ptgC.
func NewDiffDrivePTG ¶ added in v0.9.0
NewDiffDrivePTG creates a new PTG of type ptgDiffDrive.
func NewSideSOverturnPTG ¶ added in v0.8.0
NewSideSOverturnPTG creates a new PTG of type ptgSideS which overturns. It turns X amount in one direction, then countersteers X*countersteerFactor in the other direction.
func NewSideSPTG ¶ added in v0.8.0
NewSideSPTG creates a new PTG of type ptgSideS.
type PTGProvider ¶
type PTGProvider interface { // PTGs returns the list of PTGs associated with this provider PTGSolvers() []PTGSolver }
PTGProvider is something able to provide a set of PTGs associsated with it. For example, a frame which precomputes a number of PTGs.
type PTGSolver ¶ added in v0.9.0
type PTGSolver interface { // Solve will return the (alpha, dist) TP-space coordinates whose corresponding relative pose minimizes the given function ik.InverseKinematics PTG // MaxDistance returns the maximum distance that a single trajectory may travel MaxDistance() float64 // Returns the set of trajectory nodes along the given trajectory, out to the requested distance Trajectory(alpha, dist float64) ([]*TrajNode, error) }
PTGSolver wraps a PTG with the ability to perform Inverse Kinematics.
func NewPTGGridSim ¶
NewPTGGridSim creates a new PTG by simulating a PTG for some distance, then cacheing the results in a grid for fast lookup.
func NewPTGIK ¶ added in v0.8.0
func NewPTGIK(simPTG PTG, logger logging.Logger, refDistLong, refDistShort float64, randSeed, trajCount int) (PTGSolver, error)
NewPTGIK creates a new ptgIK, which creates a frame using the provided PTG, and wraps it providing functions to fill the PTG interface, allowing inverse kinematics queries to be run against it.
type TrajNode ¶
type TrajNode struct { // TODO: cache pose point and orientation so that we don't recompute every time we need it Pose spatialmath.Pose // for 2d, we only use x, y, and OV theta Time float64 // elapsed time on trajectory Dist float64 // distance travelled down trajectory Alpha float64 // alpha k-value at this node LinVelMMPS float64 // linvel in millimeters per second at this node AngVelRPS float64 // angvel in radians per second at this node }
TrajNode is a snapshot of a single point in time along a PTG trajectory, including the distance along that trajectory, the elapsed time along the trajectory, and the linear and angular velocity at that point.