rosrustext_msgs 0.2.1

Bundled ROS 2 messages for rosrustext
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
pub mod rmw {
    #[cfg(feature = "serde")]
    use serde::{Deserialize, Serialize};

    #[link(name = "lifecycle_msgs__rosidl_typesupport_c")]
    extern "C" {
        fn rosidl_typesupport_c__get_message_type_support_handle__lifecycle_msgs__msg__State() -> *const std::ffi::c_void;
    }

    #[link(name = "lifecycle_msgs__rosidl_generator_c")]
    extern "C" {
        fn lifecycle_msgs__msg__State__init(msg: *mut State) -> bool;
        fn lifecycle_msgs__msg__State__Sequence__init(
            seq: *mut rosidl_runtime_rs::Sequence<State>, size: usize,
        ) -> bool;
        fn lifecycle_msgs__msg__State__Sequence__fini(seq: *mut rosidl_runtime_rs::Sequence<State>);
        fn lifecycle_msgs__msg__State__Sequence__copy(
            in_seq: &rosidl_runtime_rs::Sequence<State>, out_seq: *mut rosidl_runtime_rs::Sequence<State>,
        ) -> bool;
    }

    // Corresponds to lifecycle_msgs__msg__State
    #[repr(C)]
    #[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
    #[derive(Clone, Debug, PartialEq, PartialOrd)]
    pub struct State {
        pub id: u8,
        pub label: rosidl_runtime_rs::String,
    }

    impl State {
        /// These are the primary states. State changes can only be requested when the
        /// node is in one of these states.
        /// Indicates state has not yet been set.
        pub const PRIMARY_STATE_UNKNOWN: u8 = 0;
        /// This is the life cycle state the node is in immediately after being
        /// instantiated.
        pub const PRIMARY_STATE_UNCONFIGURED: u8 = 1;
        /// This state represents a node that is not currently performing any processing.
        pub const PRIMARY_STATE_INACTIVE: u8 = 2;
        /// This is the main state of the node's life cycle. While in this state, the node
        /// performs any processing, responds to service requests, reads and processes
        /// data, produces output, etc.
        pub const PRIMARY_STATE_ACTIVE: u8 = 3;
        /// The finalized state is the state in which the node ends immediately before
        /// being destroyed.
        pub const PRIMARY_STATE_FINALIZED: u8 = 4;
        /// Temporary intermediate states. When a transition is requested, the node
        /// changes its state into one of these states.
        /// In this transition state the node's onConfigure callback will be called to
        /// allow the node to load its configuration and conduct any required setup.
        pub const TRANSITION_STATE_CONFIGURING: u8 = 10;
        /// In this transition state the node's callback onCleanup will be called to clear
        /// all state and return the node to a functionally equivalent state as when
        /// first created.
        pub const TRANSITION_STATE_CLEANINGUP: u8 = 11;
        /// In this transition state the callback onShutdown will be executed to do any
        /// cleanup necessary before destruction.
        pub const TRANSITION_STATE_SHUTTINGDOWN: u8 = 12;
        /// In this transition state the callback onActivate will be executed to do any
        /// final preparations to start executing.
        pub const TRANSITION_STATE_ACTIVATING: u8 = 13;
        /// In this transition state the callback onDeactivate will be executed to do any
        /// cleanup to start executing, and reverse the onActivate changes.
        pub const TRANSITION_STATE_DEACTIVATING: u8 = 14;
        /// This transition state is where any error may be cleaned up.
        pub const TRANSITION_STATE_ERRORPROCESSING: u8 = 15;
    }

    impl Default for State {
        fn default() -> Self {
            unsafe {
                let mut msg = std::mem::zeroed();
                if !lifecycle_msgs__msg__State__init(&mut msg as *mut _) {
                    panic!("Call to lifecycle_msgs__msg__State__init() failed");
                }
                msg
            }
        }
    }

