Crate rclrs

Source
Expand description

Rust client library for ROS 2.

For getting started, see the README.

Structs§

AvailableValues
This struct is given to the discriminator function of the ParameterBuilder so it knows what values are available to choose from.
Client
Main class responsible for sending requests to a ROS service.
ClientHandle
Internal struct used by clients.
Clock
Struct that implements a Clock and wraps rcl_clock_t.
ClockSource
A clock source that can be used to drive the contained clock. Created when a clock of type ClockType::RosTime is constructed
Context
Shared state between nodes and similar entities.
GuardCondition
A waitable entity used for waking up a wait set manually.
LoanedMessage
A message that is owned by the middleware, loaned for publishing.
MandatoryParameter
A parameter that must have a value This struct has ownership of the declared parameter. Additional parameter declaration will fail while this struct exists and the parameter will be undeclared when it is dropped.
MessageInfo
Additional information about a received message.
Node
A processing unit that can communicate with other nodes.
NodeBuilder
A builder for creating a Node.
NodeNameInfo
Stores a node’s name and namespace
OptionalParameter
A parameter that might not have a value, represented by Option<T>. This struct has ownership of the declared parameter. Additional parameter declaration will fail while this struct exists and the parameter will be undeclared when it is dropped.
ParameterBuilder
Builder used to declare a parameter. Obtain this by calling crate::Node::declare_parameter.
ParameterOptions
Options that can be attached to a parameter, such as description, ranges. Some of this data will be used to populate the ParameterDescriptor
ParameterRange
Describes the range for paramter type T.
ParameterRanges
Contains all the possible type of ranges that can be applied to a value. Usually only one of these ranges will be applied, but all have to be stored since:
Parameters
Allows access to all parameters via get / set functions, using their name as a key.
Publisher
Struct for sending messages of type T.
PublisherGid
An identifier for a publisher in the local context.
QoSProfile
A Quality of Service profile.
RclErrorMsg
Struct encapsulating an error message from the rcl layer or below.
ReadOnlyLoanedMessage
A message that is owned by the middleware, loaned out for reading.
ReadOnlyParameter
A parameter that must have a value and cannot be written to This struct has ownership of the declared parameter. Additional parameter declaration will fail while this struct exists and the parameter will be undeclared when it is dropped.
ReadyEntities
A list of entities that are ready, returned by WaitSet::wait.
Service
Main class responsible for responding to requests sent by ROS clients.
ServiceHandle
Internal struct used by services.
SingleThreadedExecutor
Single-threaded executor implementation.
Subscription
Struct for receiving messages of type T.
SubscriptionHandle
Internal struct used by subscriptions.
Time
Struct that represents time.
TopicEndpointInfo
Contains topic endpoint information
WaitSet
A struct for waiting on subscriptions and other waitable entities to become ready.
rmw_request_id_t

Enums§

AnySubscriptionCallback
An enum capturing the various possible function signatures for subscription callbacks.
ClockType
Enum to describe clock type. Redefined for readability and to eliminate the uninitialized case from the rcl_clock_type_t enum in the binding.
DeclarationError
Error that can be generated when doing operations on parameters.
ParameterKind
Describes the parameter’s type. Similar to ParameterValue but also includes a Dynamic variant for dynamic parameters.
ParameterValue
A parameter value.
ParameterValueError
Describes errors that can be generated when trying to set a parameter’s value.
QoSDurabilityPolicy
The DURABILITY DDS QoS policy.
QoSDuration
A duration that can take two special values: System default and infinite.
QoSHistoryPolicy
The HISTORY DDS QoS policy.
QoSLivelinessPolicy
The LIVELINESS DDS QoS policy.
QoSReliabilityPolicy
The RELIABILITY DDS QoS policy.
RclReturnCode
Return codes of rcl functions.
RclrsError
The main error type.

Constants§

QOS_PROFILE_CLOCK
Equivalent to ClockQos from the rclcpp package. Same as sensor data but with a history depth of 1
QOS_PROFILE_DEFAULT
Equivalent to rmw_qos_profile_default from the rmw package.
QOS_PROFILE_PARAMETERS
Equivalent to rmw_qos_profile_parameters from the rmw package.
QOS_PROFILE_PARAMETER_EVENTS
Equivalent to rmw_qos_profile_parameter_events from the rmw package.
QOS_PROFILE_SENSOR_DATA
Equivalent to rmw_qos_profile_sensor_data from the rmw package.
QOS_PROFILE_SERVICES_DEFAULT
Equivalent to rmw_qos_profile_services_default from the rmw package.
QOS_PROFILE_SYSTEM_DEFAULT
Equivalent to rmw_qos_profile_system_default from the rmw package.

Traits§

ClientBase
Trait to be implemented by concrete Client structs.
MessageCow
Convenience trait for Publisher::publish.
ParameterVariant
A trait that describes a value that can be converted into a parameter.
ServiceBase
Trait to be implemented by concrete Service structs.
SubscriptionBase
Trait to be implemented by concrete Subscriptions.
SubscriptionCallback
A trait for allowed callbacks for subscriptions.

Functions§

create_node
Creates a new node in the empty namespace.
create_node_builder
Creates a NodeBuilder.
default_initial_value_discriminator
The default discriminator that chooses the initial value for a parameter. The implementation here uses a simple preference of
extract_non_ros_args
Extract non-ROS arguments from program’s input arguments.
spin
Convenience function for calling spin_once in a loop.
spin_once
Polls the node for new messages and executes the corresponding callbacks.

Type Aliases§

TopicNamesAndTypes
Stores a list of types associated with each topic.