rosrustext_rosrs
rclrs extension layer that targets tool parity (ROS-facing behavior) and user parity (developer ergonomics) for ROS 2 features, centered on the ROS-facing adapter and application-facing APIs.
Extension areas and status
| Area | Tool parity | User parity |
|---|---|---|
| Lifecycle | Implemented (services/events/bond/gating) | Partial (gaps documented) |
| Parameters | Implemented (services/events) | Partial (watcher; no set-time validation hook) |
| Actions | Not implemented | Not implemented |
| Executor | Not implemented | Not implemented |
Lifecycle parity (implemented)
- Lifecycle services:
change_state,get_state,get_available_states,get_available_transitions transition_eventpublisher (one per accepted attempt, after completion)- Optional
/bondheartbeats for Nav2 compatibility (featurebond) - ManagedPublisher/ManagedTimer gating while inactive (local suppression)
See docs/adapters/ros2rust/lifecycle/parity.md for tool vs user parity details.
Parameters parity (implemented baseline)
- Parameter services:
get_parameters,get_parameter_types,list_parameters,describe_parameters,set_parameters,set_parameters_atomically parameter_eventspublisher (emitted on successful updates only)ParameterWatcherhelper for event-driven updates without polling- No set-time validation hook (updates are observable after apply)
See docs/adapters/ros2rust/parameters/parity.md for tool vs user parity details.
Compatibility / Parity Notes
- Parameters parity uses
rclrs::vendor::rcl_interfacesforParameterEventand parameter services. - This couples the adapter to
rclrs0.6.x (androsidl_runtime_rs0.5.x transitively). - This is an implementation detail dependency; if
rclrschanges the vendored surface, we will pin/update accordingly.
Known differences vs rclcpp
change_statereturnssuccess=trueonce a transition is accepted; callback outcome is reflected in the final state andtransition_event.
Publish outcome visibility
Use publish_with_outcome() when you need to know whether a message was
suppressed due to lifecycle inactivity. publish() remains silent and returns
Ok(()) either way.
use ;
match publisher.publish_with_outcome?
Lifecycle user parity gaps (current)
- No set/replace callbacks API;
create/try_newstill default to no-op callbacks
Other extensions (not implemented)
- Actions parity
- Executor extensions
Build (ROS installed)
This crate is published on crates.io, but building requires ROS 2 and ROS message crates available via a ROS workspace environment (Cargo patching is typical).
Docs build on docs.rs without ROS (feature docsrs + rclrs/use_ros_shim).
Runtime builds/tests require ROS 2 Jazzy with the environment sourced.
Feature matrix
ros2: enables ROS-facing tooling parity (parameter services/events and lifecycle services) and relies onrclrs::vendor::rcl_interfaces.bond: publishes/bondheartbeats for Nav2 lifecycle manager compatibility (requiresros2).lifecycle_msgs: exposes lifecycle message/service surfaces; no hidden deps.docsrs: docs.rs-only shim for ROS-free builds; not intended for users.
Example commands (Jazzy)
# Expect the current stable state (Unconfigured/Inactive/Active/Finalized)
# success=true; a transition_event is published after completion
# success=true; /bond heartbeats begin if `bond` is enabled
Minimal usage
Recommended constructor: LifecycleNode::create_with_callbacks.
use ;
use ;
use State;
;
Builder APIs (managed vs raw)
Managed (lifecycle-gated):
use ;
use LifecycleNode;
use State;
Raw (non-managed):
use ;
use NodeBuilderExt;
use State;