OpenSMI-ROS2 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. opensmi/ros2/__init__.py +89 -0
  2. opensmi/ros2/__main__.py +11 -0
  3. opensmi/ros2/cli.py +143 -0
  4. opensmi/ros2/py.typed +0 -0
  5. opensmi/ros2/runtime/__init__.py +67 -0
  6. opensmi/ros2/runtime/_decode.py +101 -0
  7. opensmi/ros2/runtime/_encode.py +102 -0
  8. opensmi/ros2/runtime/_parser.py +147 -0
  9. opensmi/ros2/runtime/errors.py +141 -0
  10. opensmi/ros2/runtime/goal.py +232 -0
  11. opensmi/ros2/runtime/graph.py +288 -0
  12. opensmi/ros2/runtime/guard.py +213 -0
  13. opensmi/ros2/runtime/interface.py +140 -0
  14. opensmi/ros2/runtime/messages/__init__.py +503 -0
  15. opensmi/ros2/runtime/messages/industrial_msgs.py +62 -0
  16. opensmi/ros2/runtime/messages/industrial_msgs.pyi +159 -0
  17. opensmi/ros2/runtime/messages/motoros2_interfaces.py +79 -0
  18. opensmi/ros2/runtime/messages/motoros2_interfaces.pyi +307 -0
  19. opensmi/ros2/runtime/messages/neo_msgs2.py +55 -0
  20. opensmi/ros2/runtime/messages/neo_msgs2.pyi +138 -0
  21. opensmi/ros2/runtime/messages/neo_srvs2.py +72 -0
  22. opensmi/ros2/runtime/messages/neo_srvs2.pyi +224 -0
  23. opensmi/ros2/runtime/outcomes.py +103 -0
  24. opensmi/ros2/runtime/parameters.py +723 -0
  25. opensmi/ros2/runtime/publisher.py +125 -0
  26. opensmi/ros2/runtime/qos.py +394 -0
  27. opensmi/ros2/runtime/runtime.py +1171 -0
  28. opensmi/ros2/runtime/selection.py +150 -0
  29. opensmi/ros2/runtime/stamp.py +100 -0
  30. opensmi/ros2/runtime/subscription.py +354 -0
  31. opensmi/ros2/runtime/tf.py +714 -0
  32. opensmi/ros2/server/__init__.py +148 -0
  33. opensmi/ros2/server/access.py +109 -0
  34. opensmi/ros2/server/bindings/__init__.py +92 -0
  35. opensmi/ros2/server/bindings/_base.py +154 -0
  36. opensmi/ros2/server/bindings/action.py +133 -0
  37. opensmi/ros2/server/bindings/keyed.py +127 -0
  38. opensmi/ros2/server/bindings/lifecycle.py +131 -0
  39. opensmi/ros2/server/bindings/method.py +130 -0
  40. opensmi/ros2/server/bindings/monitoring.py +109 -0
  41. opensmi/ros2/server/bindings/parameter.py +133 -0
  42. opensmi/ros2/server/bindings/publisher.py +192 -0
  43. opensmi/ros2/server/bindings/registry.py +95 -0
  44. opensmi/ros2/server/bindings/tf.py +256 -0
  45. opensmi/ros2/server/browse_names.py +94 -0
  46. opensmi/ros2/server/component.py +334 -0
  47. opensmi/ros2/server/config.py +493 -0
  48. opensmi/ros2/server/containers.py +191 -0
  49. opensmi/ros2/server/drivers.py +421 -0
  50. opensmi/ros2/server/errors.py +159 -0
  51. opensmi/ros2/server/events.py +406 -0
  52. opensmi/ros2/server/introspection.py +850 -0
  53. opensmi/ros2/server/keyed.py +749 -0
  54. opensmi/ros2/server/lifecycle.py +238 -0
  55. opensmi/ros2/server/limits.py +66 -0
  56. opensmi/ros2/server/loader.py +977 -0
  57. opensmi/ros2/server/machine.py +225 -0
  58. opensmi/ros2/server/method.py +307 -0
  59. opensmi/ros2/server/mirror.py +582 -0
  60. opensmi/ros2/server/mutation.py +992 -0
  61. opensmi/ros2/server/nodesets/Opc.Ua.SmartFactory.ROS2.NodeSet2.xml +85 -0
  62. opensmi/ros2/server/nodesets/__init__.py +18 -0
  63. opensmi/ros2/server/nodesets/smart_factory_ros2.py +26 -0
  64. opensmi/ros2/server/parameters.py +704 -0
  65. opensmi/ros2/server/projection.py +1176 -0
  66. opensmi/ros2/server/projections/__init__.py +41 -0
  67. opensmi/ros2/server/projections/scope.py +222 -0
  68. opensmi/ros2/server/provenance.py +121 -0
  69. opensmi/ros2/server/publisher.py +781 -0
  70. opensmi/ros2/server/recipes.py +514 -0
  71. opensmi/ros2/server/required.py +633 -0
  72. opensmi/ros2/server/skill.py +363 -0
  73. opensmi/ros2/server/spatial.py +283 -0
  74. opensmi/ros2/server/startup.py +626 -0
  75. opensmi/ros2/server/status.py +107 -0
  76. opensmi/ros2/server/structures.py +135 -0
  77. opensmi/ros2/server/transforms/__init__.py +39 -0
  78. opensmi/ros2/server/transforms/conversions.py +58 -0
  79. opensmi/ros2/server/transforms/filing.py +340 -0
  80. opensmi/ros2/server/transforms/mirror.py +462 -0
  81. opensmi/ros2/server/transforms/outward.py +180 -0
  82. opensmi/ros2/server/transforms/records.py +195 -0
  83. opensmi/ros2/server/transforms/spatial.py +154 -0
  84. opensmi_ros2-0.1.0.dist-info/METADATA +183 -0
  85. opensmi_ros2-0.1.0.dist-info/RECORD +89 -0
  86. opensmi_ros2-0.1.0.dist-info/WHEEL +5 -0
  87. opensmi_ros2-0.1.0.dist-info/entry_points.txt +2 -0
  88. opensmi_ros2-0.1.0.dist-info/licenses/LICENSES/MIT.txt +18 -0
  89. opensmi_ros2-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,138 @@
