@@ -31,7 +31,7 @@ pub trait SequenceAlloc: Sized {
31
31
fn sequence_copy ( in_seq : & crate :: Sequence < Self > , out_seq : & mut crate :: Sequence < Self > ) -> bool ;
32
32
}
33
33
34
- /// Trait for RMW-compatible messages.
34
+ /// Trait for RMW-native messages.
35
35
///
36
36
/// See the documentation for the [`Message`] trait, which is the trait that should generally be
37
37
/// used by user code.
@@ -46,22 +46,22 @@ pub trait RmwMessage: Clone + Debug + Default {
46
46
///
47
47
/// `rosidl_generator_rs` generates two types of messages that implement this trait:
48
48
/// - An "idiomatic" message type, in the `${package_name}::msg` module
49
- /// - An "RMW-compatible " message type, in the `${package_name}::msg::rmw` module
49
+ /// - An "RMW-native " message type, in the `${package_name}::msg::rmw` module
50
50
///
51
51
/// # Idiomatic message type
52
52
/// The idiomatic message type aims to be familiar to Rust developers and ROS 2 developers coming
53
53
/// from `rclcpp`.
54
54
/// To this end, it translates the original ROS 2 message into a version that uses idiomatic Rust
55
55
/// structs: [`std::vec::Vec`] for sequences and [`std::string::String`] for strings. All other
56
- /// fields are the same as in an RMW-compatible message.
56
+ /// fields are the same as in an RMW-native message.
57
57
///
58
58
/// This conversion incurs some overhead when reading and publishing messages.
59
59
///
60
- /// It's possible to use the idiomatic type for a publisher and the RMW-compatible type for a
60
+ /// It's possible to use the idiomatic type for a publisher and the RMW-native type for a
61
61
/// corresponding subscription, and vice versa.
62
62
///
63
- /// # RMW-compatible message type
64
- /// The RMW-compatible message type aims to achieve higher performance by avoiding the conversion
63
+ /// # RMW-native message type
64
+ /// The RMW-native message type aims to achieve higher performance by avoiding the conversion
65
65
/// step to an idiomatic message.
66
66
///
67
67
/// It uses the following type mapping:
@@ -88,7 +88,7 @@ pub trait RmwMessage: Clone + Debug + Default {
88
88
/// iteration and all of the functionality of slices. However, it doesn't have an equivalent of
89
89
/// [`Vec::push()`], among others.
90
90
///
91
- /// ## What does "RMW-compatible " mean in detail?
91
+ /// ## What does "RMW-native " mean in detail?
92
92
/// The message can be directly passed to and from the RMW layer because (1) its layout is
93
93
/// identical to the layout of the type generated by `rosidl_generator_c` and (2) the dynamic
94
94
/// memory inside the message is owned by the C allocator.
@@ -127,19 +127,19 @@ pub trait RmwMessage: Clone + Debug + Default {
127
127
/// The `Drop` impl for any sequence or string will call `fini()`.
128
128
129
129
pub trait Message : Clone + Debug + Default + ' static {
130
- /// The corresponding RMW-compatible message type.
130
+ /// The corresponding RMW-native message type.
131
131
type RmwMsg : RmwMessage ;
132
132
133
- /// Converts the idiomatic message into an RMW-compatible message.
133
+ /// Converts the idiomatic message into an RMW-native message.
134
134
///
135
135
/// If the idiomatic message is owned, a slightly more efficient conversion is possible.
136
136
/// This is why the function takes a `Cow`.
137
137
///
138
- /// If this function receives a borrowed message that is already RMW-compatible , it should
138
+ /// If this function receives a borrowed message that is already RMW-native , it should
139
139
/// directly return that borrowed message.
140
140
/// This is why the return type is also `Cow`.
141
141
fn into_rmw_message ( msg_cow : Cow < ' _ , Self > ) -> Cow < ' _ , Self :: RmwMsg > ;
142
142
143
- /// Converts the RMW-compatible message into an idiomatic message.
143
+ /// Converts the RMW-native message into an idiomatic message.
144
144
fn from_rmw_message ( msg : Self :: RmwMsg ) -> Self ;
145
145
}
0 commit comments