moveit_task_constructor icon indicating copy to clipboard operation
moveit_task_constructor copied to clipboard

Add/remove stages depending on the result of a `PredicateFilter`

Open DaniGarciaLopez opened this issue 1 year ago • 7 comments

I am trying to add or remove a series of stages based on a calculation performed inside a PredicateFilter. The main idea is to have a generic "Pick" container that detects the location of a collision object and constructs the task differently depending on its location. For example, if we call "pick object" and it is inside a drawer, we would execute some preliminary stages to open the drawer. On the other hand, if it is on the table, we would pick it directly.

I am not sure how to pass the condition calculated in the lambda function of setPredicate to the necessary stages. I tried setting the result to a property or using a global variable within the container, but the value is not updated. I suspect this is because setPredicate is only executed when we call task->plan(), not when the task is constructed.

Any ideas on how to do this properly?

DaniGarciaLopez avatar Jun 03 '24 15:06 DaniGarciaLopez