Documentation
¶
Index ¶
- Constants
- func BoolArrayToC(cSlice []CBool, goSlice []bool)
- func BoolArrayToGo(goSlice []bool, cSlice []CBool)
- func BoolSequenceToC(cSlice *CBoolSequence, goSlice []bool)
- func BoolSequenceToGo(goSlice *[]bool, cSlice CBoolSequence)
- func ByteArrayToC(cSlice []CByte, goSlice []byte)
- func ByteArrayToGo(goSlice []byte, cSlice []CByte)
- func ByteSequenceToC(cSlice *CByteSequence, goSlice []byte)
- func ByteSequenceToGo(goSlice *[]byte, cSlice CByteSequence)
- func CharArrayToC(cSlice []CChar, goSlice []byte)
- func CharArrayToGo(goSlice []byte, cSlice []CChar)
- func CharSequenceToC(cSlice *CcharSequence, goSlice []byte)
- func CharSequenceToGo(goSlice *[]byte, cSlice CcharSequence)
- func DefaultLoggingOutputHandler(location unsafe.Pointer, severity int, name unsafe.Pointer, timestamp int64, ...)
- func Deinit() (err error)
- func ExpandTopicName(inputTopicName, nodeName, nodeNamespace string, ...) (expanded string, err error)
- func Float32ArrayToC(cSlice []CFloat32, goSlice []float32)
- func Float32ArrayToGo(goSlice []float32, cSlice []CFloat32)
- func Float32SequenceToC(cSlice *CFloat32Sequence, goSlice []float32)
- func Float32SequenceToGo(goSlice *[]float32, cSlice CFloat32Sequence)
- func Float64ArrayToC(cSlice []CFloat64, goSlice []float64)
- func Float64ArrayToGo(goSlice []float64, cSlice []CFloat64)
- func Float64SequenceToC(cSlice *CFloat64Sequence, goSlice []float64)
- func Float64SequenceToGo(goSlice *[]float64, cSlice CFloat64Sequence)
- func Init(args *Args) (err error)
- func InitLogging(args *Args) error
- func InitWithOpts(args *Args, opts *ContextOptions) (err error)
- func Int8ArrayToC(cSlice []CInt8, goSlice []int8)
- func Int8ArrayToGo(goSlice []int8, cSlice []CInt8)
- func Int8SequenceToC(cSlice *CInt8Sequence, goSlice []int8)
- func Int8SequenceToGo(goSlice *[]int8, cSlice CInt8Sequence)
- func Int16ArrayToC(cSlice []CInt16, goSlice []int16)
- func Int16ArrayToGo(goSlice []int16, cSlice []CInt16)
- func Int16SequenceToC(cSlice *CInt16Sequence, goSlice []int16)
- func Int16SequenceToGo(goSlice *[]int16, cSlice CInt16Sequence)
- func Int32ArrayToC(cSlice []CInt32, goSlice []int32)
- func Int32ArrayToGo(goSlice []int32, cSlice []CInt32)
- func Int32SequenceToC(cSlice *CInt32Sequence, goSlice []int32)
- func Int32SequenceToGo(goSlice *[]int32, cSlice CInt32Sequence)
- func Int64ArrayToC(cSlice []CInt64, goSlice []int64)
- func Int64ArrayToGo(goSlice []int64, cSlice []CInt64)
- func Int64SequenceToC(cSlice *CInt64Sequence, goSlice []int64)
- func Int64SequenceToGo(goSlice *[]int64, cSlice CInt64Sequence)
- func RegisterAction(alias string, actionType ActionTypeSupport)
- func RegisterMessage(alias string, msgType MessageTypeSupport)
- func RegisterService(alias string, srvType ServiceTypeSupport)
- func Serialize(msg Message) (buf []byte, err error)
- func SetLoggingOutputHandler(h LoggingOutputHandler)
- func Spin(ctx context.Context) error
- func StringArrayToC(cSlice []CString, goSlice []string)
- func StringArrayToGo(goSlice []string, cSlice []CString)
- func StringAsCStruct(dst unsafe.Pointer, m string)
- func StringAsGoStruct(m *string, ros2MessageBuffer unsafe.Pointer)
- func StringSequenceToC(cSlice *CStringSequence, goSlice []string)
- func StringSequenceToGo(goSlice *[]string, cSlice CStringSequence)
- func U16StringAsCStruct(dst unsafe.Pointer, m string)
- func U16StringAsGoStruct(msg *string, ros2MessageBuffer unsafe.Pointer)
- func U16stringArrayToC(cSlice []CU16String, goSlice []string)
- func U16stringArrayToGo(goSlice []string, cSlice []CU16String)
- func U16stringSequenceToC(cSlice *Cu16stringSequence, goSlice []string)
- func U16stringSequenceToGo(goSlice *[]string, cSlice Cu16stringSequence)
- func Uint8ArrayToC(cSlice []CUint8, goSlice []uint8)
- func Uint8ArrayToGo(goSlice []uint8, cSlice []CUint8)
- func Uint8SequenceToC(cSlice *CUint8Sequence, goSlice []uint8)
- func Uint8SequenceToGo(goSlice *[]uint8, cSlice CUint8Sequence)
- func Uint16ArrayToC(cSlice []CUint16, goSlice []uint16)
- func Uint16ArrayToGo(goSlice []uint16, cSlice []CUint16)
- func Uint16SequenceToC(cSlice *CUint16Sequence, goSlice []uint16)
- func Uint16SequenceToGo(goSlice *[]uint16, cSlice CUint16Sequence)
- func Uint32ArrayToC(cSlice []CUint32, goSlice []uint32)
- func Uint32ArrayToGo(goSlice []uint32, cSlice []CUint32)
- func Uint32SequenceToC(cSlice *CUint32Sequence, goSlice []uint32)
- func Uint32SequenceToGo(goSlice *[]uint32, cSlice CUint32Sequence)
- func Uint64ArrayToC(cSlice []CUint64, goSlice []uint64)
- func Uint64ArrayToGo(goSlice []uint64, cSlice []CUint64)
- func Uint64SequenceToC(cSlice *CUint64Sequence, goSlice []uint64)
- func Uint64SequenceToGo(goSlice *[]uint64, cSlice CUint64Sequence)
- type Action
- type ActionClient
- func (c *ActionClient) CancelGoal(ctx context.Context, request Message) (Message, error)
- func (c *ActionClient) Close() error
- func (c *ActionClient) GetResult(ctx context.Context, goalID *GoalID) (Message, error)
- func (c *ActionClient) Node() *Node
- func (c *ActionClient) SendGoal(ctx context.Context, goal Message) (Message, *GoalID, error)
- func (c *ActionClient) SendGoalRequest(ctx context.Context, request Message) (Message, error)
- func (c *ActionClient) WatchFeedback(ctx context.Context, goalID *GoalID, handler FeedbackHandler) <-chan error
- func (c *ActionClient) WatchGoal(ctx context.Context, goal Message, onFeedback FeedbackHandler) (result Message, goalID *GoalID, retErr error)
- func (c *ActionClient) WatchStatus(ctx context.Context, goalID *GoalID, handler StatusHandler) <-chan error
- type ActionClientInvalid
- type ActionClientOptions
- type ActionClientTakeFailed
- type ActionGoalAccepted
- type ActionGoalEventInvalid
- type ActionGoalHandleInvalid
- type ActionGoalRejected
- type ActionNameInvalid
- type ActionServer
- type ActionServerInvalid
- type ActionServerOptions
- type ActionServerTakeFailed
- type ActionTypeSupport
- type AlreadyInit
- type AlreadyShutdown
- type Args
- type BadAlloc
- type CBool
- type CBoolSequence
- type CByte
- type CByteSequence
- type CChar
- type CFloat32
- type CFloat32Sequence
- type CFloat64
- type CFloat64Sequence
- type CInt8
- type CInt8Sequence
- type CInt16
- type CInt16Sequence
- type CInt32
- type CInt32Sequence
- type CInt64
- type CInt64Sequence
- type CString
- type CStringSequence
- type CU16String
- type CUint8
- type CUint8Sequence
- type CUint16
- type CUint16Sequence
- type CUint32
- type CUint32Sequence
- type CUint64
- type CUint64Sequence
- type CcharSequence
- type Client
- type ClientInvalid
- type ClientOptions
- type ClientTakeFailed
- type Clock
- type ClockType
- type Context
- func (c *Context) Clock() *Clock
- func (c *Context) Close() error
- func (c *Context) NewClock(clockType ClockType) (clock *Clock, err error)
- func (c *Context) NewNode(nodeName, namespace string) (node *Node, err error)
- func (c *Context) NewTimer(timeout time.Duration, timerCallback func(*Timer)) (timer *Timer, err error)
- func (c *Context) NewWaitSet() (ws *WaitSet, err error)
- func (c *Context) SetClock(newClock *Clock)
- func (c *Context) Spin(ctx context.Context) error
- type ContextOptions
- type Cu16stringSequence
- type DurabilityPolicy
- type EndpointType
- type Error
- type EventInvalid
- type EventTakeFailed
- type ExecuteGoalFunc
- type FeedbackHandler
- type FeedbackSender
- type GID
- type GoalHandle
- type GoalID
- type GoalStatus
- type HistoryPolicy
- type InvalidArgument
- type InvalidLogLevelRule
- type InvalidParamRule
- type InvalidRemapRule
- type InvalidRosArgs
- type LifecycleStateNotRegistered
- type LifecycleStateRegistered
- type LivelinessPolicy
- type LogSeverity
- type Logger
- func (l *Logger) Child(name string) *Logger
- func (l *Logger) Debug(a ...interface{}) error
- func (l *Logger) Debugf(format string, a ...interface{}) error
- func (l *Logger) Debugln(a ...interface{}) error
- func (l *Logger) EffectiveLevel() (LogSeverity, error)
- func (l *Logger) Error(a ...interface{}) error
- func (l *Logger) Errorf(format string, a ...interface{}) error
- func (l *Logger) Errorln(a ...interface{}) error
- func (l *Logger) Fatal(a ...interface{}) error
- func (l *Logger) Fatalf(format string, a ...interface{}) error
- func (l *Logger) Fatalln(a ...interface{}) error
- func (l *Logger) Info(a ...interface{}) error
- func (l *Logger) Infof(format string, a ...interface{}) error
- func (l *Logger) Infoln(a ...interface{}) error
- func (l *Logger) IsEnabledFor(level LogSeverity) bool
- func (l *Logger) Level() (LogSeverity, error)
- func (l *Logger) Log(level LogSeverity, a ...interface{}) error
- func (l *Logger) Logf(level LogSeverity, format string, a ...interface{}) error
- func (l *Logger) Logln(level LogSeverity, a ...interface{}) error
- func (l *Logger) Name() string
- func (l *Logger) Parent() *Logger
- func (l *Logger) SetLevel(level LogSeverity) error
- func (l *Logger) Warn(a ...interface{}) error
- func (l *Logger) Warnf(format string, a ...interface{}) error
- func (l *Logger) Warnln(a ...interface{}) error
- type LoggingOutputHandler
- type Message
- type MessageInfo
- type MessageTypeSupport
- type MismatchedRmwId
- type Node
- func (n *Node) Close() error
- func (n *Node) Context() *Context
- func (n *Node) FullyQualifiedName() string
- func (n *Node) GetActionClientNamesAndTypesByNode(node, namespace string) (map[string][]string, error)
- func (n *Node) GetActionServerNamesAndTypesByNode(node, namespace string) (map[string][]string, error)
- func (n *Node) GetClientNamesAndTypesByNode(node, namespace string) (map[string][]string, error)
- func (n *Node) GetNodeNames() (names, namespaces []string, err error)
- func (n *Node) GetPublisherNamesAndTypesByNode(demangle bool, node, namespace string) (map[string][]string, error)
- func (n *Node) GetPublishersInfoByTopic(topic string, mangle bool) ([]TopicEndpointInfo, error)
- func (n *Node) GetServiceNamesAndTypesByNode(node, namespace string) (map[string][]string, error)
- func (n *Node) GetSubscriberNamesAndTypesByNode(demangle bool, node, namespace string) (map[string][]string, error)
- func (n *Node) GetSubscriptionsInfoByTopic(topic string, mangle bool) ([]TopicEndpointInfo, error)
- func (n *Node) GetTopicNamesAndTypes(demangle bool) (map[string][]string, error)
- func (n *Node) Logger() *Logger
- func (n *Node) Name() string
- func (n *Node) Namespace() string
- func (n *Node) NewActionClient(name string, ts ActionTypeSupport, opts *ActionClientOptions) (*ActionClient, error)
- func (n *Node) NewActionServer(name string, action Action, opts *ActionServerOptions) (*ActionServer, error)
- func (n *Node) NewClient(serviceName string, typeSupport ServiceTypeSupport, options *ClientOptions) (c *Client, err error)
- func (n *Node) NewPublisher(topicName string, ros2msg MessageTypeSupport, options *PublisherOptions) (pub *Publisher, err error)
- func (n *Node) NewService(name string, typeSupport ServiceTypeSupport, options *ServiceOptions, ...) (s *Service, err error)
- func (n *Node) NewSubscription(topicName string, ros2msg MessageTypeSupport, options *SubscriptionOptions, ...) (sub *Subscription, err error)
- func (n *Node) Spin(ctx context.Context) error
- type NodeInvalid
- type NodeInvalidName
- type NodeInvalidNamespace
- type NodeNameNonExistent
- type NotInit
- type Ok
- type Publisher
- type PublisherInvalid
- type PublisherOptions
- type QosProfile
- type ReliabilityPolicy
- type RequestID
- type RmwBadAlloc
- type RmwError
- type RmwIncorrectRmwImplementation
- type RmwInvalidArgument
- type RmwNodeNameNonExistent
- type RmwOk
- type RmwTimeout
- type RmwUnsupported
- type Service
- type ServiceInfo
- type ServiceInvalid
- type ServiceNameInvalid
- type ServiceOptions
- type ServiceRequestHandler
- type ServiceResponseSender
- type ServiceTakeFailed
- type ServiceTypeSupport
- type StatusHandler
- type Subscription
- type SubscriptionCallback
- type SubscriptionInvalid
- type SubscriptionOptions
- type SubscriptionTakeFailed
- type Timeout
- type Timer
- type TimerCanceled
- type TimerInvalid
- type TopicEndpointInfo
- type TopicNameInvalid
- type UnknownReturnCode
- type UnknownSubstitution
- type Unsupported
- type WaitSet
- func (w *WaitSet) AddActionClients(clients ...*ActionClient)
- func (w *WaitSet) AddActionServers(servers ...*ActionServer)
- func (w *WaitSet) AddClients(clients ...*Client)
- func (w *WaitSet) AddServices(services ...*Service)
- func (w *WaitSet) AddSubscriptions(subs ...*Subscription)
- func (w *WaitSet) AddTimers(timers ...*Timer)
- func (w *WaitSet) Close() (err error)
- func (w *WaitSet) Context() *Context
- func (w *WaitSet) Run(ctx context.Context) (err error)
- type WaitSetEmpty
- type WaitSetFull
- type WaitSetInvalid
- type WrongLexeme
Constants ¶
const ( DurationInfinite = 9223372036*time.Second + 854775807*time.Nanosecond DurationUnspecified = time.Duration(0) )
const DeadlineDefault = DurationUnspecified
const DefaultDomainID = math.MaxUint
DefaultDomainID Setting this as the domain ID causes ROS to use the value of ROS_DOMAIN_ID environment variable as the actual domain ID or zero if ROS_DOMAIN_ID not defined.
const GIDSize = 24
const GoalIDLen = 16
const LifespanDefault = DurationUnspecified
const LivelinessLeaseDurationDefault = DurationUnspecified
Variables ¶
This section is empty.
Functions ¶
func BoolArrayToC ¶
func BoolArrayToGo ¶
func BoolSequenceToC ¶
func BoolSequenceToC(cSlice *CBoolSequence, goSlice []bool)
func BoolSequenceToGo ¶
func BoolSequenceToGo(goSlice *[]bool, cSlice CBoolSequence)
func ByteArrayToC ¶
func ByteArrayToGo ¶
func ByteSequenceToC ¶
func ByteSequenceToC(cSlice *CByteSequence, goSlice []byte)
func ByteSequenceToGo ¶
func ByteSequenceToGo(goSlice *[]byte, cSlice CByteSequence)
func CharArrayToC ¶
func CharArrayToGo ¶
func CharSequenceToC ¶
func CharSequenceToC(cSlice *CcharSequence, goSlice []byte)
func CharSequenceToGo ¶
func CharSequenceToGo(goSlice *[]byte, cSlice CcharSequence)
func DefaultLoggingOutputHandler ¶ added in v0.2.0
func DefaultLoggingOutputHandler( location unsafe.Pointer, severity int, name unsafe.Pointer, timestamp int64, format unsafe.Pointer, args unsafe.Pointer, )
DefaultLoggingOutputHandler is the logging output handler used by default, which logs messages based on ROS parameters used to initialize the logging system.
func Deinit ¶ added in v0.2.0
func Deinit() (err error)
Deinit uninitializes the default context if it has been initialized. Calling Deinit multiple times without calling Init in between the calls is a no-op. Deinit should be called before program termination if Init has been called successfully.
func ExpandTopicName ¶ added in v0.2.0
func ExpandTopicName( inputTopicName, nodeName, nodeNamespace string, substitutions map[string]string, ) (expanded string, err error)
ExpandTopicName returns inputTopicName expanded to a fully qualified topic name.
substitutions may be nil, which is treated the same as an empty substitution map.
func Float32ArrayToC ¶
func Float32ArrayToGo ¶
func Float32SequenceToC ¶
func Float32SequenceToC(cSlice *CFloat32Sequence, goSlice []float32)
func Float32SequenceToGo ¶
func Float32SequenceToGo(goSlice *[]float32, cSlice CFloat32Sequence)
func Float64ArrayToC ¶
func Float64ArrayToGo ¶
func Float64SequenceToC ¶
func Float64SequenceToC(cSlice *CFloat64Sequence, goSlice []float64)
func Float64SequenceToGo ¶
func Float64SequenceToGo(goSlice *[]float64, cSlice CFloat64Sequence)
func InitLogging ¶ added in v0.2.0
InitLogging initializes the logging system, which is required for using logging functionality.
Logging configuration can be updated by calling InitLogging again with the desired args.
If the logging system has not yet been initialized on the first call of Init or NewContext, logging is initialized by that call using the passed arguments. Unlike InitLogging, Init and NewContext will not update the logging configuration if logging has already been initialized.
func InitWithOpts ¶ added in v0.2.0
func InitWithOpts(args *Args, opts *ContextOptions) (err error)
InitWithOpts initializes the global default context and logging system if they have not been initialized yet. Calling InitWithOpts multiple times after a successful (returning nil) call is a no-op.
A nil args is treated as an empty argument list.
If opts are nil, default options are used.
func Int8ArrayToC ¶
func Int8ArrayToGo ¶
func Int8SequenceToC ¶
func Int8SequenceToC(cSlice *CInt8Sequence, goSlice []int8)
func Int8SequenceToGo ¶
func Int8SequenceToGo(goSlice *[]int8, cSlice CInt8Sequence)
func Int16ArrayToC ¶
func Int16ArrayToGo ¶
func Int16SequenceToC ¶
func Int16SequenceToC(cSlice *CInt16Sequence, goSlice []int16)
func Int16SequenceToGo ¶
func Int16SequenceToGo(goSlice *[]int16, cSlice CInt16Sequence)
func Int32ArrayToC ¶
func Int32ArrayToGo ¶
func Int32SequenceToC ¶
func Int32SequenceToC(cSlice *CInt32Sequence, goSlice []int32)
func Int32SequenceToGo ¶
func Int32SequenceToGo(goSlice *[]int32, cSlice CInt32Sequence)
func Int64ArrayToC ¶
func Int64ArrayToGo ¶
func Int64SequenceToC ¶
func Int64SequenceToC(cSlice *CInt64Sequence, goSlice []int64)
func Int64SequenceToGo ¶
func Int64SequenceToGo(goSlice *[]int64, cSlice CInt64Sequence)
func RegisterAction ¶ added in v0.2.0
func RegisterAction(alias string, actionType ActionTypeSupport)
RegisterAction is the RegisterMessage equivalent for actions.
func RegisterMessage ¶ added in v0.2.0
func RegisterMessage(alias string, msgType MessageTypeSupport)
RegisterMessage sets the type string to implementation dispatcher, so the correct type can be dynamically chosen. The Golang types of ROS2 Message use
func init() {}
to automatically populate this when imported.
func RegisterService ¶ added in v0.2.0
func RegisterService(alias string, srvType ServiceTypeSupport)
RegisterService is the RegisterMessage equivalent for services.
func SetLoggingOutputHandler ¶ added in v0.2.0
func SetLoggingOutputHandler(h LoggingOutputHandler)
SetLoggingOutputHandler sets the current logging output handler to h. If h == nil, DefaultLoggingOutputHandler is used.
func Spin ¶ added in v0.2.0
Spin starts and waits for all ROS resources in DefaultContext() that need waiting such as nodes and subscriptions. Spin returns when an error occurs or ctx is canceled.
func StringArrayToC ¶
func StringArrayToGo ¶
func StringAsCStruct ¶
func StringAsGoStruct ¶
func StringSequenceToC ¶
func StringSequenceToC(cSlice *CStringSequence, goSlice []string)
func StringSequenceToGo ¶
func StringSequenceToGo(goSlice *[]string, cSlice CStringSequence)
func U16StringAsCStruct ¶
func U16StringAsGoStruct ¶
func U16stringArrayToC ¶
func U16stringArrayToC(cSlice []CU16String, goSlice []string)
func U16stringArrayToGo ¶
func U16stringArrayToGo(goSlice []string, cSlice []CU16String)
func U16stringSequenceToC ¶
func U16stringSequenceToC(cSlice *Cu16stringSequence, goSlice []string)
func U16stringSequenceToGo ¶
func U16stringSequenceToGo(goSlice *[]string, cSlice Cu16stringSequence)
func Uint8ArrayToC ¶
func Uint8ArrayToGo ¶
func Uint8SequenceToC ¶
func Uint8SequenceToC(cSlice *CUint8Sequence, goSlice []uint8)
func Uint8SequenceToGo ¶
func Uint8SequenceToGo(goSlice *[]uint8, cSlice CUint8Sequence)
func Uint16ArrayToC ¶
func Uint16ArrayToGo ¶
func Uint16SequenceToC ¶
func Uint16SequenceToC(cSlice *CUint16Sequence, goSlice []uint16)
func Uint16SequenceToGo ¶
func Uint16SequenceToGo(goSlice *[]uint16, cSlice CUint16Sequence)
func Uint32ArrayToC ¶
func Uint32ArrayToGo ¶
func Uint32SequenceToC ¶
func Uint32SequenceToC(cSlice *CUint32Sequence, goSlice []uint32)
func Uint32SequenceToGo ¶
func Uint32SequenceToGo(goSlice *[]uint32, cSlice CUint32Sequence)
func Uint64ArrayToC ¶
func Uint64ArrayToGo ¶
func Uint64SequenceToC ¶
func Uint64SequenceToC(cSlice *CUint64Sequence, goSlice []uint64)
func Uint64SequenceToGo ¶
func Uint64SequenceToGo(goSlice *[]uint64, cSlice CUint64Sequence)
Types ¶
type Action ¶ added in v0.2.0
type Action interface {
// ExecuteGoal executes a goal.
//
// The description of the goal is passed in the GoalHandle.
//
// First, ExecuteGoal must decide whether to accept the goal or not. The goal
// can be accepted by calling GoalHandle.Accept. GoalHandle.Accept should be
// called as soon as the decision to accept the goal is made, before
// starting to execute the goal.
//
// ExecuteGoal returns a pair of (result, error). If ExecuteGoal returns a
// nil error, the goal is assumed to be executed successfully to completion.
// In this case the result must be non-nil, and its type support must be
// TypeSupport().Result(). If ExecuteGoal returns a non-nil error, the
// result is ignored. If the error is returned before accepting the goal,
// the goal is considered to have been rejected. If the error is returned
// after accepting the goal, the goal is considered to have been aborted.
//
// The context is used to notify cancellation of the goal. If the context is
// canceled, ExecuteGoal should stop all processing as soon as possible. In
// this case the return values of ExecuteGoal are ignored.
//
// ExecuteGoal may be called multiple times in parallel by the ActionServer.
// Each call will receive a different GoalHandle.
ExecuteGoal(ctx context.Context, goal *GoalHandle) (Message, error)
// TypeSupport returns the type support for the action. The same value
// must be returned on every invocation.
TypeSupport() ActionTypeSupport
}
Action can execute goals.
func NewAction ¶ added in v0.2.0
func NewAction( typeSupport ActionTypeSupport, executeGoal ExecuteGoalFunc, ) Action
NewAction returns an Action implementation that uses typeSupport and executes goals using executeGoal.
type ActionClient ¶ added in v0.2.0
type ActionClient struct {
// contains filtered or unexported fields
}
ActionClient communicates with an ActionServer to initiate and monitor the progress of goals.
All methods except Close are safe for concurrent use.
func (*ActionClient) CancelGoal ¶ added in v0.2.0
CancelGoal cancels goals.
A non-nil error is returned only if the processing of the request itself failed. CancelGoal returns normally even if the canceling fails. The status can be read from the returned response message.
The request includes a goal ID and a timestamp. If both the ID and the timestamp have zero values, all goals are canceled. If the ID is zero but the timestamp is not, all goals accepted at or before the timestamp are canceled. If the ID is not zero and the timestamp is zero, the goal with the specified ID is canceled. If both the ID and the timestamp are non-zero, the goal with the specified ID as well as all goals accepted at or before the timestamp are canceled.
The type of request is action_msgs/srv/CancelGoal_Request.
The type of the returned message is action_msgs/srv/CancelGoal_Response.
func (*ActionClient) Close ¶ added in v0.2.0
func (c *ActionClient) Close() error
Close frees resources used by the ActionClient. A closed ActionClient must not be used.
func (*ActionClient) GetResult ¶ added in v0.2.0
GetResult returns the result of the goal with goalID or an error if getting the result fails. If the goal has not yet reached a terminal state, GetResult waits for that to happen before returning.
The type support of the returned message is ActionTypeSupport.GetResult().Response().
func (*ActionClient) Node ¶ added in v0.2.0
func (c *ActionClient) Node() *Node
Node returns the node c was created with.
func (*ActionClient) SendGoal ¶ added in v0.2.0
SendGoal sends a new goal to the server and returns the status message of the goal. The ID for the goal is generated using a cryptographically secure random number generator.
A non-nil error is returned only if the processing of the request itself failed. SendGoal returns normally even if the goal is rejected, and the status can be read from the returned response message.
The type support of goal must be ActionTypeSupport.Goal().
The type support of the returned message is ActionTypeSupport.SendGoal().Response().
func (*ActionClient) SendGoalRequest ¶ added in v0.2.0
SendGoalRequest sends a goal to the server and returns the status message of the goal.
The type support of request must be ActionTypeSupport.SendGoal().Request().
The type support of the returned message is ActionTypeSupport.SendGoal().Response().
A non-nil error is returned only if the processing of the request itself failed. SendGoalRequest returns normally even if the goal is rejected, and the status can be read from the returned response message.
func (*ActionClient) WatchFeedback ¶ added in v0.2.0
func (c *ActionClient) WatchFeedback(ctx context.Context, goalID *GoalID, handler FeedbackHandler) <-chan error
WatchFeedback calls handler for every feedback message for the goal with id goalID. If goalID is nil, handler is called for all feedback messages regardless of which goal they belong to.
WatchFeedback returns after the handler has been registered. The returned channel will receive exactly one error value, which may be nil, and then the channel is closed. Reading the value from the channel is not required. Watching can be stopped by canceling ctx.
The type support of the message passed to handler is ActionTypeSupport.FeedbackMessage().
func (*ActionClient) WatchGoal ¶ added in v0.2.0
func (c *ActionClient) WatchGoal(ctx context.Context, goal Message, onFeedback FeedbackHandler) (result Message, goalID *GoalID, retErr error)
WatchGoal combines functionality of SendGoal and WatchFeedback. It sends a goal to the server. If the goal is accepted, feedback for the goal is watched until the goal reaches a terminal state or ctx is canceled. If the goal is accepted and completes successfully, its result is returned. Otherwise a non-nil error is returned.
onFeedback may be nil, in which case feedback for the goal is not watched.
The type support of goal must be ActionTypeSupport.Goal().
The type support of the returned message is ActionTypeSupport.Result().
The type support of the message passed to onFeedback is ActionTypeSupport.FeedbackMessage().
func (*ActionClient) WatchStatus ¶ added in v0.2.0
func (c *ActionClient) WatchStatus(ctx context.Context, goalID *GoalID, handler StatusHandler) <-chan error
WatchStatus calls handler for every status message regarding the goal with id goalID. If goalID is nil, handler is called for all status messages regardless of which goal they belong to.
WatchStatus returns after the handler has been registered. The returned channel will receive exactly one error value, which may be nil, and then the channel is closed. Reading the value from the channel is not required. Watching can be stopped by canceling ctx.
The type of the message passed to handler will be action_msgs/msg/GoalStatus.
type ActionClientInvalid ¶ added in v0.2.0
type ActionClientInvalid struct {
// contains filtered or unexported fields
}
ActionClientInvalid Action client is invalid return code.
type ActionClientOptions ¶ added in v0.2.0
type ActionClientOptions struct {
GoalServiceQos QosProfile
CancelServiceQos QosProfile
ResultServiceQos QosProfile
FeedbackTopicQos QosProfile
StatusTopicQos QosProfile
}
func NewDefaultActionClientOptions ¶ added in v0.2.0
func NewDefaultActionClientOptions() *ActionClientOptions
type ActionClientTakeFailed ¶ added in v0.2.0
type ActionClientTakeFailed struct {
// contains filtered or unexported fields
}
ActionClientTakeFailed Action client failed to take response return code.
type ActionGoalAccepted ¶ added in v0.2.0
type ActionGoalAccepted struct {
// contains filtered or unexported fields
}
ActionGoalAccepted Action goal accepted return code.
type ActionGoalEventInvalid ¶ added in v0.2.0
type ActionGoalEventInvalid struct {
// contains filtered or unexported fields
}
ActionGoalEventInvalid Action invalid event return code.
type ActionGoalHandleInvalid ¶ added in v0.2.0
type ActionGoalHandleInvalid struct {
// contains filtered or unexported fields
}
ActionGoalHandleInvalid Action goal handle invalid return code.
type ActionGoalRejected ¶ added in v0.2.0
type ActionGoalRejected struct {
// contains filtered or unexported fields
}
ActionGoalRejected Action goal rejected return code.
type ActionNameInvalid ¶ added in v0.2.0
type ActionNameInvalid struct {
// contains filtered or unexported fields
}
ActionNameInvalid rcl action specific ret codes in 2XXXAction name does not pass validation return code.
type ActionServer ¶ added in v0.2.0
type ActionServer struct {
// contains filtered or unexported fields
}
ActionServer listens for and executes goals sent by action clients.
func (*ActionServer) Close ¶ added in v0.2.0
func (s *ActionServer) Close() (err error)
func (*ActionServer) Node ¶ added in v0.2.0
func (s *ActionServer) Node() *Node
Node returns the node s was created with.
type ActionServerInvalid ¶ added in v0.2.0
type ActionServerInvalid struct {
// contains filtered or unexported fields
}
ActionServerInvalid Action server is invalid return code.
type ActionServerOptions ¶ added in v0.2.0
type ActionServerOptions struct {
GoalServiceQos QosProfile
CancelServiceQos QosProfile
ResultServiceQos QosProfile
FeedbackTopicQos QosProfile
StatusTopicQos QosProfile
ResultTimeout time.Duration
Clock *Clock
}
func NewDefaultActionServerOptions ¶ added in v0.2.0
func NewDefaultActionServerOptions() *ActionServerOptions
type ActionServerTakeFailed ¶ added in v0.2.0
type ActionServerTakeFailed struct {
// contains filtered or unexported fields
}
ActionServerTakeFailed Action server failed to take request return code.
type ActionTypeSupport ¶ added in v0.2.0
type ActionTypeSupport interface {
Goal() MessageTypeSupport
SendGoal() ServiceTypeSupport
NewSendGoalResponse(accepted bool, stamp time.Duration) Message
Result() MessageTypeSupport
GetResult() ServiceTypeSupport
NewGetResultResponse(status int8, result Message) Message
CancelGoal() ServiceTypeSupport
Feedback() MessageTypeSupport
FeedbackMessage() MessageTypeSupport
NewFeedbackMessage(goalID *GoalID, feedback Message) Message
GoalStatusArray() MessageTypeSupport
TypeSupport() unsafe.Pointer // *C.rosidl_action_type_support_t
}
func GetAction ¶ added in v0.2.0
func GetAction(actionType string) (ActionTypeSupport, bool)
GetAction is the GetMessage equivalent for actions.
func MustGetAction ¶ added in v0.2.0
func MustGetAction(actionType string) ActionTypeSupport
MustGetAction is the MustGetMessage equivalent for actions.
type AlreadyInit ¶ added in v0.2.0
type AlreadyInit struct {
// contains filtered or unexported fields
}
AlreadyInit rcl specific ret codes start at 100rcl_init() already called return code.
type AlreadyShutdown ¶ added in v0.2.0
type AlreadyShutdown struct {
// contains filtered or unexported fields
}
AlreadyShutdown rcl_shutdown() already called return code.
type Args ¶ added in v0.2.0
type Args struct {
// contains filtered or unexported fields
}
Args ROS2 is configured via CLI arguments, so merge them from different sources. See http://design.ros2.org/articles/ros_command_line_arguments.html for details.
func ParseArgs ¶ added in v0.2.0
ParseArgs parses ROS 2 command line arguments from the given slice. Returns the parsed ROS 2 arguments and the remaining non-ROS arguments.
ParseArgs expects ROS 2 arguments to be wrapped between a pair of "--ros-args" and "--" arguments. See http://design.ros2.org/articles/ros_command_line_arguments.html for details.
type BadAlloc ¶ added in v0.2.0
type BadAlloc = RmwBadAlloc
BadAlloc Failed to allocate memory return code.
type CBoolSequence ¶
type CBoolSequence = C.rosidl_runtime_c__boolean__Sequence
type CByteSequence ¶
type CByteSequence = C.rosidl_runtime_c__octet__Sequence
type CFloat32Sequence ¶
type CFloat32Sequence = C.rosidl_runtime_c__float__Sequence
type CFloat64Sequence ¶
type CFloat64Sequence = C.rosidl_runtime_c__double__Sequence
type CInt8Sequence ¶
type CInt8Sequence = C.rosidl_runtime_c__int8__Sequence
type CInt16Sequence ¶
type CInt16Sequence = C.rosidl_runtime_c__int16__Sequence
type CInt32Sequence ¶
type CInt32Sequence = C.rosidl_runtime_c__int32__Sequence
type CInt64Sequence ¶
type CInt64Sequence = C.rosidl_runtime_c__int64__Sequence
type CString ¶
type CString = C.rosidl_runtime_c__String
type CStringSequence ¶
type CStringSequence = C.rosidl_runtime_c__String__Sequence
type CU16String ¶
type CU16String = C.rosidl_runtime_c__U16String
type CUint8Sequence ¶
type CUint8Sequence = C.rosidl_runtime_c__uint8__Sequence
type CUint16Sequence ¶
type CUint16Sequence = C.rosidl_runtime_c__uint16__Sequence
type CUint32Sequence ¶
type CUint32Sequence = C.rosidl_runtime_c__uint32__Sequence
type CUint64Sequence ¶
type CUint64Sequence = C.rosidl_runtime_c__uint64__Sequence
type CcharSequence ¶
type CcharSequence = C.rosidl_runtime_c__char__Sequence
type Client ¶ added in v0.2.0
type Client struct {
// contains filtered or unexported fields
}
Client is used to send requests to and receive responses from a service.
Calling Send and Close is thread-safe. Creating clients is not thread-safe.
type ClientInvalid ¶ added in v0.2.0
type ClientInvalid struct {
// contains filtered or unexported fields
}
ClientInvalid rcl service client specific ret codes in 5XXInvalid rcl_client_t given return code.
type ClientOptions ¶ added in v0.2.0
type ClientOptions struct {
Qos QosProfile
}
func NewDefaultClientOptions ¶ added in v0.2.0
func NewDefaultClientOptions() *ClientOptions
type ClientTakeFailed ¶ added in v0.2.0
type ClientTakeFailed struct {
// contains filtered or unexported fields
}
ClientTakeFailed Failed to take a response from the client return code.
type Clock ¶ added in v0.2.0
type Clock struct {
// contains filtered or unexported fields
}
type Context ¶ added in v0.2.0
type Context struct {
// contains filtered or unexported fields
}
Context manages resources for a set of RCL entities.
func DefaultContext ¶ added in v0.2.0
func DefaultContext() *Context
DefaultContext returns the global default context or nil if Init has not yet been called.
func NewContext ¶ added in v0.2.0
NewContext calls NewContextWithOpts with default options except for ClockType, which is set to the value passed to this function.
If clockType == 0, ClockTypeROSTime is used.
func NewContextWithOpts ¶ added in v0.2.0
func NewContextWithOpts(rclArgs *Args, opts *ContextOptions) (ctx *Context, err error)
NewContextWithOpts initializes a new RCL context.
A nil rclArgs is treated as en empty argument list.
If logging has not yet been initialized, NewContextWithOpts will initialize it automatically using rclArgs for logging configuration.
If opts is nil, default options are used.
func (*Context) NewWaitSet ¶ added in v0.2.0
type ContextOptions ¶ added in v0.2.0
type ContextOptions struct {
// The type of the default clock created for the Context.
ClockType ClockType
// The DDS domain ID of the Context. Should be in range [0, 101] or
// DefaultDomainID.
DomainID uint
}
ContextOptions can be used to configure a Context.
func NewDefaultContextOptions ¶ added in v0.2.0
func NewDefaultContextOptions() *ContextOptions
NewDefaultContextOptions returns the default options for a Context.
type Cu16stringSequence ¶
type Cu16stringSequence = C.rosidl_runtime_c__U16String__Sequence
type DurabilityPolicy ¶ added in v0.2.0
type DurabilityPolicy int
const ( DurabilitySystemDefault DurabilityPolicy = iota DurabilityTransientLocal DurabilityVolatile DurabilityUnknown )
type EndpointType ¶ added in v0.2.0
type EndpointType int
const ( EndpointInvalid EndpointType = iota EndpointPublisher EndpointSubscription )
type EventInvalid ¶ added in v0.2.0
type EventInvalid struct {
// contains filtered or unexported fields
}
EventInvalid rcl event specific ret codes in 20XXInvalid rcl_event_t given return code.
type EventTakeFailed ¶ added in v0.2.0
type EventTakeFailed struct {
// contains filtered or unexported fields
}
EventTakeFailed Failed to take an event from the event handle
type ExecuteGoalFunc ¶ added in v0.2.0
type ExecuteGoalFunc = func(context.Context, *GoalHandle) (Message, error)
type FeedbackHandler ¶ added in v0.2.0
type FeedbackSender ¶ added in v0.2.0
type FeedbackSender struct {
// contains filtered or unexported fields
}
FeedbackSender is used to send feedback about a goal.
func (*FeedbackSender) Send ¶ added in v0.2.0
func (s *FeedbackSender) Send(msg Message) error
Send sends msg to clients listening for feedback messages.
The type support of msg must be ActionTypeSupport.Feedback().
type GoalHandle ¶ added in v0.2.0
type GoalHandle struct {
// The ID of the goal. Modifying this is an undefined behavior.
ID GoalID
// Description is a message whose type support is ActionTypeSupport.Goal().
Description Message
// contains filtered or unexported fields
}
GoalHandle is used to keep track of the status of a goal sent to an ActionServer.
func (*GoalHandle) Accept ¶ added in v0.2.0
func (g *GoalHandle) Accept() (s *FeedbackSender, err error)
Accept accepts g and returns a FeedbackSender that can be used to send feedback about the goal to action clients. Calls after the first successful (returning a nil error) do not change the state of the goal and only return valid feedback senders. Accept should be called as soon as the goal is decided to be accepted. If Accept returns a non-nil error the returned FeedbackSender is nil and g is left in an unspecified but valid state. In that case it is usually appropriate to stop executing the goal and return the error returned by Accept.
func (*GoalHandle) Logger ¶ added in v0.2.0
func (g *GoalHandle) Logger() *Logger
Logger is a shorthand for g.Server().Node().Logger().
func (*GoalHandle) Server ¶ added in v0.2.0
func (g *GoalHandle) Server() *ActionServer
Server returns the ActionServer that is handling g.
type GoalStatus ¶ added in v0.2.0
type GoalStatus int8
const ( GoalUnknown GoalStatus = iota // Unknown GoalAccepted // Accepted GoalExecuting // Executing GoalCanceling // Canceling GoalSucceeded // Succeeded GoalCanceled // Canceled GoalAborted // Aborted )
func (GoalStatus) String ¶ added in v0.2.0
func (i GoalStatus) String() string
type HistoryPolicy ¶ added in v0.2.0
type HistoryPolicy int
const ( HistorySystemDefault HistoryPolicy = iota HistoryKeepLast HistoryKeepAll HistoryUnknown )
type InvalidArgument ¶ added in v0.2.0
type InvalidArgument = RmwInvalidArgument
InvalidArgument Invalid argument return code.
type InvalidLogLevelRule ¶ added in v0.2.0
type InvalidLogLevelRule struct {
// contains filtered or unexported fields
}
InvalidLogLevelRule Argument is not a valid log level rule
type InvalidParamRule ¶ added in v0.2.0
type InvalidParamRule struct {
// contains filtered or unexported fields
}
InvalidParamRule Argument is not a valid parameter rule
type InvalidRemapRule ¶ added in v0.2.0
type InvalidRemapRule struct {
// contains filtered or unexported fields
}
InvalidRemapRule rcl argument parsing specific ret codes in 1XXXArgument is not a valid remap rule
type InvalidRosArgs ¶ added in v0.2.0
type InvalidRosArgs struct {
// contains filtered or unexported fields
}
InvalidRosArgs Found invalid ros argument while parsing
type LifecycleStateNotRegistered ¶ added in v0.2.0
type LifecycleStateNotRegistered struct {
// contains filtered or unexported fields
}
LifecycleStateNotRegistered rcl_lifecycle state not registered
type LifecycleStateRegistered ¶ added in v0.2.0
type LifecycleStateRegistered struct {
// contains filtered or unexported fields
}
LifecycleStateRegistered rcl_lifecycle state register ret codes in 30XXrcl_lifecycle state registered
type LivelinessPolicy ¶ added in v0.2.0
type LivelinessPolicy int
const ( LivelinessSystemDefault LivelinessPolicy = iota LivelinessAutomatic LivelinessManualByTopic LivelinessUnknown )
type LogSeverity ¶ added in v0.2.0
type LogSeverity uint32
LogSeverity The severity levels of log messages / loggers.
const ( LogSeverityUnset LogSeverity = 0 ///< The unset log level LogSeverityDebug LogSeverity = 10 ///< The debug log level LogSeverityInfo LogSeverity = 20 ///< The info log level LogSeverityWarn LogSeverity = 30 ///< The warn log level LogSeverityError LogSeverity = 40 ///< The error log level LogSeverityFatal LogSeverity = 50 ///< The fatal log level )
func (LogSeverity) String ¶ added in v0.2.0
func (s LogSeverity) String() string
type Logger ¶ added in v0.2.0
type Logger struct {
// contains filtered or unexported fields
}
Logger can be used to log messages using the ROS 2 logging system.
Loggers are usable only after logging has been initialized. See InitLogging.
Logging methods prefixed with "Log" take the logging level as the first parameter. Methods prefixed with the name of a logging level are shorthands to "Log" methods, and log using the prefixed logging level.
Logging methods suffixed with "", "f" or "ln" format their arguments in the same way as fmt.Print, fmt.Printf and fmt.Println, respectively.
func GetLogger ¶ added in v0.2.0
GetLogger returns the logger-named name. If the name is empty, the default logger is returned. Returns nil if the name is invalid.
func (*Logger) Child ¶ added in v0.2.0
Child returns the child logger of l named name. Returns nil if name is invalid.
func (*Logger) EffectiveLevel ¶ added in v0.2.0
func (l *Logger) EffectiveLevel() (LogSeverity, error)
EffectiveLevel returns the effective logging level of l, which considers the logging levels of l's ancestors as well as the logging level of l itself. Note that this is not necessarily the same as Level.
func (*Logger) IsEnabledFor ¶ added in v0.2.0
func (l *Logger) IsEnabledFor(level LogSeverity) bool
IsEnabledFor returns true if l can log messages whose severity is at least level and false if not.
func (*Logger) Level ¶ added in v0.2.0
func (l *Logger) Level() (LogSeverity, error)
Level returns the logging level of l. Note that this is not necessarily the same as EffectiveLevel.
func (*Logger) Log ¶ added in v0.2.0
func (l *Logger) Log(level LogSeverity, a ...interface{}) error
func (*Logger) Logf ¶ added in v0.2.0
func (l *Logger) Logf(level LogSeverity, format string, a ...interface{}) error
func (*Logger) Logln ¶ added in v0.2.0
func (l *Logger) Logln(level LogSeverity, a ...interface{}) error
func (*Logger) Parent ¶ added in v0.2.0
Parent returns the parent logger of l. If l has no parent, the default logger is returned.
func (*Logger) SetLevel ¶ added in v0.2.0
func (l *Logger) SetLevel(level LogSeverity) error
SetLevel sets the logging level of l.
type LoggingOutputHandler ¶ added in v0.2.0
type LoggingOutputHandler = func( location unsafe.Pointer, severity int, name unsafe.Pointer, timestamp int64, format unsafe.Pointer, args unsafe.Pointer, )
LoggingOutputHandler is the function signature of logging output handling. Backward compatibility is not guaranteed for this type alias. Use it only if necessary.
func GetLoggingOutputHandler ¶ added in v0.2.0
func GetLoggingOutputHandler() LoggingOutputHandler
GetLoggingOutputHandler returns the current logging output handler.
type Message ¶ added in v0.2.0
type Message interface {
CloneMsg() Message
SetDefaults()
GetTypeSupport() MessageTypeSupport
}
func Deserialize ¶ added in v0.2.0
func Deserialize(buf []byte, ts MessageTypeSupport) (msg Message, err error)
Deserialize deserializes buf to a message whose type support is ts. The contents of buf must match ts.
type MessageInfo ¶ added in v0.2.0
type MessageTypeSupport ¶ added in v0.2.0
type MessageTypeSupport interface {
New() Message
PrepareMemory() unsafe.Pointer
ReleaseMemory(p unsafe.Pointer)
AsCStruct(dst unsafe.Pointer, src Message)
AsGoStruct(dst Message, src unsafe.Pointer)
TypeSupport() unsafe.Pointer // *C.rosidl_message_type_support_t
}
func GetMessage ¶ added in v0.2.0
func GetMessage(msgType string) (MessageTypeSupport, bool)
GetMessage translates "std_msgs/ColorRGBA" to std_msgs.ColorRGBA -Go type returns true if the type mapping is found
func LoadDynamicMessageTypeSupport ¶ added in v0.2.0
func LoadDynamicMessageTypeSupport(pkgName, msgName string) (MessageTypeSupport, error)
LoadDynamicMessageTypeSupport loads a message type support implementation dynamically.
MessageTypeSupport instances returned by LoadDynamicMessageTypeSupport support use cases related to handling only serialized messages. Methods New, PrepareMemory, ReleaseMemory, AsCStruct and AsGoStruct will panic.
Backward compatibility is not guaranteed for this API. Use it only if necessary.
func MustGetMessage ¶ added in v0.2.0
func MustGetMessage(msgType string) MessageTypeSupport
MustGetMessage panics if there is no mapping
type MismatchedRmwId ¶ added in v0.2.0
type MismatchedRmwId struct {
// contains filtered or unexported fields
}
MismatchedRmwId Mismatched rmw identifier return code.
type Node ¶ added in v0.2.0
type Node struct {
// contains filtered or unexported fields
}
func (*Node) FullyQualifiedName ¶ added in v0.2.0
FullyQualifiedName returns the fully qualified name of n, which includes the namespace as well as the name.
func (*Node) GetActionClientNamesAndTypesByNode ¶ added in v0.2.0
func (*Node) GetActionServerNamesAndTypesByNode ¶ added in v0.2.0
func (*Node) GetClientNamesAndTypesByNode ¶ added in v0.2.0
func (*Node) GetNodeNames ¶ added in v0.2.0
func (*Node) GetPublisherNamesAndTypesByNode ¶ added in v0.2.0
func (*Node) GetPublishersInfoByTopic ¶ added in v0.2.0
func (n *Node) GetPublishersInfoByTopic(topic string, mangle bool) ([]TopicEndpointInfo, error)
func (*Node) GetServiceNamesAndTypesByNode ¶ added in v0.2.0
func (*Node) GetSubscriberNamesAndTypesByNode ¶ added in v0.2.0
func (*Node) GetSubscriptionsInfoByTopic ¶ added in v0.2.0
func (n *Node) GetSubscriptionsInfoByTopic(topic string, mangle bool) ([]TopicEndpointInfo, error)
func (*Node) GetTopicNamesAndTypes ¶ added in v0.2.0
GetTopicNamesAndTypes returns a map of all known topic names to corresponding topic types. If demangle is true, topic names will be in the format used by the underlying middleware.
func (*Node) NewActionClient ¶ added in v0.2.0
func (n *Node) NewActionClient( name string, ts ActionTypeSupport, opts *ActionClientOptions, ) (*ActionClient, error)
NewActionClient creates an action client that communicates with an action server.
func (*Node) NewActionServer ¶ added in v0.2.0
func (n *Node) NewActionServer( name string, action Action, opts *ActionServerOptions, ) (*ActionServer, error)
NewActionServer creates a new action server.
opts must not be modified after passing it to this function. If opts is nil, default options are used.
func (*Node) NewClient ¶ added in v0.2.0
func (n *Node) NewClient( serviceName string, typeSupport ServiceTypeSupport, options *ClientOptions, ) (c *Client, err error)
NewClient creates a new client.
Options must not be modified after passing it to this function. If options are nil, default options are used.
func (*Node) NewPublisher ¶ added in v0.2.0
func (n *Node) NewPublisher( topicName string, ros2msg MessageTypeSupport, options *PublisherOptions, ) (pub *Publisher, err error)
NewPublisher creates a new publisher.
Options must not be modified after passing it to this function. If options is nil, default options are used.
func (*Node) NewService ¶ added in v0.2.0
func (n *Node) NewService( name string, typeSupport ServiceTypeSupport, options *ServiceOptions, handler ServiceRequestHandler, ) (s *Service, err error)
NewService creates a new service.
Options must not be modified after passing it to this function. If options is nil, default options are used.
func (*Node) NewSubscription ¶ added in v0.2.0
func (n *Node) NewSubscription( topicName string, ros2msg MessageTypeSupport, options *SubscriptionOptions, subscriptionCallback SubscriptionCallback, ) (sub *Subscription, err error)
NewSubscription creates a new subscription.
Options must not be modified after passing it to this function. If options is nil, default options are used.
type NodeInvalid ¶ added in v0.2.0
type NodeInvalid struct {
// contains filtered or unexported fields
}
NodeInvalid rcl node specific ret codes in 2XXInvalid rcl_node_t given return code.
type NodeInvalidName ¶ added in v0.2.0
type NodeInvalidName struct {
// contains filtered or unexported fields
}
NodeInvalidName Invalid node name return code.
type NodeInvalidNamespace ¶ added in v0.2.0
type NodeInvalidNamespace struct {
// contains filtered or unexported fields
}
NodeInvalidNamespace Invalid node namespace return code.
type NodeNameNonExistent ¶ added in v0.2.0
type NodeNameNonExistent struct {
// contains filtered or unexported fields
}
NodeNameNonExistent Failed to find node name
type NotInit ¶ added in v0.2.0
type NotInit struct {
// contains filtered or unexported fields
}
NotInit rcl_init() not yet called return code.
type Publisher ¶ added in v0.2.0
type Publisher struct {
TopicName string
// contains filtered or unexported fields
}
func (*Publisher) GetSubscriptionCount ¶ added in v0.2.0
GetSubscriptionCount returns the number of subscriptions matched to p.
func (*Publisher) PublishSerialized ¶ added in v0.2.0
PublishSerialized publishes a message that has already been serialized.
type PublisherInvalid ¶ added in v0.2.0
type PublisherInvalid struct {
// contains filtered or unexported fields
}
PublisherInvalid rcl publisher specific ret codes in 3XXInvalid rcl_publisher_t given return code.
type PublisherOptions ¶ added in v0.2.0
type PublisherOptions struct {
Qos QosProfile
}
func NewDefaultPublisherOptions ¶ added in v0.2.0
func NewDefaultPublisherOptions() *PublisherOptions
type QosProfile ¶ added in v0.2.0
type QosProfile struct {
History HistoryPolicy `yaml:"history"`
Depth int `yaml:"depth"`
Reliability ReliabilityPolicy `yaml:"reliability"`
Durability DurabilityPolicy `yaml:"durability"`
Deadline time.Duration `yaml:"deadline"`
Lifespan time.Duration `yaml:"lifespan"`
Liveliness LivelinessPolicy `yaml:"liveliness"`
LivelinessLeaseDuration time.Duration `yaml:"liveliness_lease_duration"`
AvoidRosNamespaceConventions bool `yaml:"avoid_ros_namespace_conventions"`
}
func NewDefaultQosProfile ¶ added in v0.2.0
func NewDefaultQosProfile() QosProfile
func NewDefaultServiceQosProfile ¶ added in v0.2.0
func NewDefaultServiceQosProfile() QosProfile
func NewDefaultStatusQosProfile ¶ added in v0.2.0
func NewDefaultStatusQosProfile() QosProfile
type ReliabilityPolicy ¶ added in v0.2.0
type ReliabilityPolicy int
const ( ReliabilitySystemDefault ReliabilityPolicy = iota ReliabilityReliable ReliabilityBestEffort ReliabilityUnknown )
type RmwBadAlloc ¶ added in v0.2.0
type RmwBadAlloc struct {
// contains filtered or unexported fields
}
RmwBadAlloc Failed to allocate memory
type RmwError ¶ added in v0.2.0
type RmwError struct {
// contains filtered or unexported fields
}
RmwError Generic error to indicate operation could not complete successfully
type RmwIncorrectRmwImplementation ¶ added in v0.2.0
type RmwIncorrectRmwImplementation struct {
// contains filtered or unexported fields
}
RmwIncorrectRmwImplementation Incorrect rmw implementation.
type RmwInvalidArgument ¶ added in v0.2.0
type RmwInvalidArgument struct {
// contains filtered or unexported fields
}
RmwInvalidArgument Argument to function was invalid
type RmwNodeNameNonExistent ¶ added in v0.2.0
type RmwNodeNameNonExistent struct {
// contains filtered or unexported fields
}
RmwNodeNameNonExistent rmw node specific ret codes in 2XXFailed to find node nameUsing same return code than in rcl
type RmwOk ¶ added in v0.2.0
type RmwOk struct {
// contains filtered or unexported fields
}
RmwOk Return code for rmw functionsThe operation ran as expected
type RmwTimeout ¶ added in v0.2.0
type RmwTimeout struct {
// contains filtered or unexported fields
}
RmwTimeout The operation was halted early because it exceeded its timeout critera
type RmwUnsupported ¶ added in v0.2.0
type RmwUnsupported struct {
// contains filtered or unexported fields
}
RmwUnsupported The operation or event handling is not supported.
type ServiceInfo ¶ added in v0.2.0
type ServiceInvalid ¶ added in v0.2.0
type ServiceInvalid struct {
// contains filtered or unexported fields
}
ServiceInvalid rcl service server specific ret codes in 6XXInvalid rcl_service_t given return code.
type ServiceNameInvalid ¶ added in v0.2.0
type ServiceNameInvalid struct {
// contains filtered or unexported fields
}
ServiceNameInvalid Service name (same as topic name) does not pass validation.
type ServiceOptions ¶ added in v0.2.0
type ServiceOptions struct {
Qos QosProfile
}
func NewDefaultServiceOptions ¶ added in v0.2.0
func NewDefaultServiceOptions() *ServiceOptions
type ServiceRequestHandler ¶ added in v0.2.0
type ServiceRequestHandler func(*ServiceInfo, Message, ServiceResponseSender)
type ServiceResponseSender ¶ added in v0.2.0
type ServiceTakeFailed ¶ added in v0.2.0
type ServiceTakeFailed struct {
// contains filtered or unexported fields
}
ServiceTakeFailed Failed to take a request from the service return code.
type ServiceTypeSupport ¶ added in v0.2.0
type ServiceTypeSupport interface {
Request() MessageTypeSupport
Response() MessageTypeSupport
TypeSupport() unsafe.Pointer // *C.rosidl_service_type_support_t
}
func GetService ¶ added in v0.2.0
func GetService(srvType string) (ServiceTypeSupport, bool)
GetService is the GetMessage equivalent for services.
func MustGetService ¶ added in v0.2.0
func MustGetService(srvType string) ServiceTypeSupport
MustGetService is the MustGetMessage equivalent for services.
type StatusHandler ¶ added in v0.2.0
type Subscription ¶ added in v0.2.0
type Subscription struct {
TopicName string
Ros2MsgType MessageTypeSupport
Callback SubscriptionCallback
// contains filtered or unexported fields
}
func (*Subscription) Close ¶ added in v0.2.0
func (s *Subscription) Close() (err error)
Close frees the allocated memory
func (*Subscription) GetPublisherCount ¶ added in v0.2.0
func (s *Subscription) GetPublisherCount() (int, error)
GetPublisherCount returns the number of publishers matched to s.
func (*Subscription) Node ¶ added in v0.2.0
func (s *Subscription) Node() *Node
Node returns the node s belongs to.
func (*Subscription) TakeMessage ¶ added in v0.2.0
func (s *Subscription) TakeMessage(out Message) (*MessageInfo, error)
func (*Subscription) TakeSerializedMessage ¶ added in v0.2.0
func (s *Subscription) TakeSerializedMessage() ([]byte, *MessageInfo, error)
TakeSerializedMessage takes a message without deserializing it and returns it as a byte slice.
type SubscriptionCallback ¶ added in v0.2.0
type SubscriptionCallback func(*Subscription)
type SubscriptionInvalid ¶ added in v0.2.0
type SubscriptionInvalid struct {
// contains filtered or unexported fields
}
SubscriptionInvalid rcl subscription specific ret codes in 4XXInvalid rcl_subscription_t given return code.
type SubscriptionOptions ¶ added in v0.2.0
type SubscriptionOptions struct {
Qos QosProfile
}
func NewDefaultSubscriptionOptions ¶ added in v0.2.0
func NewDefaultSubscriptionOptions() *SubscriptionOptions
type SubscriptionTakeFailed ¶ added in v0.2.0
type SubscriptionTakeFailed struct {
// contains filtered or unexported fields
}
SubscriptionTakeFailed Failed to take a message from the subscription return code.
type Timer ¶ added in v0.2.0
type Timer struct {
Callback func(*Timer)
// contains filtered or unexported fields
}
func (*Timer) GetTimeUntilNextCall ¶ added in v0.2.0
type TimerCanceled ¶ added in v0.2.0
type TimerCanceled struct {
// contains filtered or unexported fields
}
TimerCanceled Given timer was canceled return code.
type TimerInvalid ¶ added in v0.2.0
type TimerInvalid struct {
// contains filtered or unexported fields
}
TimerInvalid rcl timer specific ret codes in 8XXInvalid rcl_timer_t given return code.
type TopicEndpointInfo ¶ added in v0.2.0
type TopicEndpointInfo struct {
NodeName string
NodeNamespace string
TopicType string
EndpointType EndpointType
EndpointGID GID
QosProfile QosProfile
}
type TopicNameInvalid ¶ added in v0.2.0
type TopicNameInvalid struct {
// contains filtered or unexported fields
}
TopicNameInvalid Topic name does not pass validation.
type UnknownReturnCode ¶ added in v0.2.0
type UnknownReturnCode struct {
// contains filtered or unexported fields
}
type UnknownSubstitution ¶ added in v0.2.0
type UnknownSubstitution struct {
// contains filtered or unexported fields
}
UnknownSubstitution Topic name substitution is unknown.
type Unsupported ¶ added in v0.2.0
type Unsupported = RmwUnsupported
Unsupported Unsupported return code.
type WaitSet ¶ added in v0.2.0
type WaitSet struct {
Subscriptions []*Subscription
Timers []*Timer
Services []*Service
Clients []*Client
ActionClients []*ActionClient
ActionServers []*ActionServer
// contains filtered or unexported fields
}
func NewWaitSet ¶ added in v0.2.0
func (*WaitSet) AddActionClients ¶ added in v0.2.0
func (w *WaitSet) AddActionClients(clients ...*ActionClient)
func (*WaitSet) AddActionServers ¶ added in v0.2.0
func (w *WaitSet) AddActionServers(servers ...*ActionServer)
func (*WaitSet) AddClients ¶ added in v0.2.0
func (*WaitSet) AddServices ¶ added in v0.2.0
func (*WaitSet) AddSubscriptions ¶ added in v0.2.0
func (w *WaitSet) AddSubscriptions(subs ...*Subscription)
type WaitSetEmpty ¶ added in v0.2.0
type WaitSetEmpty struct {
// contains filtered or unexported fields
}
WaitSetEmpty Given rcl_wait_set_t is empty return code.
type WaitSetFull ¶ added in v0.2.0
type WaitSetFull struct {
// contains filtered or unexported fields
}
WaitSetFull Given rcl_wait_set_t is full return code.
type WaitSetInvalid ¶ added in v0.2.0
type WaitSetInvalid struct {
// contains filtered or unexported fields
}
WaitSetInvalid rcl wait and wait set specific ret codes in 9XXInvalid rcl_wait_set_t given return code.
type WrongLexeme ¶ added in v0.2.0
type WrongLexeme struct {
// contains filtered or unexported fields
}
WrongLexeme Expected one type of lexeme but got another