humble

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DurationInfinite    = 9223372036*time.Second + 854775807*time.Nanosecond
	DurationUnspecified = time.Duration(0)
)
View Source
const DeadlineDefault = DurationUnspecified
View Source
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.

View Source
const GIDSize = 24
View Source
const GoalIDLen = 16
View Source
const LifespanDefault = DurationUnspecified
View Source
const LivelinessLeaseDurationDefault = DurationUnspecified

Variables

This section is empty.

Functions

func BoolArrayToC

func BoolArrayToC(cSlice []CBool, goSlice []bool)

func BoolArrayToGo

func BoolArrayToGo(goSlice []bool, cSlice []CBool)

func BoolSequenceToC

func BoolSequenceToC(cSlice *CBoolSequence, goSlice []bool)

func BoolSequenceToGo

func BoolSequenceToGo(goSlice *[]bool, cSlice CBoolSequence)

func ByteArrayToC

func ByteArrayToC(cSlice []CByte, goSlice []byte)

func ByteArrayToGo

func ByteArrayToGo(goSlice []byte, cSlice []CByte)

func ByteSequenceToC

func ByteSequenceToC(cSlice *CByteSequence, goSlice []byte)

func ByteSequenceToGo

func ByteSequenceToGo(goSlice *[]byte, cSlice CByteSequence)

func CharArrayToC

func CharArrayToC(cSlice []CChar, goSlice []byte)

func CharArrayToGo

func CharArrayToGo(goSlice []byte, cSlice []CChar)

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 Float32ArrayToC(cSlice []CFloat32, goSlice []float32)

func Float32ArrayToGo

func Float32ArrayToGo(goSlice []float32, cSlice []CFloat32)

func Float32SequenceToC

func Float32SequenceToC(cSlice *CFloat32Sequence, goSlice []float32)

func Float32SequenceToGo

func Float32SequenceToGo(goSlice *[]float32, cSlice CFloat32Sequence)

func Float64ArrayToC

func Float64ArrayToC(cSlice []CFloat64, goSlice []float64)

func Float64ArrayToGo

func Float64ArrayToGo(goSlice []float64, cSlice []CFloat64)

func Float64SequenceToC

func Float64SequenceToC(cSlice *CFloat64Sequence, goSlice []float64)

func Float64SequenceToGo

func Float64SequenceToGo(goSlice *[]float64, cSlice CFloat64Sequence)

func Init added in v0.2.0

func Init(args *Args) (err error)

Init is like InitWithOpts except that it always uses default options.

func InitLogging added in v0.2.0

func InitLogging(args *Args) error

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 Int8ArrayToC(cSlice []CInt8, goSlice []int8)

func Int8ArrayToGo

func Int8ArrayToGo(goSlice []int8, cSlice []CInt8)

func Int8SequenceToC

func Int8SequenceToC(cSlice *CInt8Sequence, goSlice []int8)

func Int8SequenceToGo

func Int8SequenceToGo(goSlice *[]int8, cSlice CInt8Sequence)

func Int16ArrayToC

func Int16ArrayToC(cSlice []CInt16, goSlice []int16)

func Int16ArrayToGo

func Int16ArrayToGo(goSlice []int16, cSlice []CInt16)

func Int16SequenceToC

func Int16SequenceToC(cSlice *CInt16Sequence, goSlice []int16)

func Int16SequenceToGo

func Int16SequenceToGo(goSlice *[]int16, cSlice CInt16Sequence)

func Int32ArrayToC

func Int32ArrayToC(cSlice []CInt32, goSlice []int32)

func Int32ArrayToGo

func Int32ArrayToGo(goSlice []int32, cSlice []CInt32)

func Int32SequenceToC

func Int32SequenceToC(cSlice *CInt32Sequence, goSlice []int32)

func Int32SequenceToGo

func Int32SequenceToGo(goSlice *[]int32, cSlice CInt32Sequence)

func Int64ArrayToC

func Int64ArrayToC(cSlice []CInt64, goSlice []int64)

func Int64ArrayToGo

func Int64ArrayToGo(goSlice []int64, cSlice []CInt64)

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 Serialize added in v0.2.0

func Serialize(msg Message) (buf []byte, err error)

Serialize returns the serialized form of msg as a byte slice.

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

func Spin(ctx context.Context) error

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 StringArrayToC(cSlice []CString, goSlice []string)

func StringArrayToGo

