rcl_lifecycle  master
C API providing common functionality for ROS lifecycle.
data_types.h
1 // Copyright 2016 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef RCL_LIFECYCLE__DATA_TYPES_H_
16 #define RCL_LIFECYCLE__DATA_TYPES_H_
17 
18 #include "rcl/rcl.h"
19 
20 #include "rcl_lifecycle/visibility_control.h"
21 
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26 
28 
30 typedef struct rcl_lifecycle_state_t
31 {
33  const char * label;
35  uint8_t id;
36 
40  unsigned int valid_transition_size;
42 
45 {
48  const char * label;
50  unsigned int id;
56 
59 {
63  unsigned int states_size;
67  unsigned int transitions_size;
69 
72 {
88 
91 {
99 
102 {
112 
113 #ifdef __cplusplus
114 }
115 #endif
116 
117 #endif // RCL_LIFECYCLE__DATA_TYPES_H_
rcl_node_t
rcl_lifecycle_com_interface_t::srv_change_state
rcl_service_t srv_change_state
Service that allows to trigger changes on the state.
Definition: data_types.h:78
rcl_lifecycle_state_t
It contains the state of the lifecycle state machine.
Definition: data_types.h:30
rcl_lifecycle_com_interface_t
It contains the communication interfac with the ROS world.
Definition: data_types.h:71
rcl_lifecycle_transition_t::start
rcl_lifecycle_state_t * start
The value where the transition is initialized.
Definition: data_types.h:52
rcl_lifecycle_state_machine_t::transition_map
rcl_lifecycle_transition_map_t transition_map
Map/Associated array of registered states and transitions.
Definition: data_types.h:106
rcl_lifecycle_transition_t::label
const char * label
Definition: data_types.h:48
rcl_lifecycle_transition_t::goal
rcl_lifecycle_state_t * goal
The objetive of the transition.
Definition: data_types.h:54
rcl_lifecycle_state_t::label
const char * label
String with state name: Unconfigured, Inactive, Active or Finalized.
Definition: data_types.h:33
rcl_lifecycle_state_machine_t::com_interface
rcl_lifecycle_com_interface_t com_interface
Communication interface into a ROS world.
Definition: data_types.h:108
rcl_lifecycle_state_machine_t::options
rcl_lifecycle_state_machine_options_t options
Options struct with which the state machine was initialized.
Definition: data_types.h:110
rcl_lifecycle_state_machine_options_t::allocator
rcl_allocator_t allocator
Allocator used for allocating states and transitions.
Definition: data_types.h:97
rcl_lifecycle_transition_map_t
It contains the transition map states and transitions.
Definition: data_types.h:58
rcl_lifecycle_transition_map_t::states
rcl_lifecycle_state_t * states
States used to generate the transition map.
Definition: data_types.h:61
rcl_lifecycle_com_interface_t::pub_transition_event
rcl_publisher_t pub_transition_event
Event used to publish the transitions.
Definition: data_types.h:76
rcl_lifecycle_state_machine_options_t::enable_com_interface
bool enable_com_interface
Flag indicating whether the com interface shall be used or not.
Definition: data_types.h:95
rcl_lifecycle_state_t::valid_transitions
rcl_lifecycle_transition_t * valid_transitions
Pointer to a struct with the valid transitions.
Definition: data_types.h:38
rcl_lifecycle_state_machine_t
It contains the state machine data.
Definition: data_types.h:101
rcl_lifecycle_transition_t::id
unsigned int id
Identifier of the transition.
Definition: data_types.h:50
rcl_publisher_t
rcl_lifecycle_com_interface_t::srv_get_available_states
rcl_service_t srv_get_available_states
Service that allows to get the available states.
Definition: data_types.h:82
rcl_lifecycle_com_interface_t::srv_get_transition_graph
rcl_service_t srv_get_transition_graph
Service that allows to get transitions from the graph.
Definition: data_types.h:86
rcl_lifecycle_state_machine_options_t::initialize_default_states
bool initialize_default_states
Flag indicating whether the state machine shall be initialized with default states.
Definition: data_types.h:93
rcl_lifecycle_com_interface_t::srv_get_state
rcl_service_t srv_get_state
Service that allows to get the current state.
Definition: data_types.h:80
rcl_lifecycle_state_t::id
uint8_t id
Identifier of the state.
Definition: data_types.h:35
rcl_lifecycle_transition_map_t::states_size
unsigned int states_size
Number of states.
Definition: data_types.h:63
rcl_lifecycle_state_machine_t::current_state
const rcl_lifecycle_state_t * current_state
Current state of the state machine.
Definition: data_types.h:104
rcl_lifecycle_state_machine_options_t
It contains various options to configure the rcl_lifecycle_state_machine_t instance.
Definition: data_types.h:90
rcl_lifecycle_transition_map_t::transitions
rcl_lifecycle_transition_t * transitions
Transitions used to generate the transition map.
Definition: data_types.h:65
rcutils_allocator_t
rcl_service_t
rcl_lifecycle_transition_t
It contains the transitions of the lifecycle state machine.
Definition: data_types.h:44
rcl_lifecycle_transition_map_t::transitions_size
unsigned int transitions_size
Number of transitions.
Definition: data_types.h:67
rcl_lifecycle_com_interface_t::node_handle
rcl_node_t * node_handle
Handle to the node used to create the publisher and the services.
Definition: data_types.h:74
rcl_lifecycle_com_interface_t::srv_get_available_transitions
rcl_service_t srv_get_available_transitions
Service that allows to get the available transitions.
Definition: data_types.h:84
rcl_lifecycle_state_t::valid_transition_size
unsigned int valid_transition_size
Number of valid transitions.
Definition: data_types.h:40