Skip to content

Commit

Permalink
馃悰 fix minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rezenders committed Mar 14, 2023
1 parent 8eff26f commit 9392f68
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions mros2_reasoner/mros2_reasoner/ros_reasoner.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,13 @@ def objective_cancel_goal_callback(self, cancel_request):
if self.use_reconfiguration_srv:
function_name = self.get_function_name_from_objective_id(
cancel_request.request.qos_expected.objective_id)
reconfiguration_result = self.request_configuration(
'fd_unground',
function_name)

if function_name is not None:
reconfiguration_result = self.request_configuration(
'fd_unground',
function_name)
else:
reconfiguration_result = None

if reconfiguration_result is None \
or reconfiguration_result.success is False:
Expand All @@ -127,7 +131,8 @@ def objective_action_callback(self, objective_handle):

self.logger.info('Objective Action Callback!')

obj_created = self.create_objective(objective_handle.request)
request_objective = objective_handle.request
obj_created = self.create_objective(request_objective)
if obj_created:
send_feedback = True
while send_feedback:
Expand All @@ -145,7 +150,7 @@ def objective_action_callback(self, objective_handle):
objective.o_status)

feedback_msg.qos_status.objective_type = \
str(objective.typeF.name)
str(request_objective.qos_expected.objective_type)

fg_instance = self.onto.search_one(solvesO=objective)
if fg_instance is not None:
Expand Down Expand Up @@ -247,7 +252,7 @@ def request_configuration(self, desired_configuration, function_name):
callback_group=self.cb_group)

while not mode_change_cli.wait_for_service(timeout_sec=1.0):
self.logger().warn(
self.logger.warning(
'Mode change service ' +
'/mros/request_configuration not available, waiting...')

Expand Down

0 comments on commit 9392f68

Please sign in to comment.