meta-control / mc_mros_reasoner

library for metacontrol-based self-adaptation using ontological reasoning, with wrappers for robotic systems based on ROS1 and ROS2
Apache License 2.0
7 stars 10 forks source link

Error happens when mock_node is restarted #159

Open jeroenzwan opened 1 year ago

jeroenzwan commented 1 year ago

This is the error received when shutting down the mock node and restarting it

[mros2_reasoner_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/action/server.py", line 324, in _execute_goal
[mros2_reasoner_node-1]     execute_result = await await_or_execute(execute_callback, goal_handle)
[mros2_reasoner_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 107, in await_or_execute
[mros2_reasoner_node-1]     return callback(*args)
[mros2_reasoner_node-1]   File "/home/jeroen/Thesis/pipeline_exemplar/build/mros2_reasoner/mros2_reasoner/ros_reasoner.py", line 130, in objective_action_callback
[mros2_reasoner_node-1]     self.remove_objective(old_objective.name)
[mros2_reasoner_node-1]   File "/home/jeroen/Thesis/pipeline_exemplar/build/mros2_reasoner/mros2_reasoner/reasoner.py", line 58, in remove_objective
[mros2_reasoner_node-1]     destroy_entity(old_fg_instance)
[mros2_reasoner_node-1]   File "/usr/local/lib/python3.10/dist-packages/owlready2/prop.py", line 986, in destroy_entity
[mros2_reasoner_node-1]     e.namespace.world.graph.destroy_entity(e.storid, destroyer, relation_updater, undoer_objs, undoer_datas)
[mros2_reasoner_node-1] AttributeError: 'NoneType' object has no attribute 'namespace'
[mros2_reasoner_node-1] Traceback (most recent call last):
[mros2_reasoner_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/action/server.py", line 324, in _execute_goal
[mros2_reasoner_node-1]     execute_result = await await_or_execute(execute_callback, goal_handle)
[mros2_reasoner_node-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 107, in await_or_execute
[mros2_reasoner_node-1]     return callback(*args)
[mros2_reasoner_node-1]   File "/home/jeroen/Thesis/pipeline_exemplar/build/mros2_reasoner/mros2_reasoner/ros_reasoner.py", line 130, in objective_action_callback
[mros2_reasoner_node-1]     self.remove_objective(old_objective.name)
[mros2_reasoner_node-1]   File "/home/jeroen/Thesis/pipeline_exemplar/build/mros2_reasoner/mros2_reasoner/reasoner.py", line 58, in remove_objective
[mros2_reasoner_node-1]     destroy_entity(old_fg_instance)
[mros2_reasoner_node-1]   File "/usr/local/lib/python3.10/dist-packages/owlready2/prop.py", line 986, in destroy_entity
[mros2_reasoner_node-1]     e.namespace.world.graph.destroy_entity(e.storid, destroyer, relation_updater, undoer_objs, undoer_datas)
[mros2_reasoner_node-1] AttributeError: 'NoneType' object has no attribute 'namespace'
chcorbato commented 1 year ago

When reporting "errors" and similar issues, it is important to provide information to understand the context of the issue and be able to reproduce it (for some issues that you plan to solve in a couple of days it may seem irrelevant, but when things take more time, even you, not to speak of other developers will greatly appreciate that info):

-- Summary text (informal, what you would write now)

Required info (some field may not be necessary):

what do I need to have in my machine to reproduce the issue

Steps to reproduce the issue

what do I need to do to replicate the issue

Expected behavior

explanation of what you think the correct behavior would be

Actual behavior

what actually happened, i.e. what you have reported above

Aditional information

optional