goros

package module
v0.0.0-...-e84c1bd Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 15 Imported by: 0

README

goros

The golang equivalent of roslibjs. Communicates with ROS over a rosbridge.

Documentation

Index

Constants

View Source
const (
	MessageData      = 0x02
	BagHeader        = 0x03
	IndexData        = 0x04
	ChunkRecord      = 0x05
	ChunkInfo        = 0x06
	ConnectionRecord = 0x07
)
View Source
const (
	TimeoutInSec = 5
)

Variables

This section is empty.

Functions

func ParseRosbag

func ParseRosbag(path string)

func SetNewTopicId

func SetNewTopicId(topic *Topic)

Types

type ArgGetParam

type ArgGetParam struct {
	Name    string `json:"name"`
	Default string `json:"default,omitempty"`
}

type ArgPublishers

type ArgPublishers struct {
	Topic string `json:"topic"`
}

type ArgSetParam

type ArgSetParam struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Base

type Base struct {
	Op string `json:"op"`
	Id string `json:"id"`
}

type CustomMessage

type CustomMessage map[string]interface{}

type CustomMessageSlice

type CustomMessageSlice struct {
	CustomMessage
}

type Ros

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

func NewRos

func NewRos(url string) (*Ros, error)

func (*Ros) AdvertiseTopic

func (ros *Ros) AdvertiseTopic(topic *Topic) error

func (*Ros) GetParam

func (ros *Ros) GetParam(paramName string) (string, error)

func (*Ros) GetParams

func (ros *Ros) GetParams() ([]string, error)

func (*Ros) GetPublishers

func (ros *Ros) GetPublishers(topicName string) ([]string, error)

func (*Ros) GetServices

func (ros *Ros) GetServices() ([]string, error)

func (*Ros) GetTopics

func (ros *Ros) GetTopics() ([]string, error)

func (*Ros) GetUrl

func (ros *Ros) GetUrl() string

func (*Ros) GetWs

func (ros *Ros) GetWs() *websocket.Conn

func (*Ros) OutboundTopic

func (ros *Ros) OutboundTopic(topic *Topic) error

func (*Ros) PublishTopic

func (ros *Ros) PublishTopic(topic *Topic) error

func (*Ros) SetParam

func (ros *Ros) SetParam(paramName string, value string) error

func (*Ros) Subscribe

func (ros *Ros) Subscribe(topicName string, callback TopicCallback) error

func (*Ros) SubscribeTopic

func (ros *Ros) SubscribeTopic(topic *Topic, callback TopicCallback) error

func (*Ros) SubscribeTopicWithChannel

func (ros *Ros) SubscribeTopicWithChannel(topic *Topic, response *chan interface{}) error

func (*Ros) UnsubscribeTopic

func (ros *Ros) UnsubscribeTopic(topic *Topic) error

type RosTime

type RosTime struct {
	Secs  int32
	NSecs int32
}

type ServiceCall

type ServiceCall struct {
	Op      string `json:"op"`
	Id      string `json:"id"`
	Service string `json:"service"`
	//Args    string `json:"args,omitempty"`
	Args json.RawMessage `json:"args,omitempty"`
}

type ServiceResponse

type ServiceResponse struct {
	Op      string                     `json:"op"`
	Id      string                     `json:"id"`
	Service string                     `json:"service"`
	Result  bool                       `json:"result"`
	Values  map[string]json.RawMessage `json:"values"`
}

type Topic

type Topic struct {
	Op            string          `json:"op"`
	Id            string          `json:"id,omitempty"`
	Topic         string          `json:"topic"`
	Type          string          `json:"type,omitempty"`
	Throttle_rate int             `json:"throttle_rate,omitempty"` //In msec
	Queue_length  int             `json:"queue_length,omitempty"`  //Default: 1
	Fragment_size int             `json:"fragment_size,omitempty"`
	Compression   string          `json:"compression,omitempty"`
	Msg           json.RawMessage `json:"msg,omitempty"`
}

func NewTopic

func NewTopic(topicName string) *Topic

type TopicCallback

type TopicCallback func(*json.RawMessage)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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