ros

package
v0.0.0-...-3b597dc Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 23 Imported by: 21

Documentation

Overview

Connection header

Index

Constants

View Source
const (
	Sep       = "/"
	GlobalNS  = "/"
	PrivateNS = "~"
)
View Source
const (
	ApiStatusError   = -1
	ApiStatusFailure = 0
	ApiStatusSuccess = 1
	Remap            = ":="
)
View Source
const BufferSize = 1024

Variables

This section is empty.

Functions

func NewDefaultLogger

func NewDefaultLogger() *defaultLogger

Types

type Duration

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

func NewDuration

func NewDuration(sec uint32, nsec uint32) Duration

func (*Duration) Add

func (d *Duration) Add(other Duration) Duration

func (*Duration) Cmp

func (d *Duration) Cmp(other Duration) int

func (*Duration) FromNSec

func (t *Duration) FromNSec(nsec uint64)

func (*Duration) FromSec

func (t *Duration) FromSec(sec float64)

func (*Duration) IsZero

func (t *Duration) IsZero() bool

func (*Duration) Normalize

func (t *Duration) Normalize()

func (*Duration) Sleep

func (d *Duration) Sleep() error

func (*Duration) Sub

func (d *Duration) Sub(other Duration) Duration

func (*Duration) ToNSec

func (t *Duration) ToNSec() uint64

func (*Duration) ToSec

func (t *Duration) ToSec() float64

type LogLevel

type LogLevel int
const (
	LogLevelDebug LogLevel = iota
	LogLevelInfo
	LogLevelWarn
	LogLevelError
	LogLevelFatal
)

type Logger

type Logger interface {
	Severity() LogLevel
	SetSeverity(severity LogLevel)
	Debug(v ...interface{})
	Debugf(format string, v ...interface{})
	Info(v ...interface{})
	Infof(format string, v ...interface{})
	Warn(v ...interface{})
	Warnf(format string, v ...interface{})
	Error(v ...interface{})
	Errorf(format string, v ...interface{})
	Fatal(v ...interface{})
	Fatalf(format string, v ...interface{})
}

type Message

type Message interface {
	Type() MessageType
	Serialize(buf *bytes.Buffer) error
	Deserialize(buf *bytes.Reader) error
}

type MessageEvent

type MessageEvent struct {
	PublisherName    string
	ReceiptTime      time.Time
	ConnectionHeader map[string]string
}

Optional second argument to a Subscriber callback.

type MessageType

type MessageType interface {
	Text() string
	MD5Sum() string
	Name() string
	NewMessage() Message
}

type NameMap

type NameMap map[string]string

type NameResolver

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

type Node

type Node interface {
	NewPublisher(topic string, msgType MessageType) Publisher
	// Create a publisher which gives you callbacks when subscribers
	// connect and disconnect.  The callbacks are called in their own
	// goroutines, so they don't need to return immediately to let the
	// connection proceed.
	NewPublisherWithCallbacks(topic string,
		msgType MessageType,
		connectCallback, disconnectCallback func(SingleSubscriberPublisher)) Publisher
	// callback should be a function which takes 0, 1, or 2 arguments.
	// If it takes 0 arguments, it will simply be called without the
	// message.  1-argument functions are the normal case, and the
	// argument should be of the generated message type.  If the
	// function takes 2 arguments, the first argument should be of the
	// generated message type and the second argument should be of
	// type MessageEvent.
	NewSubscriber(topic string, msgType MessageType, callback interface{}) Subscriber
	NewServiceClient(service string, srvType ServiceType) ServiceClient
	NewServiceServer(service string, srvType ServiceType, callback interface{}) ServiceServer

	OK() bool
	SpinOnce()
	Spin()
	Shutdown()

	GetParam(name string) (interface{}, error)
	SetParam(name string, value interface{}) error
	HasParam(name string) (bool, error)
	SearchParam(name string) (string, error)
	DeleteParam(name string) error

	Logger() Logger

	NonRosArgs() []string
}

func NewNode

func NewNode(name string, args []string) (Node, error)

type Publisher

type Publisher interface {
	Publish(msg Message)
	Shutdown()
}

type Rate

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

Impelement Rate interface

func CycleTime

func CycleTime(d Duration) Rate

func NewRate

func NewRate(frequency float64) Rate

func (*Rate) CycleTime

func (r *Rate) CycleTime() Duration

func (*Rate) ExpectedCycleTime

func (r *Rate) ExpectedCycleTime() Duration

func (*Rate) Reset

func (r *Rate) Reset()

func (*Rate) Sleep

func (r *Rate) Sleep() error

type Service

type Service interface {
	ReqMessage() Message
	ResMessage() Message
}

type ServiceClient

type ServiceClient interface {
	Call(srv Service) error
	Shutdown()
}

type ServiceFactory

type ServiceFactory interface {
	Name() string
	MD5Sum() string
}

type ServiceHandler

type ServiceHandler interface{}

type ServiceServer

type ServiceServer interface {
	Shutdown()
}

type ServiceType

type ServiceType interface {
	MD5Sum() string
	Name() string
	RequestType() MessageType
	ResponseType() MessageType
	NewService() Service
}

type SingleSubscriberPublisher

type SingleSubscriberPublisher interface {
	Publish(msg Message)
	GetSubscriberName() string
	GetTopic() string
}

A publisher which only sends to one specific subscriber. This is sent as an argument to the connect and disconnect callback functions passed to Node.NewPublisherWithCallbacks().

type Subscriber

type Subscriber interface {
	GetNumPublishers() int
	Shutdown()
}

type Time

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

func NewTime

func NewTime(sec uint32, nsec uint32) Time

func Now

func Now() Time

func (*Time) Add

func (t *Time) Add(d Duration) Time

func (*Time) Cmp

func (t *Time) Cmp(other Time) int

func (*Time) Diff

func (t *Time) Diff(from Time) Duration

func (*Time) FromNSec

func (t *Time) FromNSec(nsec uint64)

func (*Time) FromSec

func (t *Time) FromSec(sec float64)

func (*Time) IsZero

func (t *Time) IsZero() bool

func (*Time) Normalize

func (t *Time) Normalize()

func (*Time) Sub

func (t *Time) Sub(d Duration) Time

func (*Time) ToNSec

func (t *Time) ToNSec() uint64

func (*Time) ToSec

func (t *Time) ToSec() float64

Jump to

Keyboard shortcuts

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