func StringArrayToGo(goSlice []string, cSlice []CString)

func StringAsCStruct

func StringAsCStruct(dst unsafe.Pointer, m string)

func StringAsGoStruct

func StringAsGoStruct(m *string, ros2MessageBuffer unsafe.Pointer)

func StringSequenceToC

func StringSequenceToC(cSlice *CStringSequence, goSlice []string)

func StringSequenceToGo

func StringSequenceToGo(goSlice *[]string, cSlice CStringSequence)

func U16StringAsCStruct

func U16StringAsCStruct(dst unsafe.Pointer, m string)

func U16StringAsGoStruct

func U16StringAsGoStruct(msg *string, ros2MessageBuffer unsafe.Pointer)

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 Uint8ArrayToC(cSlice []CUint8, goSlice []uint8)

func Uint8ArrayToGo

func Uint8ArrayToGo(goSlice []uint8, cSlice []CUint8)

func Uint8SequenceToC

func Uint8SequenceToC(cSlice *CUint8Sequence, goSlice []uint8)

func Uint8SequenceToGo

func Uint8SequenceToGo(goSlice *[]uint8, cSlice CUint8Sequence)

func Uint16ArrayToC

func Uint16ArrayToC(cSlice []CUint16, goSlice []uint16)

func Uint16ArrayToGo

func Uint16ArrayToGo(goSlice []uint16, cSlice []CUint16)

func Uint16SequenceToC

func Uint16SequenceToC(cSlice *CUint16Sequence, goSlice []uint16)

func Uint16SequenceToGo

func Uint16SequenceToGo(goSlice *[]uint16, cSlice CUint16Sequence)

func Uint32ArrayToC

func Uint32ArrayToC(cSlice []CUint32, goSlice []uint32)

func Uint32ArrayToGo

func Uint32ArrayToGo(goSlice []uint32, cSlice []CUint32)

func Uint32SequenceToC

func Uint32SequenceToC(cSlice *CUint32Sequence, goSlice []uint32)

func Uint32SequenceToGo

func Uint32SequenceToGo(goSlice *[]uint32, cSlice CUint32Sequence)

func Uint64ArrayToC

func Uint64ArrayToC(cSlice []CUint64, goSlice []uint64)

func Uint64ArrayToGo

func Uint64ArrayToGo(goSlice []uint64, cSlice []CUint64)

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

func (c *ActionClient) CancelGoal(ctx context.Context, request Message) (Message, error)

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

func (c *ActionClient) GetResult(ctx context.Context, goalID *GoalID) (Message, error)

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

func (c *ActionClient) SendGoal(ctx context.Context, goal Message) (Message, *GoalID, error)

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

func (c *ActionClient) SendGoalRequest(ctx context.Context, request Message) (Message, error)

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.

func (*ActionClientInvalid) Error added in v0.2.0

func (e *ActionClientInvalid) Error() string

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.

func (*ActionClientTakeFailed) Error added in v0.2.0

func (e *ActionClientTakeFailed) Error() string

type ActionGoalAccepted added in v0.2.0

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

ActionGoalAccepted Action goal accepted return code.

func (*ActionGoalAccepted) Error added in v0.2.0

func (e *ActionGoalAccepted) Error() string

type ActionGoalEventInvalid added in v0.2.0

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

ActionGoalEventInvalid Action invalid event return code.

func (*ActionGoalEventInvalid) Error added in v0.2.0

func (e *ActionGoalEventInvalid) Error() string

type ActionGoalHandleInvalid added in v0.2.0

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

ActionGoalHandleInvalid Action goal handle invalid return code.

func (*ActionGoalHandleInvalid) Error added in v0.2.0

func (e *ActionGoalHandleInvalid) Error() string

type ActionGoalRejected added in v0.2.0

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

ActionGoalRejected Action goal rejected return code.

func (*ActionGoalRejected) Error added in v0.2.0

func (e *ActionGoalRejected) Error() string

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.

func (*ActionNameInvalid) Error added in v0.2.0

func (e *ActionNameInvalid) Error() string

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.

func (*ActionServerInvalid) Error added in v0.2.0

func (e *ActionServerInvalid) Error() string

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.

func (*ActionServerTakeFailed) Error added in v0.2.0

func (e *ActionServerTakeFailed) Error() string

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.

func (*AlreadyInit) Error added in v0.2.0

func (e *AlreadyInit) Error() string

type AlreadyShutdown added in v0.2.0

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

