Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing a child of a Sequence with memory=True causes AssertionError #421

Open
nikola-j opened this issue May 4, 2023 · 0 comments
Open

Comments

@nikola-j
Copy link

nikola-j commented May 4, 2023

Calling replace_child will call remove_child which will set the current_child to None.

This will cause an assertation error next time the Sequence ticks, when it asserts that the current child is not None

Example traceback

[executor_node-1] Traceback (most recent call last):
[executor_node-1]   File "/home/nikola/Documents/Work/wm_ws/install/wm_executor/lib/wm_executor/executor_node", line 33, in <module>
[executor_node-1]     sys.exit(load_entry_point('wm-executor', 'console_scripts', 'executor_node')())
[executor_node-1]   File "/home/nikola/Documents/Work/wm_ws/build/wm_executor/wm_executor/executor_node.py", line 594, in main
[executor_node-1]     executor.spin()
[executor_node-1]   File "/home/nikola/Documents/Work/wm_ws/install/rclpy/local/lib/python3.10/dist-packages/rclpy/executors.py", line 279, in spin
[executor_node-1]     self.spin_once()
[executor_node-1]   File "/home/nikola/Documents/Work/wm_ws/install/rclpy/local/lib/python3.10/dist-packages/rclpy/executors.py", line 764, in spin_once
[executor_node-1]     self._spin_once_impl(timeout_sec)
[executor_node-1]   File "/home/nikola/Documents/Work/wm_ws/install/rclpy/local/lib/python3.10/dist-packages/rclpy/executors.py", line 761, in _spin_once_impl
[executor_node-1]     future.result()
[executor_node-1]   File "/home/nikola/Documents/Work/wm_ws/install/rclpy/local/lib/python3.10/dist-packages/rclpy/task.py", line 94, in result
[executor_node-1]     raise self.exception()
[executor_node-1]   File "/home/nikola/Documents/Work/wm_ws/install/rclpy/local/lib/python3.10/dist-packages/rclpy/task.py", line 239, in __call__
[executor_node-1]     self._handler.send(None)
[executor_node-1]   File "/home/nikola/Documents/Work/wm_ws/install/rclpy/local/lib/python3.10/dist-packages/rclpy/executors.py", line 418, in handler
[executor_node-1]     await call_coroutine(entity, arg)
[executor_node-1]   File "/home/nikola/Documents/Work/wm_ws/install/rclpy/local/lib/python3.10/dist-packages/rclpy/executors.py", line 332, in _execute_timer
[executor_node-1]     await await_or_execute(tmr.callback)
[executor_node-1]   File "/home/nikola/Documents/Work/wm_ws/install/rclpy/local/lib/python3.10/dist-packages/rclpy/executors.py", line 107, in await_or_execute
[executor_node-1]     return callback(*args)
[executor_node-1]   File "/home/nikola/Documents/Work/wm_ws/build/py_trees_ros/py_trees_ros/trees.py", line 573, in _tick_tock_timer_callback
[executor_node-1]     self.tick(pre_tick_handler, post_tick_handler)
[executor_node-1]   File "/home/nikola/.local/lib/python3.10/site-packages/py_trees/trees.py", line 412, in tick
[executor_node-1]     for node in self.root.tick():
[executor_node-1]   File "/home/nikola/.local/lib/python3.10/site-packages/py_trees/composites.py", line 714, in tick
[executor_node-1]     for node in child.tick():
[executor_node-1]   File "/home/nikola/.local/lib/python3.10/site-packages/py_trees/composites.py", line 437, in tick
[executor_node-1]     for node in child.tick():
[executor_node-1]   File "/home/nikola/.local/lib/python3.10/site-packages/py_trees/decorators.py", line 451, in tick
[executor_node-1]     for node in super().tick():
[executor_node-1]   File "/home/nikola/.local/lib/python3.10/site-packages/py_trees/decorators.py", line 129, in tick
[executor_node-1]     for node in self.decorated.tick():
[executor_node-1]   File "/home/nikola/.local/lib/python3.10/site-packages/py_trees/composites.py", line 560, in tick
[executor_node-1]     for node in child.tick():
[executor_node-1]   File "/home/nikola/.local/lib/python3.10/site-packages/py_trees/decorators.py", line 129, in tick
[executor_node-1]     for node in self.decorated.tick():
[executor_node-1]   File "/home/nikola/.local/lib/python3.10/site-packages/py_trees/composites.py", line 560, in tick
[executor_node-1]     for node in child.tick():
[executor_node-1]   File "/home/nikola/.local/lib/python3.10/site-packages/py_trees/composites.py", line 437, in tick
[executor_node-1]     for node in child.tick():
[executor_node-1]   File "/home/nikola/.local/lib/python3.10/site-packages/py_trees/composites.py", line 560, in tick
[executor_node-1]     for node in child.tick():
[executor_node-1]   File "/home/nikola/.local/lib/python3.10/site-packages/py_trees/composites.py", line 437, in tick
[executor_node-1]     for node in child.tick():
[executor_node-1]   File "/home/nikola/.local/lib/python3.10/site-packages/py_trees/composites.py", line 543, in tick
[executor_node-1]     assert self.current_child is not None  # should never be true, help mypy out
[executor_node-1] AssertionError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant