Skip to content

Commit 17a1761

Browse files
Remove transition_pause parameter from YAML configuration (#14)
1 parent 8a24df6 commit 17a1761

5 files changed

Lines changed: 2 additions & 20 deletions

File tree

foreman/config/scenario.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
controller_manager: b_controlled_box_cm
22

3-
transition_pause: 0.5
4-
53
hardware:
64
- FrankaHardwareInterface
75
- kassow

foreman/foreman/node.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def __init__(self):
2525
# for error handling ,so we know what and when failed and who to blame
2626
self._service_call_active_future = False
2727
self._active_transition = None
28-
self.last_transition_time = self.get_clock().now()
2928

3029
self.callback_group_services = MutuallyExclusiveCallbackGroup()
3130
self.callback_group_subscriber = ReentrantCallbackGroup()
@@ -119,17 +118,11 @@ def callback_main_loop(self):
119118
finally:
120119
self._service_call_active_future = None
121120
self._active_transition = None
122-
self.last_transition_time = self.get_clock().now()
123121

124122
# prevent concurrent service calls to components
125123
if self._service_call_active_future:
126124
return
127125

128-
# throttle transitions by transition_pause
129-
time_since_last = (self.get_clock().now() - self.last_transition_time).nanoseconds / 1e9
130-
if time_since_last < self.foreman_config.transition_pause:
131-
return
132-
133126
# Ok, now we get next command
134127
command = self.foreman_engine.get_next_transition()
135128
if not command:

foreman/foreman/parser.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class ParsedScenario:
2323
"""Complete parsed scenario configuration."""
2424

2525
controller_manager: str
26-
transition_pause: float
2726
hardware: List[str]
2827
dependency_rules: List[ControllerDependencyRule]
2928
goals: Dict[str, SystemGoal]
@@ -98,7 +97,6 @@ def parse_yaml_file(file_path: Path) -> ParsedScenario:
9897
raise ValueError("Empty YAML file")
9998

10099
controller_manager = data.get('controller_manager', '')
101-
transition_pause = data.get('transition_pause', 0.0)
102100
hardware = data.get('hardware', [])
103101
lifecycle_nodes = data.get('lifecycle_nodes', [])
104102

@@ -149,8 +147,8 @@ def parse_yaml_file(file_path: Path) -> ParsedScenario:
149147
)
150148

151149
metadata = {}
152-
known_keys = {'controller_manager', 'transition_pause',
153-
'hardware', 'lifecycle_nodes', 'controllers', 'goal_states'}
150+
known_keys = {'controller_manager', 'hardware',
151+
'lifecycle_nodes', 'controllers', 'goal_states'}
154152
for key, value in data.items():
155153
if key not in known_keys:
156154
metadata[key] = value
@@ -165,7 +163,6 @@ def parse_yaml_file(file_path: Path) -> ParsedScenario:
165163

166164
return ParsedScenario(
167165
controller_manager=controller_manager,
168-
transition_pause=transition_pause,
169166
hardware=hardware,
170167
lifecycle_nodes=lifecycle_nodes,
171168
dependency_rules=dependency_rules,

foreman/test/test_engine.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def minimal_foreman_config():
1818
hardware_goals=[Component('hw1', ComponentType.HARDWARE, LifecycleState.ACTIVE)])
1919
return ParsedScenario(
2020
controller_manager="test_cm",
21-
transition_pause=0.0,
2221
hardware=["hw1"],
2322
dependency_rules=[],
2423
goals={'active_goal': goal},
@@ -138,7 +137,6 @@ def lifecycle_foreman_config():
138137
lifecycle_node_goals=[Component('robot_manager', ComponentType.LIFECYCLE_NODE, LifecycleState.ACTIVE)])
139138
return ParsedScenario(
140139
controller_manager="test_cm",
141-
transition_pause=0.0,
142140
hardware=[],
143141
dependency_rules=[],
144142
goals={'active_goal': goal},
@@ -233,7 +231,6 @@ def dependency_config():
233231

234232
return ParsedScenario(
235233
controller_manager="test_cm",
236-
transition_pause=0.0,
237234
hardware=[],
238235
dependency_rules=rules,
239236
goals={'active': goal_missing_dep, 'active_full': goal_with_dep},

foreman/test/test_parser.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ class TestParsedScenario:
3030
def test_controller_manager(self, parsed_scenario):
3131
assert parsed_scenario.controller_manager == "b_controlled_box_cm"
3232

33-
def test_transition_pause(self, parsed_scenario):
34-
assert parsed_scenario.transition_pause == 0.5
35-
3633
def test_hardware_list(self, parsed_scenario):
3734
assert parsed_scenario.hardware == ["FrankaHardwareInterface", "kassow"]
3835

0 commit comments

Comments
 (0)