    impl rosidl_runtime_rs::SequenceAlloc for State {
        fn sequence_init(seq: &mut rosidl_runtime_rs::Sequence<Self>, size: usize) -> bool {
            // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
            unsafe { lifecycle_msgs__msg__State__Sequence__init(seq as *mut _, size) }
        }
        fn sequence_fini(seq: &mut rosidl_runtime_rs::Sequence<Self>) {
            // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
            unsafe { lifecycle_msgs__msg__State__Sequence__fini(seq as *mut _) }
        }
        fn sequence_copy(
            in_seq: &rosidl_runtime_rs::Sequence<Self>, out_seq: &mut rosidl_runtime_rs::Sequence<Self>,
        ) -> bool {
            // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
            unsafe { lifecycle_msgs__msg__State__Sequence__copy(in_seq, out_seq as *mut _) }
        }
    }

    impl rosidl_runtime_rs::Message for State {
        type RmwMsg = Self;
        fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
            msg_cow
        }
        fn from_rmw_message(msg: Self::RmwMsg) -> Self {
            msg
        }
    }

    impl rosidl_runtime_rs::RmwMessage for State
    where
        Self: Sized,
    {
        const TYPE_NAME: &'static str = "lifecycle_msgs/msg/State";
        fn get_type_support() -> *const std::ffi::c_void {
            // SAFETY: No preconditions for this function.
            unsafe { rosidl_typesupport_c__get_message_type_support_handle__lifecycle_msgs__msg__State() }
        }
    }

    #[link(name = "lifecycle_msgs__rosidl_typesupport_c")]
    extern "C" {
        fn rosidl_typesupport_c__get_message_type_support_handle__lifecycle_msgs__msg__Transition(
        ) -> *const std::ffi::c_void;
    }

    #[link(name = "lifecycle_msgs__rosidl_generator_c")]
    extern "C" {
        fn lifecycle_msgs__msg__Transition__init(msg: *mut Transition) -> bool;
        fn lifecycle_msgs__msg__Transition__Sequence__init(
            seq: *mut rosidl_runtime_rs::Sequence<Transition>, size: usize,
        ) -> bool;
        fn lifecycle_msgs__msg__Transition__Sequence__fini(seq: *mut rosidl_runtime_rs::Sequence<Transition>);
        fn lifecycle_msgs__msg__Transition__Sequence__copy(
            in_seq: &rosidl_runtime_rs::Sequence<Transition>, out_seq: *mut rosidl_runtime_rs::Sequence<Transition>,
        ) -> bool;
    }

    // Corresponds to lifecycle_msgs__msg__Transition
    #[repr(C)]
    #[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
    #[derive(Clone, Debug, PartialEq, PartialOrd)]
    pub struct Transition {
        pub id: u8,
        pub label: rosidl_runtime_rs::String,
    }

    impl Transition {
        /// Reserved, publicly available transitions.
        /// When a node is in one of these primary states, these transitions can be
        /// invoked.
        /// This transition will instantiate the node, but will not run any code beyond
        /// the constructor.
        pub const TRANSITION_CREATE: u8 = 0;
        /// The node's onConfigure callback will be called to allow the node to load its
        /// configuration and conduct any required setup.
        pub const TRANSITION_CONFIGURE: u8 = 1;
        /// The node's callback onCleanup will be called in this transition to allow the
        /// node to load its configuration and conduct any required setup.
        pub const TRANSITION_CLEANUP: u8 = 2;
        /// The node's callback onActivate will be executed to do any final preparations
        /// to start executing.
        pub const TRANSITION_ACTIVATE: u8 = 3;
        /// The node's callback onDeactivate will be executed to do any cleanup to start
        /// executing, and reverse the onActivate changes.
        pub const TRANSITION_DEACTIVATE: u8 = 4;
        /// This signals shutdown during an unconfigured state, the node's callback
        /// onShutdown will be executed to do any cleanup necessary before destruction.
        pub const TRANSITION_UNCONFIGURED_SHUTDOWN: u8 = 5;
        /// This signals shutdown during an inactive state, the node's callback onShutdown
        /// will be executed to do any cleanup necessary before destruction.
        pub const TRANSITION_INACTIVE_SHUTDOWN: u8 = 6;
        /// This signals shutdown during an active state, the node's callback onShutdown
        /// will be executed to do any cleanup necessary before destruction.
        pub const TRANSITION_ACTIVE_SHUTDOWN: u8 = 7;
        /// This transition will simply cause the deallocation of the node.
        pub const TRANSITION_DESTROY: u8 = 8;
        /// Reserved, private transitions
        /// These transitions are not publicly available and cannot be invoked by a user.
        /// The following transitions are implicitly invoked based on the callback
        /// feedback of the intermediate transition states.
        pub const TRANSITION_ON_CONFIGURE_SUCCESS: u8 = 10;
        pub const TRANSITION_ON_CONFIGURE_FAILURE: u8 = 11;
        pub const TRANSITION_ON_CONFIGURE_ERROR: u8 = 12;
        pub const TRANSITION_ON_CLEANUP_SUCCESS: u8 = 20;
        pub const TRANSITION_ON_CLEANUP_FAILURE: u8 = 21;
        pub const TRANSITION_ON_CLEANUP_ERROR: u8 = 22;
        pub const TRANSITION_ON_ACTIVATE_SUCCESS: u8 = 30;
        pub const TRANSITION_ON_ACTIVATE_FAILURE: u8 = 31;
        pub const TRANSITION_ON_ACTIVATE_ERROR: u8 = 32;
        pub const TRANSITION_ON_DEACTIVATE_SUCCESS: u8 = 40;
        pub const TRANSITION_ON_DEACTIVATE_FAILURE: u8 = 41;
        pub const TRANSITION_ON_DEACTIVATE_ERROR: u8 = 42;
        pub const TRANSITION_ON_SHUTDOWN_SUCCESS: u8 = 50;
        pub const TRANSITION_ON_SHUTDOWN_FAILURE: u8 = 51;
        pub const TRANSITION_ON_SHUTDOWN_ERROR: u8 = 52;
        pub const TRANSITION_ON_ERROR_SUCCESS: u8 = 60;
        pub const TRANSITION_ON_ERROR_FAILURE: u8 = 61;
        pub const TRANSITION_ON_ERROR_ERROR: u8 = 62;
        /// Reserved. Transition callback success values.
        /// These return values ought to be set as a return value for each callback.
        /// Depending on which return value, the transition will be executed correctly or
        /// fallback/error callbacks will be triggered.
        /// The transition callback successfully performed its required functionality.
        pub const TRANSITION_CALLBACK_SUCCESS: u8 = 97;
        /// The transition callback failed to perform its required functionality.
        pub const TRANSITION_CALLBACK_FAILURE: u8 = 98;
        /// The transition callback encountered an error that requires special cleanup, if
        /// possible.
        pub const TRANSITION_CALLBACK_ERROR: u8 = 99;
    }

    impl Default for Transition {
        fn default() -> Self {
            unsafe {
                let mut msg = std::mem::zeroed();
                if !lifecycle_msgs__msg__Transition__init(&mut msg as *mut _) {
                    panic!("Call to lifecycle_msgs__msg__Transition__init() failed");
                }
                msg
            }
        }
    }

    impl rosidl_runtime_rs::SequenceAlloc for Transition {
        fn sequence_init(seq: &mut rosidl_runtime_rs::Sequence<Self>, size: usize) -> bool {
            // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
            unsafe { lifecycle_msgs__msg__Transition__Sequence__init(seq as *mut _, size) }
        }
        fn sequence_fini(seq: &mut rosidl_runtime_rs::Sequence<Self>) {
            // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
            unsafe { lifecycle_msgs__msg__Transition__Sequence__fini(seq as *mut _) }
        }
        fn sequence_copy(
            in_seq: &rosidl_runtime_rs::Sequence<Self>, out_seq: &mut rosidl_runtime_rs::Sequence<Self>,
        ) -> bool {
            // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
            unsafe { lifecycle_msgs__msg__Transition__Sequence__copy(in_seq, out_seq as *mut _) }
        }
    }

    impl rosidl_runtime_rs::Message for Transition {
        type RmwMsg = Self;
        fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
            msg_cow
        }
        fn from_rmw_message(msg: Self::RmwMsg) -> Self {
            msg
        }
    }

    impl rosidl_runtime_rs::RmwMessage for Transition
    where
        Self: Sized,
    {
        const TYPE_NAME: &'static str = "lifecycle_msgs/msg/Transition";
        fn get_type_support() -> *const std::ffi::c_void {
            // SAFETY: No preconditions for this function.
            unsafe { rosidl_typesupport_c__get_message_type_support_handle__lifecycle_msgs__msg__Transition() }
        }
    }

    #[link(name = "lifecycle_msgs__rosidl_typesupport_c")]
    extern "C" {
        fn rosidl_typesupport_c__get_message_type_support_handle__lifecycle_msgs__msg__TransitionDescription(
        ) -> *const std::ffi::c_void;
    }

    #[link(name = "lifecycle_msgs__rosidl_generator_c")]
    extern "C" {
        fn lifecycle_msgs__msg__TransitionDescription__init(msg: *mut TransitionDescription) -> bool;
        fn lifecycle_msgs__msg__TransitionDescription__Sequence__init(
            seq: *mut rosidl_runtime_rs::Sequence<TransitionDescription>, size: usize,
        ) -> bool;
        fn lifecycle_msgs__msg__TransitionDescription__Sequence__fini(
            seq: *mut rosidl_runtime_rs::Sequence<TransitionDescription>,
        );
        fn lifecycle_msgs__msg__TransitionDescription__Sequence__copy(
            in_seq: &rosidl_runtime_rs::Sequence<TransitionDescription>,
            out_seq: *mut rosidl_runtime_rs::Sequence<TransitionDescription>,
        ) -> bool;
    }

    // Corresponds to lifecycle_msgs__msg__TransitionDescription
    #[repr(C)]
    #[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
    #[derive(Clone, Debug, PartialEq, PartialOrd)]
    pub struct TransitionDescription {
        pub transition: crate::lifecycle_msgs::msg::rmw::Transition,
        pub start_state: crate::lifecycle_msgs::msg::rmw::State,
        pub goal_state: crate::lifecycle_msgs::msg::rmw::State,
    }

    impl Default for TransitionDescription {
        fn default() -> Self {
            unsafe {
                let mut msg = std::mem::zeroed();
                if !lifecycle_msgs__msg__TransitionDescription__init(&mut msg as *mut _) {
                    panic!("Call to lifecycle_msgs__msg__TransitionDescription__init() failed");
                }
                msg
            }
        }
    }

    impl rosidl_runtime_rs::SequenceAlloc for TransitionDescription {
        fn sequence_init(seq: &mut rosidl_runtime_rs::Sequence<Self>, size: usize) -> bool {
            // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
            unsafe { lifecycle_msgs__msg__TransitionDescription__Sequence__init(seq as *mut _, size) }
        }
        fn sequence_fini(seq: &mut rosidl_runtime_rs::Sequence<Self>) {
            // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
            unsafe { lifecycle_msgs__msg__TransitionDescription__Sequence__fini(seq as *mut _) }
        }
        fn sequence_copy(
            in_seq: &rosidl_runtime_rs::Sequence<Self>, out_seq: &mut rosidl_runtime_rs::Sequence<Self>,
        ) -> bool {
            // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
            unsafe { lifecycle_msgs__msg__TransitionDescription__Sequence__copy(in_seq, out_seq as *mut _) }
        }
    }

    impl rosidl_runtime_rs::Message for TransitionDescription {
        type RmwMsg = Self;
        fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
            msg_cow
        }
        fn from_rmw_message(msg: Self::RmwMsg) -> Self {
            msg
        }
    }

    impl rosidl_runtime_rs::RmwMessage for TransitionDescription
    where
        Self: Sized,
    {
        const TYPE_NAME: &'static str = "lifecycle_msgs/msg/TransitionDescription";
        fn get_type_support() -> *const std::ffi::c_void {
            // SAFETY: No preconditions for this function.
            unsafe {
                rosidl_typesupport_c__get_message_type_support_handle__lifecycle_msgs__msg__TransitionDescription()
            }
        }
    }

    #[link(name = "lifecycle_msgs__rosidl_typesupport_c")]
    extern "C" {
        fn rosidl_typesupport_c__get_message_type_support_handle__lifecycle_msgs__msg__TransitionEvent(
        ) -> *const std::ffi::c_void;
    }

    #[link(name = "lifecycle_msgs__rosidl_generator_c")]
    extern "C" {
        fn lifecycle_msgs__msg__TransitionEvent__init(msg: *mut TransitionEvent) -> bool;
        fn lifecycle_msgs__msg__TransitionEvent__Sequence__init(
            seq: *mut rosidl_runtime_rs::Sequence<TransitionEvent>, size: usize,
        ) -> bool;
        fn lifecycle_msgs__msg__TransitionEvent__Sequence__fini(seq: *mut rosidl_runtime_rs::Sequence<TransitionEvent>);
        fn lifecycle_msgs__msg__TransitionEvent__Sequence__copy(
            in_seq: &rosidl_runtime_rs::Sequence<TransitionEvent>,
            out_seq: *mut rosidl_runtime_rs::Sequence<TransitionEvent>,
        ) -> bool;
    }

    // Corresponds to lifecycle_msgs__msg__TransitionEvent
    #[repr(C)]
    #[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
    #[derive(Clone, Debug, PartialEq, PartialOrd)]
    pub struct TransitionEvent {
        pub timestamp: u64,
        pub transition: crate::lifecycle_msgs::msg::rmw::Transition,
        pub start_state: crate::lifecycle_msgs::msg::rmw::State,
        pub goal_state: crate::lifecycle_msgs::msg::rmw::State,
    }

    impl Default for TransitionEvent {
        fn default() -> Self {
            unsafe {
                let mut msg = std::mem::zeroed();
                if !lifecycle_msgs__msg__TransitionEvent__init(&mut msg as *mut _) {
                    panic!("Call to lifecycle_msgs__msg__TransitionEvent__init() failed");
                }
                msg
            }
        }
    }

    impl rosidl_runtime_rs::SequenceAlloc for TransitionEvent {
        fn sequence_init(seq: &mut rosidl_runtime_rs::Sequence<Self>, size: usize) -> bool {
            // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
            unsafe { lifecycle_msgs__msg__TransitionEvent__Sequence__init(seq as *mut _, size) }
        }
        fn sequence_fini(seq: &mut rosidl_runtime_rs::Sequence<Self>) {
            // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
            unsafe { lifecycle_msgs__msg__TransitionEvent__Sequence__fini(seq as *mut _) }
        }
        fn sequence_copy(
            in_seq: &rosidl_runtime_rs::Sequence<Self>, out_seq: &mut rosidl_runtime_rs::Sequence<Self>,
        ) -> bool {
            // SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.
            unsafe { lifecycle_msgs__msg__TransitionEvent__Sequence__copy(in_seq, out_seq as *mut _) }
        }
    }

    impl rosidl_runtime_rs::Message for TransitionEvent {
        type RmwMsg = Self;
        fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
            msg_cow
        }
        fn from_rmw_message(msg: Self::RmwMsg) -> Self {
            msg
        }
    }

    impl rosidl_runtime_rs::RmwMessage for TransitionEvent
    where
        Self: Sized,
    {
        const TYPE_NAME: &'static str = "lifecycle_msgs/msg/TransitionEvent";
        fn get_type_support() -> *const std::ffi::c_void {
            // SAFETY: No preconditions for this function.
            unsafe { rosidl_typesupport_c__get_message_type_support_handle__lifecycle_msgs__msg__TransitionEvent() }
        }
    }
} // mod rmw

