-
Notifications
You must be signed in to change notification settings - Fork 151
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
Add creator stage name to SolutionInfo #192
Conversation
Codecov Report
@@ Coverage Diff @@
## master #192 +/- ##
==========================================
- Coverage 26.99% 26.98% -0.01%
==========================================
Files 90 90
Lines 5746 5747 +1
==========================================
Hits 1551 1551
- Misses 4195 4196 +1
Continue to review full report at Codecov.
|
Indeed, but what's wrong with extracting the Alternatively, assuming you have the Task object in the same process you can also extract the id directly:
Should we add a simpler interface for that last line? |
This was implicitly requested in moveit#192 .
If I understand correctly, you would have to store the task description along with the solution to know which Also, I imagine that users will call action servers that return the solution for a task (Pick/Place/PickPlace). Even if the task description was returned alongside the solution, searching through the message manually is a hassle. By contrast, stepping through the trajectories and checking each stage name is a breeze.
I am not sure I even understood the |
This was implicitly requested in moveit#192 .
Yes if you want to infer the correct stage remotely from the description.
As long as you do not use the same stage description twice that's an option. For a better solution, what do you think about adding something like |
That is assuming that you have access to the task, which you would not if you get the solution from a
I like it, although the name That said, even though using the stage name to transmit flags/signals like that is definitely hacky, I think the stage name is also helpful for debugging and displaying, so including it in the solution makes sense to me. |
That is assuming that you have access to the task, which you would not if you get the solution from a `move_group` capability as described in #112.
Yes. But for any kind of interleaved-execution or custom hooks, you would need that anyway.
The only other way to support similar functionality is by additional information in the solution message, as we discuss right now.
I like it, although the name `execution_properties` makes me expect modifying parameters or things I should not touch as a user.
The concept of properties is very general in MTC and you already modify the properties of stages to setup your problem.
We could also go for `Property[] external` or `external_properties`, I would just like to avoid ambiguities with the Properties that are used to generate a specific solution (we do not export those), although maybe we should.
`custom_flags` or similar would probably be clearer.
Properties can be boolean flags, but providing arbitrary data, e.g. to specify the pressure for each element in a suction array, is supported here, so "flags" is no good name.
the stage name is also helpful for debugging and displaying, so including it in the solution makes sense to me.
In principle I agree. But then we would add redundant information to the messages and it also makes sense to avoid that.
The information is now cleanly split between task description, statistical data and actual solutions and we decided not to use the stage name as linking key.
If you want to debug MTC plans, you should save the description/statistics topics anyway or debug from within the C++ code in which you run the Task.
|
I assumed that one should be able to execute the solution without knowing the task description, just like one can follow a manual without knowing all of the specifications and constraints that were needed to create the manual. I consider MTC a problem solving engine, so I would not expect to need the Task object (part of the solver) to execute the solution, and it seems reasonable to add information to the solution message. That's just my interpretation though!
I'm not sure which properties are used where, and which properties are used to generate a "specific" solution rather than the returned message.
Then maybe
True, it would be somewhat redundant, which is why I had doubts about merging this. I guess it's a question of how self-contained you want the solution to be, and what users should be able to do with the solution message alone. For completeness: a use case outside of debugging is to display the stage name to show what the robot is currently doing. |
This was implicitly requested in moveit#192 .
This was implicitly requested in #192 .
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The |
Alright. I would not say the discussion is off-topic because it is related to accomplishing the purpose of this PR. It would be useful to anybody reading this PR. Also, you said:
What isn't so obvious is that MoveTo inherits from Stage. If I read the header file, MoveTo inherits from Edit, here's the final solution that works for me in retrieving a stage ID:
|
Closing in favour of #194 |
In #162 , @v4hn suggested the option of executing the solution sequentially to execute custom functions. We tried using this in an application, but when stepping through the solution's subtrajectories, we are somewhat blind as the solution does not seem to contain any semantic cues by itself*. If it does, a student of mine and I could not find them. This is a complex piece of software.
This PR extends the subtrajectory message by the name of the stage that created it so that the user can tell which part of the task they are at and execute arbitrary code (e.g. gripper open/close, set I/O, change display, call service...) when desired. Naming stages appropriately seems to be the easiest way to implement what @v4hn called "the trivial way".
Adding code hooks may be the proper way, but as mentioned in #162 there is no time frame on this feature, and this workaround is simple, lightweight and works in Python.
This does not need to be merged, it can just be a reference for whoever wants to execute solutions this way.
*edit: Yes, you could get the
stage_id
from theSolutionInfo
of each trajectory and search through theTaskDescription
to retrieve the name, but it is awkward.