rainbow-rb-flow-manager 0.0.9.dev5__tar.gz → 0.0.9.dev7__tar.gz
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.
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/PKG-INFO +7 -7
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/pyproject.toml +7 -7
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow/rb_flow_manager/context.py +34 -6
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow/rb_flow_manager/controller/zenoh_controller.py +1 -1
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow/rb_flow_manager/executor.py +1 -1
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow/rb_flow_manager/step.py +14 -4
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow_rb_flow_manager.egg-info/PKG-INFO +7 -7
- rainbow_rb_flow_manager-0.0.9.dev7/src/rainbow_rb_flow_manager.egg-info/requires.txt +6 -0
- rainbow_rb_flow_manager-0.0.9.dev5/src/rainbow_rb_flow_manager.egg-info/requires.txt +0 -6
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/README.md +0 -0
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/setup.cfg +0 -0
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow/rb_flow_manager/__init__.py +0 -0
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow/rb_flow_manager/controller/base_controller.py +0 -0
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow/rb_flow_manager/example.py +0 -0
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow/rb_flow_manager/exception.py +0 -0
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow/rb_flow_manager/global_resolver.py +0 -0
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow/rb_flow_manager/py.typed +0 -0
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow/rb_flow_manager/schema.py +0 -0
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow/rb_flow_manager/utils.py +0 -0
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow_rb_flow_manager.egg-info/SOURCES.txt +0 -0
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow_rb_flow_manager.egg-info/dependency_links.txt +0 -0
- {rainbow_rb_flow_manager-0.0.9.dev5 → rainbow_rb_flow_manager-0.0.9.dev7}/src/rainbow_rb_flow_manager.egg-info/top_level.txt +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rainbow-rb-flow-manager
|
|
3
|
-
Version: 0.0.9.
|
|
3
|
+
Version: 0.0.9.dev7
|
|
4
4
|
Summary: Rainbow Python Flow Manager
|
|
5
5
|
Author-email: Derek <dfd1123@rainbow-robotics.com>
|
|
6
6
|
Requires-Python: <3.13,>=3.12
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist: rainbow-rb-utils==0.0.9.
|
|
9
|
-
Requires-Dist: rainbow-rb-zenoh==0.0.9.
|
|
10
|
-
Requires-Dist: rainbow-rb-flat-buffers==0.0.9.
|
|
11
|
-
Requires-Dist: rainbow-rb-schemas==0.0.9.
|
|
12
|
-
Requires-Dist: rainbow-rb-sdk==0.0.9.
|
|
13
|
-
Requires-Dist: rainbow-rb-log==0.0.9.
|
|
8
|
+
Requires-Dist: rainbow-rb-utils==0.0.9.dev7
|
|
9
|
+
Requires-Dist: rainbow-rb-zenoh==0.0.9.dev7
|
|
10
|
+
Requires-Dist: rainbow-rb-flat-buffers==0.0.9.dev7
|
|
11
|
+
Requires-Dist: rainbow-rb-schemas==0.0.9.dev7
|
|
12
|
+
Requires-Dist: rainbow-rb-sdk==0.0.9.dev7
|
|
13
|
+
Requires-Dist: rainbow-rb-log==0.0.9.dev7
|
|
14
14
|
|
|
15
15
|
# rb_flow_manager 사용 설명서
|
|
16
16
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "rainbow-rb-flow-manager"
|
|
7
|
-
version = "0.0.9.
|
|
7
|
+
version = "0.0.9.dev7"
|
|
8
8
|
requires-python = ">=3.12,<3.13"
|
|
9
9
|
description = "Rainbow Python Flow Manager"
|
|
10
10
|
authors = [
|
|
@@ -13,12 +13,12 @@ authors = [
|
|
|
13
13
|
readme = "README.md"
|
|
14
14
|
|
|
15
15
|
dependencies = [
|
|
16
|
-
"rainbow-rb-utils==0.0.9.
|
|
17
|
-
"rainbow-rb-zenoh==0.0.9.
|
|
18
|
-
"rainbow-rb-flat-buffers==0.0.9.
|
|
19
|
-
"rainbow-rb-schemas==0.0.9.
|
|
20
|
-
"rainbow-rb-sdk==0.0.9.
|
|
21
|
-
"rainbow-rb-log==0.0.9.
|
|
16
|
+
"rainbow-rb-utils==0.0.9.dev7",
|
|
17
|
+
"rainbow-rb-zenoh==0.0.9.dev7",
|
|
18
|
+
"rainbow-rb-flat-buffers==0.0.9.dev7",
|
|
19
|
+
"rainbow-rb-schemas==0.0.9.dev7",
|
|
20
|
+
"rainbow-rb-sdk==0.0.9.dev7",
|
|
21
|
+
"rainbow-rb-log==0.0.9.dev7",
|
|
22
22
|
]
|
|
23
23
|
|
|
24
24
|
[tool.setuptools]
|
|
@@ -24,6 +24,8 @@ from rainbow.rb_utils.parser import t_to_dict
|
|
|
24
24
|
from .exception import BreakFolder, StopExecution, SubTaskHaltException
|
|
25
25
|
from .schema import ExecutorState, RB_Flow_Manager_ProgramState
|
|
26
26
|
|
|
27
|
+
_MISSING = object()
|
|
28
|
+
|
|
27
29
|
|
|
28
30
|
class ExecutionContext:
|
|
29
31
|
"""스크립트 실행 컨텍스트"""
|
|
@@ -169,6 +171,31 @@ class ExecutionContext:
|
|
|
169
171
|
except Exception as e:
|
|
170
172
|
raise e
|
|
171
173
|
|
|
174
|
+
def get_var(self, pid_or_robot_model: str, var_name: str, default: Any = _MISSING) -> Any:
|
|
175
|
+
all_dicts = self.shared_state_dicts or {}
|
|
176
|
+
|
|
177
|
+
# pid 직접 매치 우선, 없으면 robot_model로 탐색
|
|
178
|
+
target_state = all_dicts.get(pid_or_robot_model)
|
|
179
|
+
if target_state is None:
|
|
180
|
+
for sd in all_dicts.values():
|
|
181
|
+
if sd.get("robot_model") == pid_or_robot_model:
|
|
182
|
+
target_state = sd
|
|
183
|
+
break
|
|
184
|
+
|
|
185
|
+
if target_state is None:
|
|
186
|
+
if default is not _MISSING:
|
|
187
|
+
return default
|
|
188
|
+
raise RuntimeError(f"get_var: process '{pid_or_robot_model}' not found")
|
|
189
|
+
|
|
190
|
+
raw_vars: dict[str, Any] = dict(target_state.get("variables", {}))
|
|
191
|
+
entry = raw_vars.get(var_name)
|
|
192
|
+
if entry is None:
|
|
193
|
+
if default is not _MISSING:
|
|
194
|
+
return default
|
|
195
|
+
raise RuntimeError(f"get_var: variable '{var_name}' not found in '{pid_or_robot_model}'")
|
|
196
|
+
|
|
197
|
+
return entry.get("value") if isinstance(entry, dict) else entry
|
|
198
|
+
|
|
172
199
|
def _ensure_sdk_roots(self):
|
|
173
200
|
if self._sdk_roots is not None:
|
|
174
201
|
return
|
|
@@ -589,13 +616,14 @@ class ExecutionContext:
|
|
|
589
616
|
raise SubTaskHaltException()
|
|
590
617
|
|
|
591
618
|
def _safe_close_sdk(self):
|
|
592
|
-
"""SDK 안전 종료
|
|
619
|
+
"""SDK 안전 종료
|
|
620
|
+
|
|
621
|
+
부모 SDK(RBManipulateSDK 등)가 자식 SDK 9개를 자동 instantiate 하기 때문에
|
|
622
|
+
_sdk_roots만 close하면 ref-count가 0에 도달하지 못해 ZenohClient leak이
|
|
623
|
+
발생한다. 현재 pid에 등록된 모든 RBBaseSDK 서브클래스 인스턴스를 일괄 close.
|
|
624
|
+
"""
|
|
593
625
|
with contextlib.suppress(Exception):
|
|
594
|
-
|
|
595
|
-
for sdk in self._sdk_roots.values():
|
|
596
|
-
close_fn = getattr(sdk, "close", None)
|
|
597
|
-
if callable(close_fn):
|
|
598
|
-
close_fn()
|
|
626
|
+
RBBaseSDK.close_all_for_pid()
|
|
599
627
|
|
|
600
628
|
def close(self):
|
|
601
629
|
"""안전하게 close"""
|
|
@@ -24,7 +24,7 @@ from rainbow.rb_flat_buffers.program.Request_Update_Sub_Task_State import Reques
|
|
|
24
24
|
from rainbow.rb_flow_manager.controller.base_controller import BaseController
|
|
25
25
|
from rainbow.rb_log.log import rb_log
|
|
26
26
|
from rainbow.rb_zenoh.client import ZenohClient
|
|
27
|
-
from rainbow.rb_zenoh.
|
|
27
|
+
from rainbow.rb_zenoh.exception import ZenohNoReply, ZenohReplyError
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
class Zenoh_Controller(BaseController):
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import copy
|
|
1
2
|
import importlib
|
|
2
3
|
import sys
|
|
3
4
|
import time
|
|
@@ -356,10 +357,13 @@ class Step:
|
|
|
356
357
|
|
|
357
358
|
if fn is not None and not self.disabled and not is_skip:
|
|
358
359
|
done_event = Event()
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
360
|
+
try:
|
|
361
|
+
variables_before_call = copy.deepcopy(ctx.variables)
|
|
362
|
+
except Exception:
|
|
363
|
+
variables_before_call = {
|
|
364
|
+
"local": dict(ctx.variables.get("local", {})),
|
|
365
|
+
"global": dict(ctx.variables.get("global", {})),
|
|
366
|
+
}
|
|
363
367
|
|
|
364
368
|
def done():
|
|
365
369
|
nonlocal done_called
|
|
@@ -375,6 +379,7 @@ class Step:
|
|
|
375
379
|
self.done_script,
|
|
376
380
|
variables=ctx.variables,
|
|
377
381
|
get_global_variable=ctx.get_global_variable,
|
|
382
|
+
get_var=ctx.get_var,
|
|
378
383
|
)
|
|
379
384
|
else:
|
|
380
385
|
self.done_script()
|
|
@@ -417,6 +422,7 @@ class Step:
|
|
|
417
422
|
v,
|
|
418
423
|
variables=ctx.variables,
|
|
419
424
|
get_global_variable=ctx.get_global_variable,
|
|
425
|
+
get_var=ctx.get_var,
|
|
420
426
|
)
|
|
421
427
|
|
|
422
428
|
if self.variable:
|
|
@@ -438,6 +444,7 @@ class Step:
|
|
|
438
444
|
v,
|
|
439
445
|
variables=ctx.variables,
|
|
440
446
|
get_global_variable=ctx.get_global_variable,
|
|
447
|
+
get_var=ctx.get_var,
|
|
441
448
|
)
|
|
442
449
|
|
|
443
450
|
resolved_variables[k] = v
|
|
@@ -720,6 +727,7 @@ class RepeatStep(Step):
|
|
|
720
727
|
self.while_cond,
|
|
721
728
|
variables=ctx.variables,
|
|
722
729
|
get_global_variable=ctx.get_global_variable,
|
|
730
|
+
get_var=ctx.get_var,
|
|
723
731
|
):
|
|
724
732
|
try:
|
|
725
733
|
self._pre_execute(ctx, is_skip=is_skip)
|
|
@@ -764,6 +772,7 @@ class RepeatStep(Step):
|
|
|
764
772
|
self.do_while,
|
|
765
773
|
variables=ctx.variables,
|
|
766
774
|
get_global_variable=ctx.get_global_variable,
|
|
775
|
+
get_var=ctx.get_var,
|
|
767
776
|
):
|
|
768
777
|
break
|
|
769
778
|
else:
|
|
@@ -922,6 +931,7 @@ class ConditionStep(Step):
|
|
|
922
931
|
condition_expr,
|
|
923
932
|
variables=ctx.variables,
|
|
924
933
|
get_global_variable=ctx.get_global_variable,
|
|
934
|
+
get_var=ctx.get_var,
|
|
925
935
|
):
|
|
926
936
|
post_execute_and_execute_children()
|
|
927
937
|
return
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rainbow-rb-flow-manager
|
|
3
|
-
Version: 0.0.9.
|
|
3
|
+
Version: 0.0.9.dev7
|
|
4
4
|
Summary: Rainbow Python Flow Manager
|
|
5
5
|
Author-email: Derek <dfd1123@rainbow-robotics.com>
|
|
6
6
|
Requires-Python: <3.13,>=3.12
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist: rainbow-rb-utils==0.0.9.
|
|
9
|
-
Requires-Dist: rainbow-rb-zenoh==0.0.9.
|
|
10
|
-
Requires-Dist: rainbow-rb-flat-buffers==0.0.9.
|
|
11
|
-
Requires-Dist: rainbow-rb-schemas==0.0.9.
|
|
12
|
-
Requires-Dist: rainbow-rb-sdk==0.0.9.
|
|
13
|
-
Requires-Dist: rainbow-rb-log==0.0.9.
|
|
8
|
+
Requires-Dist: rainbow-rb-utils==0.0.9.dev7
|
|
9
|
+
Requires-Dist: rainbow-rb-zenoh==0.0.9.dev7
|
|
10
|
+
Requires-Dist: rainbow-rb-flat-buffers==0.0.9.dev7
|
|
11
|
+
Requires-Dist: rainbow-rb-schemas==0.0.9.dev7
|
|
12
|
+
Requires-Dist: rainbow-rb-sdk==0.0.9.dev7
|
|
13
|
+
Requires-Dist: rainbow-rb-log==0.0.9.dev7
|
|
14
14
|
|
|
15
15
|
# rb_flow_manager 사용 설명서
|
|
16
16
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|