#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct State {
    pub id: u8,
    pub label: std::string::String,
}

impl State {
    /// These are the primary states. State changes can only be requested when the
    /// node is in one of these states.
    /// Indicates state has not yet been set.
    pub const PRIMARY_STATE_UNKNOWN: u8 = 0;
    /// This is the life cycle state the node is in immediately after being
    /// instantiated.
    pub const PRIMARY_STATE_UNCONFIGURED: u8 = 1;
    /// This state represents a node that is not currently performing any processing.
    pub const PRIMARY_STATE_INACTIVE: u8 = 2;
    /// This is the main state of the node's life cycle. While in this state, the node
    /// performs any processing, responds to service requests, reads and processes
    /// data, produces output, etc.
    pub const PRIMARY_STATE_ACTIVE: u8 = 3;
    /// The finalized state is the state in which the node ends immediately before
    /// being destroyed.
    pub const PRIMARY_STATE_FINALIZED: u8 = 4;
    /// Temporary intermediate states. When a transition is requested, the node
    /// changes its state into one of these states.
    /// In this transition state the node's onConfigure callback will be called to
    /// allow the node to load its configuration and conduct any required setup.
    pub const TRANSITION_STATE_CONFIGURING: u8 = 10;
    /// In this transition state the node's callback onCleanup will be called to clear
    /// all state and return the node to a functionally equivalent state as when
    /// first created.
    pub const TRANSITION_STATE_CLEANINGUP: u8 = 11;
    /// In this transition state the callback onShutdown will be executed to do any
    /// cleanup necessary before destruction.
    pub const TRANSITION_STATE_SHUTTINGDOWN: u8 = 12;
    /// In this transition state the callback onActivate will be executed to do any
    /// final preparations to start executing.
    pub const TRANSITION_STATE_ACTIVATING: u8 = 13;
    /// In this transition state the callback onDeactivate will be executed to do any
    /// cleanup to start executing, and reverse the onActivate changes.
    pub const TRANSITION_STATE_DEACTIVATING: u8 = 14;
    /// This transition state is where any error may be cleaned up.
    pub const TRANSITION_STATE_ERRORPROCESSING: u8 = 15;
}

impl Default for State {
    fn default() -> Self {
        <Self as rosidl_runtime_rs::Message>::from_rmw_message(crate::lifecycle_msgs::msg::rmw::State::default())
    }
}

impl rosidl_runtime_rs::Message for State {
    type RmwMsg = crate::lifecycle_msgs::msg::rmw::State;

    fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
        match msg_cow {
            std::borrow::Cow::Owned(msg) => {
                std::borrow::Cow::Owned(Self::RmwMsg { id: msg.id, label: msg.label.as_str().into() })
            }
            std::borrow::Cow::Borrowed(msg) => {
                std::borrow::Cow::Owned(Self::RmwMsg { id: msg.id, label: msg.label.as_str().into() })
            }
        }
    }

    fn from_rmw_message(msg: Self::RmwMsg) -> Self {
        Self { id: msg.id, label: msg.label.to_string() }
    }
}

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct Transition {
    pub id: u8,
    pub label: std::string::String,
}

impl Transition {
    /// Reserved, publicly available transitions.
    /// When a node is in one of these primary states, these transitions can be
    /// invoked.
    /// This transition will instantiate the node, but will not run any code beyond
    /// the constructor.
    pub const TRANSITION_CREATE: u8 = 0;
    /// The node's onConfigure callback will be called to allow the node to load its
    /// configuration and conduct any required setup.
    pub const TRANSITION_CONFIGURE: u8 = 1;
    /// The node's callback onCleanup will be called in this transition to allow the
    /// node to load its configuration and conduct any required setup.
    pub const TRANSITION_CLEANUP: u8 = 2;
    /// The node's callback onActivate will be executed to do any final preparations
    /// to start executing.
    pub const TRANSITION_ACTIVATE: u8 = 3;
    /// The node's callback onDeactivate will be executed to do any cleanup to start
    /// executing, and reverse the onActivate changes.
    pub const TRANSITION_DEACTIVATE: u8 = 4;
    /// This signals shutdown during an unconfigured state, the node's callback
    /// onShutdown will be executed to do any cleanup necessary before destruction.
    pub const TRANSITION_UNCONFIGURED_SHUTDOWN: u8 = 5;
    /// This signals shutdown during an inactive state, the node's callback onShutdown
    /// will be executed to do any cleanup necessary before destruction.
    pub const TRANSITION_INACTIVE_SHUTDOWN: u8 = 6;
    /// This signals shutdown during an active state, the node's callback onShutdown
    /// will be executed to do any cleanup necessary before destruction.
    pub const TRANSITION_ACTIVE_SHUTDOWN: u8 = 7;
    /// This transition will simply cause the deallocation of the node.
    pub const TRANSITION_DESTROY: u8 = 8;
    /// Reserved, private transitions
    /// These transitions are not publicly available and cannot be invoked by a user.
    /// The following transitions are implicitly invoked based on the callback
    /// feedback of the intermediate transition states.
    pub const TRANSITION_ON_CONFIGURE_SUCCESS: u8 = 10;
    pub const TRANSITION_ON_CONFIGURE_FAILURE: u8 = 11;
    pub const TRANSITION_ON_CONFIGURE_ERROR: u8 = 12;
    pub const TRANSITION_ON_CLEANUP_SUCCESS: u8 = 20;
    pub const TRANSITION_ON_CLEANUP_FAILURE: u8 = 21;
    pub const TRANSITION_ON_CLEANUP_ERROR: u8 = 22;
    pub const TRANSITION_ON_ACTIVATE_SUCCESS: u8 = 30;
    pub const TRANSITION_ON_ACTIVATE_FAILURE: u8 = 31;
    pub const TRANSITION_ON_ACTIVATE_ERROR: u8 = 32;
    pub const TRANSITION_ON_DEACTIVATE_SUCCESS: u8 = 40;
    pub const TRANSITION_ON_DEACTIVATE_FAILURE: u8 = 41;
    pub const TRANSITION_ON_DEACTIVATE_ERROR: u8 = 42;
    pub const TRANSITION_ON_SHUTDOWN_SUCCESS: u8 = 50;
    pub const TRANSITION_ON_SHUTDOWN_FAILURE: u8 = 51;
    pub const TRANSITION_ON_SHUTDOWN_ERROR: u8 = 52;
    pub const TRANSITION_ON_ERROR_SUCCESS: u8 = 60;
    pub const TRANSITION_ON_ERROR_FAILURE: u8 = 61;
    pub const TRANSITION_ON_ERROR_ERROR: u8 = 62;
    /// Reserved. Transition callback success values.
    /// These return values ought to be set as a return value for each callback.
    /// Depending on which return value, the transition will be executed correctly or
    /// fallback/error callbacks will be triggered.
    /// The transition callback successfully performed its required functionality.
    pub const TRANSITION_CALLBACK_SUCCESS: u8 = 97;
    /// The transition callback failed to perform its required functionality.
    pub const TRANSITION_CALLBACK_FAILURE: u8 = 98;
    /// The transition callback encountered an error that requires special cleanup, if
    /// possible.
    pub const TRANSITION_CALLBACK_ERROR: u8 = 99;
}

