fixed TaskEvaluation.action

This commit is contained in:
Niko Feith 2024-03-18 18:33:59 +01:00
parent bf49376d3c
commit 9ad94fd1ce
2 changed files with 5 additions and 2 deletions

View File

@ -23,3 +23,4 @@ uint16 processed_trajectories
# Result
float32[] new_means # Length: number_of_population * number_of_dimensions * number_of_parameters_per_dimension, this is needed because in case of user input the parameters arent known yet
float32[] score # Length: number_of_population

View File

@ -14,7 +14,6 @@ from src.interaction_utils.serialization import flatten_population, unflatten_po
from interaction_msgs.action import TaskEvaluation
class TaskNode(Node):
def __init__(self):
super().__init__('task_node')
@ -112,6 +111,9 @@ class TaskNode(Node):
goal_handle.publish_feedback(feedback_msg)
if self.state == 'sending_request':
if self.goal_dict == {}:
self.error_trigger()
result_msg.score = self.goal_dict['score']
result_msg.new_means = self.goal_dict['new_means']
break