AlreadyShutdown rcl_shutdown() already called return code.

func (*AlreadyShutdown) Error added in v0.2.0

func (e *AlreadyShutdown) Error() string

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

func ParseArgs(args []string) (*Args, []string, error)

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.

func (*Args) String added in v0.2.0

func (a *Args) String() string

type BadAlloc added in v0.2.0

type BadAlloc = RmwBadAlloc

BadAlloc Failed to allocate memory return code.

type CBool

type CBool = C.bool

Bool

type CByte

type CByte = C.uint8_t

Byte

type CChar

type CChar = C.schar

type CFloat32

type CFloat32 = C.float

Float32

type CFloat64

type CFloat64 = C.double

Float64

type CInt8

type CInt8 = C.int8_t

Int8

type CInt16

type CInt16 = C.int16_t

Int16

type CInt32

type CInt32 = C.int32_t

Int32

type CInt64

type CInt64 = C.int64_t

Int64

type CString

type CString = C.rosidl_runtime_c__String

type CU16String

type CU16String = C.rosidl_runtime_c__U16String

type CUint8

type CUint8 = C.uint8_t

Uint8

type CUint16

type CUint16 = C.uint16_t

Uint16

type CUint32

type CUint32 = C.uint32_t

Uint32

type CUint64

type CUint64 = C.uint64_t

Uint64

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.

func (*Client) Close added in v0.2.0

func (c *Client) Close() error

func (*Client) Node added in v0.2.0

func (c *Client) Node() *Node

Node returns the node c belongs to.

func (*Client) Send added in v0.2.0

func (c *Client) Send(ctx context.Context, req Message) (Message, *ServiceInfo, error)

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.

func (*ClientInvalid) Error added in v0.2.0

func (e *ClientInvalid) Error() string

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.

func (*ClientTakeFailed) Error added in v0.2.0

func (e *ClientTakeFailed) Error() string

type Clock added in v0.2.0

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

func NewClock added in v0.2.0

func NewClock(clockType ClockType) (*Clock, error)

func (*Clock) Close added in v0.2.0

func (c *Clock) Close() (err error)

Close frees the allocated memory

func (*Clock) Context added in v0.2.0

func (c *Clock) Context() *Context

Context returns the context c belongs to.

type ClockType added in v0.2.0

type ClockType uint32
const (
	ClockTypeUninitialized ClockType = 0
	ClockTypeROSTime       ClockType = 1
	ClockTypeSystemTime    ClockType = 2
	ClockTypeSteadyTime    ClockType = 3
)

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

func NewContext(clockType ClockType, rclArgs *Args) (*Context, error)

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) Clock added in v0.2.0

func (c *Context) Clock() *Clock

func (*Context) Close added in v0.2.0

func (c *Context) Close() error

func (*Context) NewClock added in v0.2.0

func (c *Context) NewClock(clockType ClockType) (clock *Clock, err error)

func (*Context) NewNode added in v0.2.0

func (c *Context) NewNode(nodeName, namespace string) (node *Node, err error)

func (*Context) NewTimer added in v0.2.0

func (c *Context) NewTimer(timeout time.Duration, timerCallback func(*Timer)) (timer *Timer, err error)

func (*Context) NewWaitSet added in v0.2.0

func (c *Context) NewWaitSet() (ws *WaitSet, err error)

func (*Context) SetClock added in v0.2.0

func (c *Context) SetClock(newClock *Clock)

func (*Context) Spin added in v0.2.0

func (c *Context) Spin(ctx context.Context) error

Spin starts and waits for all ROS resources in the context that need waiting such as nodes and subscriptions. Spin returns when an error occurs or ctx is canceled.

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 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 Error added in v0.2.0

type Error = RmwError

Error Unspecified error return code.

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.

func (*EventInvalid) Error added in v0.2.0

func (e *EventInvalid) Error() string

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

func (*EventTakeFailed) Error added in v0.2.0

func (e *EventTakeFailed) Error() string

type ExecuteGoalFunc added in v0.2.0

type ExecuteGoalFunc = func(context.Context, *GoalHandle) (Message, error)

type FeedbackHandler added in v0.2.0

type FeedbackHandler func(context.Context, Message)

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 GID added in v0.2.0

type GID [GIDSize]byte

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 GoalID added in v0.2.0

type GoalID [GoalIDLen]byte

func (*GoalID) String added in v0.2.0

