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

How do you deactivate the tasks that were successfully completed? #322

Open
EliosSs opened this issue Mar 17, 2022 · 0 comments
Open

How do you deactivate the tasks that were successfully completed? #322

EliosSs opened this issue Mar 17, 2022 · 0 comments

Comments

@EliosSs
Copy link

EliosSs commented Mar 17, 2022

How do you deactivate the tasks that were successfully completed in a batch?

I was checking the code of the MDP task executor, specifically the file mdp_task_executor.py in the kinetic-devel branch.

in the function: def mdp_exec(self): defined in line 954, we have the main loop for the executor, where you take the task batch from the queue and you send it to the action server with the name 'mdp_plan_exec/execute_policy'.

Right after all that process you proceed to execute the wait policy execution in line 1011:

1011 final_status = self._wait_for_policy_execution()

and it yields the result in the "final_status" variable.

My question is: How is that status variable used to deactivate the active batch in the case of successful tasks?

Right after that "wait_for_policy_execution()" function there are several lines that I understand are to recognize if some tasks were called to be cancelled (The ids of those tasks were used to call "cancel_active_task" function), between lines 1022 and 1047 in the mdp_task_executor.py file.

But the my doubt is inside the function deactivate_active_batch, which is called in line 1052.
1052 self.deactivate_active_batch(goal_status = final_status)

and it is defined in line 1102:
1102 def deactivate_active_batch(self, goal_status, save_all = False, description = ''):

If we go deeply at that function with the assumption that a batch of tasks was performed with a succeeded status in the final_status variable and that none of the tasks were cancelled.
The call of this function is then made in line 1052 with a final_status of GoalStatus.SUCCEEDED. So as the call was in line 1052 the save_all parameter is false and we go inside the function by the line 1122.

So going back with my question in this line 1122 until line 1141.
How are you deactivating the active batch without taking into account the goal status? I see that you have two lists
do_not_reactivate_later = [] reactivate_later = []

But the criteria to join in one list or other is not based in the goal status? why?

Can you explain me this, please? maybe I am missing something?

I really appreciate any kind of help and the availability of the mantainers.
Thank you a lot in advance.

Eliomar Conde.

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