kinematicbase

package
v0.7.3-rc0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: AGPL-3.0 Imports: 16 Imported by: 1

Documentation

Overview

Package kinematicbase contains wrappers that augment bases with information needed for higher level control over the base

Package kinematicbase contains wrappers that augment bases with information needed for higher level control over the base

Package kinematicbase contains wrappers that augment bases with information needed for higher level control over the base

Index

Constants

This section is empty.

Variables

View Source
var ErrMovementTimeout = errors.New("movement has timed out")

ErrMovementTimeout is used for when a movement call times out after no movement for some time.

Functions

func CollisionGeometry

func CollisionGeometry(cfg *referenceframe.LinkConfig) ([]spatialmath.Geometry, error)

CollisionGeometry returns a spherical geometry that will encompass the base if it were to rotate the geometry specified in the config 360 degrees about the Z axis of the reference frame specified in the config.

Types

type KinematicBase

type KinematicBase interface {
	base.Base
	referenceframe.InputEnabled

	Kinematics() referenceframe.Frame
}

KinematicBase is an interface for Bases that also satisfy the ModelFramer and InputEnabled interfaces.

func WrapWithFakeKinematics

func WrapWithFakeKinematics(
	ctx context.Context,
	b *fake.Base,
	localizer motion.Localizer,
	limits []referenceframe.Limit,
	options Options,
) (KinematicBase, error)

WrapWithFakeKinematics creates a KinematicBase from the fake Base so that it satisfies the ModelFramer and InputEnabled interfaces.

func WrapWithKinematics added in v0.4.0

func WrapWithKinematics(
	ctx context.Context,
	b base.Base,
	logger golog.Logger,
	localizer motion.Localizer,
	limits []referenceframe.Limit,
	options Options,
) (KinematicBase, error)

WrapWithKinematics will wrap a Base with the appropriate type of kinematics, allowing it to provide a Frame which can be planned with and making it InputEnabled.

type Options added in v0.7.0

type Options struct {
	// LinearVelocityMMPerSec is the linear velocity the base will drive at in mm/s
	LinearVelocityMMPerSec float64

	// AngularVelocityMMPerSec is the angular velocity the base will turn with in deg/s
	AngularVelocityDegsPerSec float64

	// GoalRadiusMM is used when the base is moving to a goal. It is considered successful if it is within this radius.
	GoalRadiusMM float64

	// HeadingThresholdDegrees is used when the base is moving to a goal.
	// If its heading is within this angle it is considered to be on the correct path.
	HeadingThresholdDegrees float64

	// PlanDeviationThresholdMM is the amount that the base is allowed to deviate from the straight line path it is intended to travel.
	// If it ever exceeds this amount the movement will fail and an error will be returned.
	PlanDeviationThresholdMM float64

	// Timeout is the maximum amount of time that the base is allowed to remain stationary during a movement, else an error is thrown.
	Timeout time.Duration

	// MinimumMovementThresholdMM is the amount that a base needs to move for it not to be considered stationary.
	MinimumMovementThresholdMM float64

	// MaxSpinAngleDeg is the maximum amount of degrees the base should turn with a single Spin command.
	// used to break up large turns into smaller chunks to prevent error from building up.
	MaxSpinAngleDeg float64

	// PositionOnlyMode defines whether motion planning should be done in 2DOF or 3DOF.
	// If value is true, planning is done in [x,y]. If value is false, planning is done in [x,y,theta].
	PositionOnlyMode bool
}

Options contains values used for execution of base movement.

func NewKinematicBaseOptions added in v0.7.0

func NewKinematicBaseOptions() Options

NewKinematicBaseOptions creates a struct with values used for execution of base movement. all values are pre-set to reasonable default values and can be changed if desired.

Jump to

Keyboard shortcuts

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