vector

package
v0.0.0-...-2cfdb1f Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*options)

Option provides a function definition to set options

func WithSerialNo

func WithSerialNo(s string) Option

WithSerialNo set the serialno for the vector robot.

func WithTarget

func WithTarget(s string) Option

WithTarget sets the ip of the vector robot.

func WithToken

func WithToken(s string) Option

WithToken set the token for the vector robot.

type RobotSDKInfoStore

type RobotSDKInfoStore struct {
	GlobalGUID string `json:"global_guid"`
	Robots     []struct {
		Esn       string `json:"esn"`
		IPAddress string `json:"ip_address"`
		GUID      string `json:"guid"`
		Activated bool   `json:"activated"`
	} `json:"robots"`
}

type Vector

type Vector struct {
	Conn vectorpb.ExternalInterfaceClient
	Cfg  options
}

Vector is the struct containing info about Vector

func New

func New(opts ...Option) (*Vector, error)

New returns either a vector struct, or an error on failure

func NewEP

func NewEP(serial string) (*Vector, error)

NewEP returns either a vector struct for escape pod vector, or an error on failure This function assumes you are working with the old Python SDK, that saves in ".anki_vector" a .ini file with the configuration info needed

func NewWP

func NewWP(serial string) (*Vector, error)

NewWP returns either a vector struct for wirepod pod vector, or an error on failure This function assumes you are working with Wirepod, that saves in "./jdocs/botSdkInfo.json" a JSON file with the configuration info needed

func (*Vector) BehaviorControl

func (v *Vector) BehaviorControl(ctx context.Context, start, stop chan bool) error

BehaviorControl assumes control of the vector robot for SDK usage. Once control is assumed, a signal is sent on the start channel. To give control back to the bot, send a message to the stop channel. Failing to do so may leave your bot in a funny, funny state.

func (*Vector) GetIPAddress

func (v *Vector) GetIPAddress() string

Jump to

Keyboard shortcuts

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