func (id *GoalID) String() string

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

func (*InvalidLogLevelRule) Error added in v0.2.0

func (e *InvalidLogLevelRule) Error() string

type InvalidParamRule added in v0.2.0

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

InvalidParamRule Argument is not a valid parameter rule

func (*InvalidParamRule) Error added in v0.2.0

func (e *InvalidParamRule) Error() string

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

func (*InvalidRemapRule) Error added in v0.2.0

func (e *InvalidRemapRule) Error() string

type InvalidRosArgs added in v0.2.0

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

InvalidRosArgs Found invalid ros argument while parsing

func (*InvalidRosArgs) Error added in v0.2.0

func (e *InvalidRosArgs) Error() string

type LifecycleStateNotRegistered added in v0.2.0

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

LifecycleStateNotRegistered rcl_lifecycle state not registered

func (*LifecycleStateNotRegistered) Error added in v0.2.0

func (e *LifecycleStateNotRegistered) Error() string

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

func (*LifecycleStateRegistered) Error added in v0.2.0

func (e *LifecycleStateRegistered) Error() string

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

func GetLogger(name string) *Logger

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

func (l *Logger) Child(name string) *Logger

Child returns the child logger of l named name. Returns nil if name is invalid.

func (*Logger) Debug added in v0.2.0

func (l *Logger) Debug(a ...interface{}) error

func (*Logger) Debugf added in v0.2.0

func (l *Logger) Debugf(format string, a ...interface{}) error

func (*Logger) Debugln added in v0.2.0

func (l *Logger) Debugln(a ...interface{}) error

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) Error added in v0.2.0

func (l *Logger) Error(a ...interface{}) error

func (*Logger) Errorf added in v0.2.0

func (l *Logger) Errorf(format string, a ...interface{}) error

func (*Logger) Errorln added in v0.2.0

func (l *Logger) Errorln(a ...interface{}) error

func (*Logger) Fatal added in v0.2.0

func (l *Logger) Fatal(a ...interface{}) error

func (*Logger) Fatalf added in v0.2.0

func (l *Logger) Fatalf(format string, a ...interface{}) error

func (*Logger) Fatalln added in v0.2.0

func (l *Logger) Fatalln(a ...interface{}) error

func (*Logger) Info added in v0.2.0

func (l *Logger) Info(a ...interface{}) error

func (*Logger) Infof added in v0.2.0

func (l *Logger) Infof(format string, a ...interface{}) error

func (*Logger) Infoln added in v0.2.0

func (l *Logger) Infoln(a ...interface{}) error

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) Name added in v0.2.0

func (l *Logger) Name() string

func (*Logger) Parent added in v0.2.0

func (l *Logger) Parent() *Logger

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.

func (*Logger) Warn added in v0.2.0

func (l *Logger) Warn(a ...interface{}) error

func (*Logger) Warnf added in v0.2.0

func (l *Logger) Warnf(format string, a ...interface{}) error

func (*Logger) Warnln added in v0.2.0

func (l *Logger) Warnln(a ...interface{}) error

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 MessageInfo struct {
	SourceTimestamp   time.Time
	ReceivedTimestamp time.Time
	FromIntraProcess  bool
}

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.

func (*MismatchedRmwId) Error added in v0.2.0

func (e *MismatchedRmwId) Error() string

type Node added in v0.2.0

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

func NewNode added in v0.2.0

func NewNode(nodeName, namespace string) (*Node, error)

func (*Node) Close added in v0.2.0

func (n *Node) Close() error

Close frees the allocated memory

func (*Node) Context added in v0.2.0

func (n *Node) Context() *Context

Context returns the context n belongs to.

func (*Node) FullyQualifiedName added in v0.2.0

func (n *Node) FullyQualifiedName() string

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 (n *Node) GetActionClientNamesAndTypesByNode(node, namespace string) (map[string][]string, error)

func (*Node) GetActionServerNamesAndTypesByNode added in v0.2.0

func (n *Node) GetActionServerNamesAndTypesByNode(node, namespace string) (map[string][]string, error)

func (*Node) GetClientNamesAndTypesByNode added in v0.2.0

func (n *Node) GetClientNamesAndTypesByNode(node, namespace string) (map[string][]string, error)

func (*Node) GetNodeNames added in v0.2.0

func (n *Node) GetNodeNames() (names, namespaces []string, err error)

func (*Node) GetPublisherNamesAndTypesByNode added in v0.2.0