impl Default for Transition {
    fn default() -> Self {
        <Self as rosidl_runtime_rs::Message>::from_rmw_message(crate::lifecycle_msgs::msg::rmw::Transition::default())
    }
}

impl rosidl_runtime_rs::Message for Transition {
    type RmwMsg = crate::lifecycle_msgs::msg::rmw::Transition;

    fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
        match msg_cow {
            std::borrow::Cow::Owned(msg) => {
                std::borrow::Cow::Owned(Self::RmwMsg { id: msg.id, label: msg.label.as_str().into() })
            }
            std::borrow::Cow::Borrowed(msg) => {
                std::borrow::Cow::Owned(Self::RmwMsg { id: msg.id, label: msg.label.as_str().into() })
            }
        }
    }

    fn from_rmw_message(msg: Self::RmwMsg) -> Self {
        Self { id: msg.id, label: msg.label.to_string() }
    }
}

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct TransitionDescription {
    pub transition: crate::lifecycle_msgs::msg::Transition,
    pub start_state: crate::lifecycle_msgs::msg::State,
    pub goal_state: crate::lifecycle_msgs::msg::State,
}

impl Default for TransitionDescription {
    fn default() -> Self {
        <Self as rosidl_runtime_rs::Message>::from_rmw_message(
            crate::lifecycle_msgs::msg::rmw::TransitionDescription::default(),
        )
    }
}