1
+ # SPDX-FileCopyrightText: 2026 Technologie-Initiative SmartFactory KL e.V.
2
+ # SPDX-FileCopyrightText: 2021 Neobotix GmbH
3
+ #
4
+ # SPDX-License-Identifier: MIT AND BSD-3-Clause
5
+
6
+ """Static types for the ROS2 interface package ``neo_msgs2``.
7
+
8
+ Generated by `python -m tools.catalog_sync --stubs` from the definition catalog.
9
+ Edit the catalog and regenerate; do not edit this file.
10
+
11
+ A field whose type comes from an interface package the catalog does not carry is annotated
12
+ ``Any``: the catalog holds the packages nothing can install, and inventing a shape for one it
13
+ leaves to apt would be a second source of truth for a structure the installed package already
14
+ states exactly.
15
+ """
16
+
17
+ from dataclasses import dataclass
18
+ from typing import Any
19
+
20
+ from opensmi.ros2.runtime.messages import Message
21
+
22
+ @dataclass(frozen=True, kw_only=True)
23
+ class EmergencyStopState(Message):
24
+ """The ROS2 message ``neo_msgs2/msg/EmergencyStopState``, as it crosses the seam."""
25
+
26
+ header: Any
27
+ emergency_button_stop: bool
28
+ scanner_stop: bool
29
+ software_stop: bool
30
+ remote_emergency_stop: bool
31
+ emergency_state: int
32
+
33
+
34
+ @dataclass(frozen=True, kw_only=True)
35
+ class IOBoard(Message):
36
+ """The ROS2 message ``neo_msgs2/msg/IOBoard``, as it crosses the seam."""
37
+
38
+ header: Any
39
+ digital_inputs: tuple[bool, ...]
40
+ digital_outputs: tuple[bool, ...]
41
+ analog_inputs: tuple[int, ...]
42
+
43
+
44
+ @dataclass(frozen=True, kw_only=True)
45
+ class Keypad(Message):
46
+ """The ROS2 message ``neo_msgs2/msg/Keypad``, as it crosses the seam."""
47
+
48
+ header: Any
49
+ button: tuple[bool, ...]
50
+
51
+
52
+ @dataclass(frozen=True, kw_only=True)
53
+ class KinematicsState(Message):
54
+ """The ROS2 message ``neo_msgs2/msg/KinematicsState``, as it crosses the seam."""
55
+
56
+ time: float
57
+ is_vel_cmd: bool
58
+ is_moving: bool
59
+
60
+
61
+ @dataclass(frozen=True, kw_only=True)
62
+ class LCDOutput(Message):
63
+ """The ROS2 message ``neo_msgs2/msg/LCDOutput``, as it crosses the seam."""
64
+
65
+ header: Any
66
+ msg_line: str
67
+
68
+
69
+ @dataclass(frozen=True, kw_only=True)
70
+ class RelayBoardV2(Message):
71
+ """The ROS2 message ``neo_msgs2/msg/RelayBoardV2``, as it crosses the seam."""
72
+
73
+ header: Any
74
+ relayboardv2_state: tuple[bool, ...]
75
+ communication_state: int
76
+ charging_state: int
77
+ temperature: int
78
+ battery_voltage: float
79
+ charging_current: float
80
+ relay_states: tuple[bool, ...]
81
+ keypad: tuple[bool, ...]
82
+ shutdown: bool
83
+
84
+
85
+ @dataclass(frozen=True, kw_only=True)
86
+ class RelayBoardV3(Message):
87
+ """The ROS2 message ``neo_msgs2/msg/RelayBoardV3``, as it crosses the seam."""
88
+
89
+ time: float
90
+ firmware_version: str
91
+ uptime: float
92
+ ambient_temperature: float
93
+ relay_states: tuple[bool, ...]
94
+ digital_input_states: tuple[bool, ...]
95
+ keypad_button_states: tuple[bool, ...]
96
+ key_switch_off_state: bool
97
+ release_structure_state: bool
98
+ led_state: Any
99
+ system_error: tuple[str, ...]
100
+
101
+
102
+ @dataclass(frozen=True, kw_only=True)
103
+ class SafetyMode(Message):
104
+ """The ROS2 message ``neo_msgs2/msg/SafetyMode``, as it crosses the seam."""
105
+
106
+ header: Any
107
+ mode: int
108
+
109
+
110
+ @dataclass(frozen=True, kw_only=True)
111
+ class SafetyState(Message):
112
+ """The ROS2 message ``neo_msgs2/msg/SafetyState``, as it crosses the seam."""
113
+
114
+ time: float
115
+ current_safety_field: int
116
+ triggered_cutoff_paths: tuple[bool, ...]
117
+
118
+
119
+ @dataclass(frozen=True, kw_only=True)
120
+ class USBoard(Message):
121
+ """The ROS2 message ``neo_msgs2/msg/USBoard``, as it crosses the seam."""
122
+
123
+ header: Any
124
+ sensor: bytes
125
+ analog: tuple[int, ...]
126
+
127
+
128
+ @dataclass(frozen=True, kw_only=True)
129
+ class USBoardV2(Message):
130
+ """The ROS2 message ``neo_msgs2/msg/USBoardV2``, as it crosses the seam."""
131
+
132
+ header: Any
133
+ sensor: tuple[float, ...]
134
+ analog: tuple[int, ...]
135
+ active: tuple[bool, ...]
136
+ warn: tuple[bool, ...]
137
+ alarm: tuple[bool, ...]
138
+
@@ -0,0 +1,72 @@
1
+ # SPDX-FileCopyrightText: 2026 Technologie-Initiative SmartFactory KL e.V.
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+
5
+ """The ROS2 interface package ``neo_srvs2``, as message dataclasses.
6
+
7
+ Generated by `python -m tools.catalog_sync --stubs` from the definition catalog.
8
+ Edit the catalog and regenerate; do not edit this file.
9
+
10
+ ``from opensmi.ros2.runtime.messages.neo_srvs2 import IOBoardSetDigOut_Request`` resolves through
11
+ :func:`~opensmi.ros2.runtime.messages.message_dataclass` at run time and type-checks against the
12
+ generated ``neo_srvs2.pyi`` beside this file. The two halves answer different questions: the stub
13
+ says what the fields *are*, and this module makes sure what you get is the very dataclass every
14
+ Binding carrying that type already holds.
15
+
16
+ Importing a name from here needs the interface package installed, exactly as a Binding on it does
17
+ -- the catalog makes a type describable, never receivable.
18
+ """
19
+
20
+ from __future__ import annotations
21
+
22
+ from typing import TYPE_CHECKING
23
+
24
+ from opensmi.ros2.runtime.messages import message_dataclass
25
+
26
+ if TYPE_CHECKING:
27
+ from opensmi.ros2.runtime.messages import Message
28
+
29
+ _TYPES = {
30
+ "IOBoardSetDigOut_Request": "neo_srvs2/srv/IOBoardSetDigOut_Request",
31
+ "IOBoardSetDigOut_Response": "neo_srvs2/srv/IOBoardSetDigOut_Response",
32
+ "InitializeContourMatching_Request": "neo_srvs2/srv/InitializeContourMatching_Request",
33
+ "InitializeContourMatching_Response": "neo_srvs2/srv/InitializeContourMatching_Response",
34
+ "LockPlatform_Request": "neo_srvs2/srv/LockPlatform_Request",
35
+ "LockPlatform_Response": "neo_srvs2/srv/LockPlatform_Response",
36
+ "Optimizer_Request": "neo_srvs2/srv/Optimizer_Request",
37
+ "Optimizer_Response": "neo_srvs2/srv/Optimizer_Response",
38
+ "RelayBoardSetEMStop_Request": "neo_srvs2/srv/RelayBoardSetEMStop_Request",
39
+ "RelayBoardSetEMStop_Response": "neo_srvs2/srv/RelayBoardSetEMStop_Response",
40
+ "RelayBoardSetLCDMsg_Request": "neo_srvs2/srv/RelayBoardSetLCDMsg_Request",
41
+ "RelayBoardSetLCDMsg_Response": "neo_srvs2/srv/RelayBoardSetLCDMsg_Response",
42
+ "RelayBoardSetLED_Request": "neo_srvs2/srv/RelayBoardSetLED_Request",
43
+ "RelayBoardSetLED_Response": "neo_srvs2/srv/RelayBoardSetLED_Response",
44
+ "RelayBoardSetRelay_Request": "neo_srvs2/srv/RelayBoardSetRelay_Request",
45
+ "RelayBoardSetRelay_Response": "neo_srvs2/srv/RelayBoardSetRelay_Response",
46
+ "RelayBoardSetSafetyMode_Request": "neo_srvs2/srv/RelayBoardSetSafetyMode_Request",
47
+ "RelayBoardSetSafetyMode_Response": "neo_srvs2/srv/RelayBoardSetSafetyMode_Response",
48
+ "RelayBoardUnSetEMStop_Request": "neo_srvs2/srv/RelayBoardUnSetEMStop_Request",
49
+ "RelayBoardUnSetEMStop_Response": "neo_srvs2/srv/RelayBoardUnSetEMStop_Response",
50
+ "ResetOmniWheels_Request": "neo_srvs2/srv/ResetOmniWheels_Request",
51
+ "ResetOmniWheels_Response": "neo_srvs2/srv/ResetOmniWheels_Response",
52
+ "SetSafetyField_Request": "neo_srvs2/srv/SetSafetyField_Request",
53
+ "SetSafetyField_Response": "neo_srvs2/srv/SetSafetyField_Response",
54
+ "USBoardToggleSensor_Request": "neo_srvs2/srv/USBoardToggleSensor_Request",
55
+ "USBoardToggleSensor_Response": "neo_srvs2/srv/USBoardToggleSensor_Response",
56
+ "UnlockPlatform_Request": "neo_srvs2/srv/UnlockPlatform_Request",
57
+ "UnlockPlatform_Response": "neo_srvs2/srv/UnlockPlatform_Response",
58
+ }
59
+
60
+
61
+ def __getattr__(name: str) -> type[Message]:
62
+ """Return the message dataclass one of this package's types is built as."""
63
+ type_name = _TYPES.get(name)
64
+ if type_name is None:
65
+ message = f"module {__name__!r} has no attribute {name!r}"
66
+ raise AttributeError(message)
67
+ return message_dataclass(type_name)
68
+
69
+
70
+ def __dir__() -> list[str]:
71
+ """List what this module answers for, since it has no module-level names of its own."""
72
+ return sorted(_TYPES)
@@ -0,0 +1,224 @@
1
+ # SPDX-FileCopyrightText: 2026 Technologie-Initiative SmartFactory KL e.V.
2
+ # SPDX-FileCopyrightText: 2021 Neobotix GmbH
3
+ #
4
+ # SPDX-License-Identifier: MIT AND BSD-3-Clause
5
+
6
+ """Static types for the ROS2 interface package ``neo_srvs2``.
7
+
8
+ Generated by `python -m tools.catalog_sync --stubs` from the definition catalog.
9
+ Edit the catalog and regenerate; do not edit this file.
10
+
11
+ A field whose type comes from an interface package the catalog does not carry is annotated
12
+ ``Any``: the catalog holds the packages nothing can install, and inventing a shape for one it
13
+ leaves to apt would be a second source of truth for a structure the installed package already
14
+ states exactly.
15
+ """
16
+
17
+ from dataclasses import dataclass
18
+ from typing import Any
19
+
20
+ from opensmi.ros2.runtime.messages import Message
21
+
22
+ @dataclass(frozen=True, kw_only=True)
23
+ class IOBoardSetDigOut_Request(Message):
24
+ """The ROS2 message ``neo_srvs2/srv/IOBoardSetDigOut_Request``, as it crosses the seam."""
25
+
26
+ id: int
27
+ state: bool
28
+
29
+
30
+ @dataclass(frozen=True, kw_only=True)
31
+ class IOBoardSetDigOut_Response(Message):
32
+ """The ROS2 message ``neo_srvs2/srv/IOBoardSetDigOut_Response``, as it crosses the seam."""
33
+
34
+ success: bool
35
+
36
+
37
+ @dataclass(frozen=True, kw_only=True)
38
+ class InitializeContourMatching_Request(Message):
39
+ """The ROS2 message ``neo_srvs2/srv/InitializeContourMatching_Request``, as it crosses the seam."""
40
+
41
+ init_pose: Any
42
+
43
+
44
+ @dataclass(frozen=True, kw_only=True)
45
+ class InitializeContourMatching_Response(Message):
46
+ """The ROS2 message ``neo_srvs2/srv/InitializeContourMatching_Response``, as it crosses the seam."""
47
+
48
+ success: bool
49
+
50
+
51
+ @dataclass(frozen=True, kw_only=True)
52
+ class LockPlatform_Request(Message):
53
+ """The ROS2 message ``neo_srvs2/srv/LockPlatform_Request``, as it crosses the seam."""
54
+
55
+ ...
56
+
57
+
58
+ @dataclass(frozen=True, kw_only=True)
59
+ class LockPlatform_Response(Message):
60
+ """The ROS2 message ``neo_srvs2/srv/LockPlatform_Response``, as it crosses the seam."""
61
+
62
+ success: bool
63
+
64
+
65
+ @dataclass(frozen=True, kw_only=True)
66
+ class Optimizer_Request(Message):
67
+ """The ROS2 message ``neo_srvs2/srv/Optimizer_Request``, as it crosses the seam."""
68
+
69
+ current_pose: Any
70
+ current_vel: Any
71
+ carrot_pose: Any
72
+ goal_pose: Any
73
+ switch_opt: bool
74
+ control_interval: float
75
+
76
+
77
+ @dataclass(frozen=True, kw_only=True)
78
+ class Optimizer_Response(Message):
79
+ """The ROS2 message ``neo_srvs2/srv/Optimizer_Response``, as it crosses the seam."""
80
+
81
+ output_vel: Any
82
+
83
+
84
+ @dataclass(frozen=True, kw_only=True)
85
+ class RelayBoardSetEMStop_Request(Message):
86
+ """The ROS2 message ``neo_srvs2/srv/RelayBoardSetEMStop_Request``, as it crosses the seam."""
87
+
88
+ ...
89
+
90
+
91
+ @dataclass(frozen=True, kw_only=True)
92
+ class RelayBoardSetEMStop_Response(Message):
93
+ """The ROS2 message ``neo_srvs2/srv/RelayBoardSetEMStop_Response``, as it crosses the seam."""
94
+
95
+ success: bool
96
+
97
+
98
+ @dataclass(frozen=True, kw_only=True)
99
+ class RelayBoardSetLCDMsg_Request(Message):
100
+ """The ROS2 message ``neo_srvs2/srv/RelayBoardSetLCDMsg_Request``, as it crosses the seam."""
101
+
102
+ message: str
103
+
104
+
105
+ @dataclass(frozen=True, kw_only=True)
106
+ class RelayBoardSetLCDMsg_Response(Message):
107
+ """The ROS2 message ``neo_srvs2/srv/RelayBoardSetLCDMsg_Response``, as it crosses the seam."""
108
+
109
+ success: bool
110
+
111
+
112
+ @dataclass(frozen=True, kw_only=True)
113
+ class RelayBoardSetLED_Request(Message):
114
+ """The ROS2 message ``neo_srvs2/srv/RelayBoardSetLED_Request``, as it crosses the seam."""
115
+
116
+ led_state: Any
117
+
118
+
119
+ @dataclass(frozen=True, kw_only=True)
120
+ class RelayBoardSetLED_Response(Message):
121
+ """The ROS2 message ``neo_srvs2/srv/RelayBoardSetLED_Response``, as it crosses the seam."""
122
+
123
+ success: bool
124
+
125
+
126
+ @dataclass(frozen=True, kw_only=True)
127
+ class RelayBoardSetRelay_Request(Message):
128
+ """The ROS2 message ``neo_srvs2/srv/RelayBoardSetRelay_Request``, as it crosses the seam."""
129
+
130
+ id: int
131
+ state: bool
132
+
133
+
134
+ @dataclass(frozen=True, kw_only=True)
135
+ class RelayBoardSetRelay_Response(Message):
136
+ """The ROS2 message ``neo_srvs2/srv/RelayBoardSetRelay_Response``, as it crosses the seam."""
137
+
138
+ success: bool
139
+
140
+
141
+ @dataclass(frozen=True, kw_only=True)
142
+ class RelayBoardSetSafetyMode_Request(Message):
143
+ """The ROS2 message ``neo_srvs2/srv/RelayBoardSetSafetyMode_Request``, as it crosses the seam."""
144
+
145
+ set_safety_mode: Any
146
+ station: int
147
+
148
+
149
+ @dataclass(frozen=True, kw_only=True)
150
+ class RelayBoardSetSafetyMode_Response(Message):
151
+ """The ROS2 message ``neo_srvs2/srv/RelayBoardSetSafetyMode_Response``, as it crosses the seam."""
152
+
153
+ success: bool
154
+
155
+
156
+ @dataclass(frozen=True, kw_only=True)
157
+ class RelayBoardUnSetEMStop_Request(Message):
158
+ """The ROS2 message ``neo_srvs2/srv/RelayBoardUnSetEMStop_Request``, as it crosses the seam."""
159
+
160
+ ...
161
+
162
+
163
+ @dataclass(frozen=True, kw_only=True)
164
+ class RelayBoardUnSetEMStop_Response(Message):
165
+ """The ROS2 message ``neo_srvs2/srv/RelayBoardUnSetEMStop_Response``, as it crosses the seam."""
166
+
167
+ success: bool
168
+
169
+
170
+ @dataclass(frozen=True, kw_only=True)
171
+ class ResetOmniWheels_Request(Message):
172
+ """The ROS2 message ``neo_srvs2/srv/ResetOmniWheels_Request``, as it crosses the seam."""
173
+
174
+ steer_angles_rad: tuple[float, ...]
175
+
176
+
177
+ @dataclass(frozen=True, kw_only=True)
178
+ class ResetOmniWheels_Response(Message):
179
+ """The ROS2 message ``neo_srvs2/srv/ResetOmniWheels_Response``, as it crosses the seam."""
180
+
181
+ success: bool
182
+
183
+
184
+ @dataclass(frozen=True, kw_only=True)
185
+ class SetSafetyField_Request(Message):
186
+ """The ROS2 message ``neo_srvs2/srv/SetSafetyField_Request``, as it crosses the seam."""
187
+
188
+ field_id: int
189
+
190
+
191
+ @dataclass(frozen=True, kw_only=True)
192
+ class SetSafetyField_Response(Message):
193
+ """The ROS2 message ``neo_srvs2/srv/SetSafetyField_Response``, as it crosses the seam."""
194
+
195
+ success: bool
196
+
197
+
198
+ @dataclass(frozen=True, kw_only=True)
199
+ class USBoardToggleSensor_Request(Message):
200
+ """The ROS2 message ``neo_srvs2/srv/USBoardToggleSensor_Request``, as it crosses the seam."""
201
+
202
+ state: tuple[bool, ...]
203
+
204
+
205
+ @dataclass(frozen=True, kw_only=True)
206
+ class USBoardToggleSensor_Response(Message):
207
+ """The ROS2 message ``neo_srvs2/srv/USBoardToggleSensor_Response``, as it crosses the seam."""
208
+
209
+ success: bool
210
+
211
+
212
+ @dataclass(frozen=True, kw_only=True)
213
+ class UnlockPlatform_Request(Message):
214
+ """The ROS2 message ``neo_srvs2/srv/UnlockPlatform_Request``, as it crosses the seam."""
215
+
216
+ ...
217
+
218
+
219
+ @dataclass(frozen=True, kw_only=True)
220
+ class UnlockPlatform_Response(Message):
221
+ """The ROS2 message ``neo_srvs2/srv/UnlockPlatform_Response``, as it crosses the seam."""
222
+
223
+ success: bool
224
+
@@ -0,0 +1,103 @@
1
+ # SPDX-FileCopyrightText: 2026 Technologie-Initiative SmartFactory KL e.V.
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+
5
+ """What the Runtime returns when the thing asked for happened and went badly.
6
+
7
+ The counterpart of :mod:`opensmi.ros2.runtime.errors`: an outcome is a value, and ignoring it costs
8
+ the report rather than correctness. :class:`StopOutcome` reports a stop and :class:`GoalOutcome` a
9
+ goal that was rejected, aborted or cancelled. A goal nobody received raises
10
+ :class:`~opensmi.ros2.runtime.errors.ActionServerUnavailableError` instead.
11
+
12
+ :class:`GoalStatus` restates the numbers of ``action_msgs/msg/GoalStatus`` so this half imports
13
+ without ROS2; a Jazzy test checks that the copy agrees.
14
+ """
15
+
16
+ from __future__ import annotations
17
+
18
+ from dataclasses import dataclass
19
+ from enum import IntEnum
20
+ from typing import TYPE_CHECKING
21
+
22
+ if TYPE_CHECKING:
23
+ from opensmi.ros2.runtime.messages import Message
24
+
25
+ __all__ = ["GoalOutcome", "GoalStatus", "Outcome", "StopOutcome"]
26
+
27
+
28
+ @dataclass(frozen=True, slots=True, kw_only=True)
29
+ class Outcome:
30
+ """The report of an operation that ran to completion, well or badly.
31
+
32
+ :ivar faults: One human-readable line per thing that went wrong, in the order it went wrong.
33
+ Empty when the operation went cleanly.
34
+ """
35
+
36
+ faults: tuple[str, ...]
37
+
38
+ @property
39
+ def ok(self) -> bool:
40
+ """Return whether the operation went cleanly."""
41
+ return not self.faults
42
+
43
+
44
+ @dataclass(frozen=True, slots=True, kw_only=True)
45
+ class StopOutcome(Outcome):
46
+ """The report of :meth:`Runtime.stop`.
47
+
48
+ Stopping always leaves the Runtime stopped, so it reports and does not raise. A still-spinning
49
+ executor thread holds a Context that a second Runtime on the same Domain ID would race.
50
+
51
+ :ivar executor_thread_joined: Whether the executor thread ended within the stop timeout.
52
+ """
53
+
54
+ executor_thread_joined: bool
55
+
56
+
57
+ class GoalStatus(IntEnum):
58
+ """Where a ROS2 goal ended up, as ``action_msgs/msg/GoalStatus`` numbers it.
59
+
60
+ There is no ``REJECTED`` member: ROS2 gives a rejected goal no status, so
61
+ :attr:`GoalOutcome.accepted` carries that fact.
62
+ """
63
+
64
+ UNKNOWN = 0
65
+ ACCEPTED = 1
66
+ EXECUTING = 2
67
+ CANCELING = 3
68
+ SUCCEEDED = 4
69
+ CANCELED = 5
70
+ ABORTED = 6
71
+
72
+
73
+ @dataclass(frozen=True, slots=True, kw_only=True)
74
+ class GoalOutcome(Outcome):
75
+ """How one ROS2 goal ended, and what it ended with.
76
+
77
+ The status is the single fact; the properties derive from it, and :attr:`Outcome.ok` agrees
78
+ because every ending except success carries exactly one fault line.
79
+
80
+ :ivar accepted: Whether the server took the goal at all.
81
+ :ivar status: Where the goal ended up, as ROS2 reports it.
82
+ :ivar result: The result message, or ``None`` when the goal was rejected. An aborted or
83
+ cancelled goal often has a partial one.
84
+ """
85
+
86
+ accepted: bool
87
+ status: GoalStatus
88
+ result: Message | None
89
+
90
+ @property
91
+ def succeeded(self) -> bool:
92
+ """Return whether the goal ran to completion and the server said so."""
93
+ return self.accepted and self.status is GoalStatus.SUCCEEDED
94
+
95
+ @property
96
+ def canceled(self) -> bool:
97
+ """Return whether the goal stopped because somebody asked it to."""
98
+ return self.accepted and self.status is GoalStatus.CANCELED
99
+
100
+ @property
101
+ def aborted(self) -> bool:
102
+ """Return whether the server gave up on the goal itself."""
103
+ return self.accepted and self.status is GoalStatus.ABORTED