func (n *Node) GetPublisherNamesAndTypesByNode(demangle bool, node, namespace string) (map[string][]string, error)

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 (n *Node) GetServiceNamesAndTypesByNode(node, namespace string) (map[string][]string, error)

func (*Node) GetSubscriberNamesAndTypesByNode added in v0.2.0

func (n *Node) GetSubscriberNamesAndTypesByNode(demangle bool, node, namespace string) (map[string][]string, error)

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

func (n *Node) GetTopicNamesAndTypes(demangle bool) (map[string][]string, error)

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) Logger added in v0.2.0

func (n *Node) Logger() *Logger

Logger returns the logger associated with n.

func (*Node) Name added in v0.2.0

func (n *Node) Name() string

Name returns the name of n.

func (*Node) Namespace added in v0.2.0

func (n *Node) Namespace() string

Namespace returns the namespace of n.

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.

func (*Node) Spin added in v0.2.0

func (n *Node) Spin(ctx context.Context) error

Spin starts and waits for all ROS resources in the node that need waiting such as subscriptions. Spin returns when an error occurs or ctx is canceled.

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.

func (*NodeInvalid) Error added in v0.2.0

func (e *NodeInvalid) Error() string

type NodeInvalidName added in v0.2.0

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

NodeInvalidName Invalid node name return code.

func (*NodeInvalidName) Error added in v0.2.0

func (e *NodeInvalidName) Error() string

type NodeInvalidNamespace added in v0.2.0

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

NodeInvalidNamespace Invalid node namespace return code.

func (*NodeInvalidNamespace) Error added in v0.2.0

func (e *NodeInvalidNamespace) Error() string

type NodeNameNonExistent added in v0.2.0

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

NodeNameNonExistent Failed to find node name

func (*NodeNameNonExistent) Error added in v0.2.0

func (e *NodeNameNonExistent) Error() string

type NotInit added in v0.2.0

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

NotInit rcl_init() not yet called return code.

func (*NotInit) Error added in v0.2.0

func (e *NotInit) Error() string

type Ok added in v0.2.0

type Ok = RmwOk

Ok Success return code.

type Publisher added in v0.2.0

type Publisher struct {
	TopicName string
	// contains filtered or unexported fields
}

func (*Publisher) Close added in v0.2.0

func (p *Publisher) Close() (err error)

Close frees the allocated memory

func (*Publisher) GetSubscriptionCount added in v0.2.0

func (p *Publisher) GetSubscriptionCount() (int, error)

GetSubscriptionCount returns the number of subscriptions matched to p.

func (*Publisher) Node added in v0.2.0

func (p *Publisher) Node() *Node

Node returns the node p belongs to.

func (*Publisher) Publish added in v0.2.0

func (p *Publisher) Publish(ros2msg Message) error

func (*Publisher) PublishSerialized added in v0.2.0

func (p *Publisher) PublishSerialized(msg []byte) error

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.

func (*PublisherInvalid) Error added in v0.2.0

func (e *PublisherInvalid) Error() string

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 RequestID added in v0.2.0

type RequestID struct {
	WriterGUID     [16]int8
	SequenceNumber int64
}

type RmwBadAlloc added in v0.2.0

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

RmwBadAlloc Failed to allocate memory

func (*RmwBadAlloc) Error added in v0.2.0

func (e *RmwBadAlloc) Error() string

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

func (*RmwError) Error added in v0.2.0

func (e *RmwError) Error() string

type RmwIncorrectRmwImplementation added in v0.2.0

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

RmwIncorrectRmwImplementation Incorrect rmw implementation.

func (*RmwIncorrectRmwImplementation) Error added in v0.2.0

func (e *RmwIncorrectRmwImplementation) Error() string

type RmwInvalidArgument added in v0.2.0

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

RmwInvalidArgument Argument to function was invalid

func (*RmwInvalidArgument) Error added in v0.2.0

func (e *RmwInvalidArgument) Error() string

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

func (*RmwNodeNameNonExistent) Error added in v0.2.0

func (e *RmwNodeNameNonExistent) Error() string

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

func (*RmwOk) Error added in v0.2.0

func (e *RmwOk) Error() string

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

func (*RmwTimeout) Error added in v0.2.0

func (e *RmwTimeout) Error() string

type RmwUnsupported added in v0.2.0

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

RmwUnsupported The operation or event handling is not supported.