impl rosidl_runtime_rs::Message for TransitionDescription {
    type RmwMsg = crate::lifecycle_msgs::msg::rmw::TransitionDescription;

    fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
        match msg_cow {
            std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
                transition: crate::lifecycle_msgs::msg::Transition::into_rmw_message(std::borrow::Cow::Owned(
                    msg.transition,
                ))
                .into_owned(),
                start_state: crate::lifecycle_msgs::msg::State::into_rmw_message(std::borrow::Cow::Owned(
                    msg.start_state,
                ))
                .into_owned(),
                goal_state: crate::lifecycle_msgs::msg::State::into_rmw_message(std::borrow::Cow::Owned(
                    msg.goal_state,
                ))
                .into_owned(),
            }),
            std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
                transition: crate::lifecycle_msgs::msg::Transition::into_rmw_message(std::borrow::Cow::Borrowed(
                    &msg.transition,
                ))
                .into_owned(),
                start_state: crate::lifecycle_msgs::msg::State::into_rmw_message(std::borrow::Cow::Borrowed(
                    &msg.start_state,
                ))
                .into_owned(),
                goal_state: crate::lifecycle_msgs::msg::State::into_rmw_message(std::borrow::Cow::Borrowed(
                    &msg.goal_state,
                ))
                .into_owned(),
            }),
        }
    }

    fn from_rmw_message(msg: Self::RmwMsg) -> Self {
        Self {
            transition: crate::lifecycle_msgs::msg::Transition::from_rmw_message(msg.transition),
            start_state: crate::lifecycle_msgs::msg::State::from_rmw_message(msg.start_state),
            goal_state: crate::lifecycle_msgs::msg::State::from_rmw_message(msg.goal_state),
        }
    }
}

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct TransitionEvent {
    pub timestamp: u64,
    pub transition: crate::lifecycle_msgs::msg::Transition,
    pub start_state: crate::lifecycle_msgs::msg::State,
    pub goal_state: crate::lifecycle_msgs::msg::State,
}