func (*RmwUnsupported) Error added in v0.2.0

func (e *RmwUnsupported) Error() string

type Service added in v0.2.0

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

func (*Service) Close added in v0.2.0

func (s *Service) Close() (err error)

func (*Service) Node added in v0.2.0

func (s *Service) Node() *Node

Node returns the node s belongs to.

type ServiceInfo added in v0.2.0

type ServiceInfo struct {
	SourceTimestamp   time.Time
	ReceivedTimestamp time.Time
	RequestID         RequestID
}

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.

func (*ServiceInvalid) Error added in v0.2.0

func (e *ServiceInvalid) Error() string

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.

func (*ServiceNameInvalid) Error added in v0.2.0

func (e *ServiceNameInvalid) Error() string

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 ServiceResponseSender interface {
	SendResponse(resp Message) error
}

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.

func (*ServiceTakeFailed) Error added in v0.2.0

func (e *ServiceTakeFailed) Error() string

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 StatusHandler func(context.Context, Message)

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.

func (*SubscriptionInvalid) Error added in v0.2.0

func (e *SubscriptionInvalid) Error() string

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.

func (*SubscriptionTakeFailed) Error added in v0.2.0

func (e *SubscriptionTakeFailed) Error() string

type Timeout added in v0.2.0

type Timeout = RmwTimeout

Timeout Timeout occurred return code.

type Timer added in v0.2.0

type Timer struct {
	Callback func(*Timer)
	// contains filtered or unexported fields
}

func NewTimer added in v0.2.0

func NewTimer(timeout time.Duration, timerCallback func(*Timer)) (*Timer, error)

func (*Timer) Close added in v0.2.0

func (t *Timer) Close() (err error)

Close frees the allocated memory

func (*Timer) Context added in v0.2.0

func (t *Timer) Context() *Context

Context returns the context t belongs to.

func (*Timer) GetTimeUntilNextCall added in v0.2.0

func (t *Timer) GetTimeUntilNextCall() (int64, error)

func (*Timer) Reset added in v0.2.0

func (t *Timer) Reset() error

type TimerCanceled added in v0.2.0

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

TimerCanceled Given timer was canceled return code.

func (*TimerCanceled) Error added in v0.2.0

func (e *TimerCanceled) Error() string

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.

func (*TimerInvalid) Error added in v0.2.0

func (e *TimerInvalid) Error() string

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.

func (*TopicNameInvalid) Error added in v0.2.0

func (e *TopicNameInvalid) Error() string

type UnknownReturnCode added in v0.2.0

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

func (*UnknownReturnCode) Error added in v0.2.0

func (e *UnknownReturnCode) Error() string

type UnknownSubstitution added in v0.2.0

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

UnknownSubstitution Topic name substitution is unknown.

func (*UnknownSubstitution) Error added in v0.2.0

func (e *UnknownSubstitution) Error() string

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 NewWaitSet() (*WaitSet, error)

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 (w *WaitSet) AddClients(clients ...*Client)

func (*WaitSet) AddServices added in v0.2.0

func (w *WaitSet) AddServices(services ...*Service)

func (*WaitSet) AddSubscriptions added in v0.2.0

func (w *WaitSet) AddSubscriptions(subs ...*Subscription)

func (*WaitSet) AddTimers added in v0.2.0

func (w *WaitSet) AddTimers(timers ...*Timer)

func (*WaitSet) Close added in v0.2.0

func (w *WaitSet) Close() (err error)

Close frees the allocated memory

func (*WaitSet) Context added in v0.2.0

func (w *WaitSet) Context() *Context

Context returns the context s belongs to.

func (*WaitSet) Run added in v0.2.0

func (w *WaitSet) Run(ctx context.Context) (err error)

Run causes the current goroutine to block on this given WaitSet. WaitSet executes the given timers and subscriptions and calls their callbacks on new events.

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.

func (*WaitSetEmpty) Error added in v0.2.0

func (e *WaitSetEmpty) Error() string

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.

func (*WaitSetFull) Error added in v0.2.0

func (e *WaitSetFull) Error() string

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.

func (*WaitSetInvalid) Error added in v0.2.0

func (e *WaitSetInvalid) Error() string

type WrongLexeme added in v0.2.0

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

WrongLexeme Expected one type of lexeme but got another

func (*WrongLexeme) Error added in v0.2.0

func (e *WrongLexeme) Error() string

Jump to

Keyboard shortcuts

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