impl Default for TransitionEvent {
    fn default() -> Self {
        <Self as rosidl_runtime_rs::Message>::from_rmw_message(
            crate::lifecycle_msgs::msg::rmw::TransitionEvent::default(),
        )
    }
}

impl rosidl_runtime_rs::Message for TransitionEvent {
    type RmwMsg = crate::lifecycle_msgs::msg::rmw::TransitionEvent;

    fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
        match msg_cow {
            std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
                timestamp: msg.timestamp,
                transition: crate::lifecycle_msgs::msg::Transition::into_rmw_message(std::borrow::Cow::Owned(
                    msg.transition,
                ))
                .into_owned(),
                start_state: crate::lifecycle_msgs::msg::State::into_rmw_message(std::borrow::Cow::Owned(
                    msg.start_state,
                ))
                .into_owned(),
                goal_state: crate::lifecycle_msgs::msg::State::into_rmw_message(std::borrow::Cow::Owned(
                    msg.goal_state,
                ))
                .into_owned(),
            }),
            std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
                timestamp: msg.timestamp,
                transition: crate::lifecycle_msgs::msg::Transition::into_rmw_message(std::borrow::Cow::Borrowed(
                    &msg.transition,
                ))
                .into_owned(),
                start_state: crate::lifecycle_msgs::msg::State::into_rmw_message(std::borrow::Cow::Borrowed(
                    &msg.start_state,
                ))
                .into_owned(),
                goal_state: crate::lifecycle_msgs::msg::State::into_rmw_message(std::borrow::Cow::Borrowed(
                    &msg.goal_state,
                ))
                .into_owned(),
            }),
        }
    }

    fn from_rmw_message(msg: Self::RmwMsg) -> Self {
        Self {
            timestamp: msg.timestamp,
            transition: crate::lifecycle_msgs::msg::Transition::from_rmw_message(msg.transition),
            start_state: crate::lifecycle_msgs::msg::State::from_rmw_message(msg.start_state),
            goal_state: crate::lifecycle_msgs::msg::State::from_rmw_message(msg.goal_state),
        }
    }
}