-
Notifications
You must be signed in to change notification settings - Fork 38
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
Profile Dictionary Update #255
Profile Dictionary Update #255
Conversation
5a27478
to
d193582
Compare
@Levi-Armstrong this PR should be ready for review. The
Any ideas on what might cause this? It doesn't seem to be related to any of the changes I made |
Do you multiple versions installed? |
Here is a PR which fixes the issue. I think we need to add the same logic to the pruneNode in tesseract_geometry |
I tried adding the logic to our code but the object is protected so that is not going to work. Did any headers get arranged? |
What object? The profile override setters and getters in the composite and move instructions should be public. I don't think I changed any header locations |
I tried to add the following in the prune function, but children is not accessible.
|
Let's continue the discussion about the octomap issue here since this PR hasn't made any changes that cause this issue. |
…to eliminate dependency on profile dictionary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am about half way through the review. I think we should not hold this up due to the unit test failure. I am going to look into it this weekend and let you know what I find.
tesseract_command_language/include/tesseract_command_language/profile_dictionary.h
Show resolved
Hide resolved
tesseract_command_language/include/tesseract_command_language/profile_dictionary.h
Show resolved
Hide resolved
@@ -112,14 +113,14 @@ int main(int /*argc*/, char** /*argv*/) | |||
Eigen::Quaterniond(0, 0, -1.0, 0)); | |||
|
|||
// Define raster move instruction | |||
MoveInstruction plan_c0(wp2, MoveInstructionType::LINEAR, "RASTER"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like all of he profiles were removed. Was there a reason behind this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of them were ever actually added to the profile dictionary, so it was just pulling the default profile. That was the case in most of the examples actually. A lot of the changes I made in this PR were related to raising exceptions when requested profile names didn't have a corresponding profile entry in the dictionary.
@marip8 I was getting a different issue when running the example where it was failing due to missing profiles. After updating the cartesian example everything passes locally. I pushed my commit to your branch so we'll see if the tests pass now. |
It looks like CI is passing now with my latest commit. I will finish my review early this week. |
Codecov Report
@@ Coverage Diff @@
## master #255 +/- ##
==========================================
+ Coverage 58.61% 58.82% +0.20%
==========================================
Files 214 211 -3
Lines 9729 9666 -63
==========================================
- Hits 5703 5686 -17
+ Misses 4026 3980 -46
|
tesseract_motion_planners/trajopt_ifopt/src/trajopt_ifopt_motion_planner.cpp
Outdated
Show resolved
Hide resolved
tesseract_task_composer/src/nodes/time_optimal_parameterization_task.cpp
Show resolved
Hide resolved
tesseract_command_language/include/tesseract_command_language/profile_dictionary.h
Show resolved
Hide resolved
It seems like most of your comments are around throwing exceptions. These changes were mostly patches to the existing profile dictionary to remove the behavior of returning of default profiles when no profiles were actually added to the dictionary for a specific profile name. When we change the profile interfaces, we will introduce a new profile dictionary and the changes to the existing profile dictionary will go away. I would prefer not to reintroduce I personally don't see the exceptions in this PR as a huge performance hit because most of them are only caught in order to add more information and then be rethrown. The only place where that is not the case is in the time parameterization tasks, and we could change that in future with a |
No I do not |
Must have missed those. I think that's another case where you really didn't have to specify custom profiles for any of the instructions. I would actually suggest removing the custom profile names to make it less confusing |
Sounds good. |
Are there any planning time benchmarks? If not, it would be interesting to try to convert some of the planning examples to benchmarks where we can measure planning time. Then it could help us justify decisions about throwing or not throwing exceptions. My hunch is that the exceptions will generally only be thrown in cases where a planning problem is not set up correctly and they won't otherwise be thrown, so we won't see a time penalty |
I don't think we currently have any in tesseract_planning. I have done internal benchmarking with exception and to use them for logical flow like what is done in time parameterization it is significant. It is only significant when an exception is thrown and caught. If no exception is thrown then you will not have a penalty so as long as they are not being used for logical flow they should be fine. |
I found my messages. In my test case using godbolt it was 100 times slower to use exceptions for logical flow versus
|
I'm on the same page about not using exceptions for logic handling where possible. For reference, do you have use cases where you are trying to run full planning pipelines at high frequency? Or are you running a single pipeline with one or more steps that run repeatedly at high frequency (e.g., online planning)? |
I don't have a public example, but a good example would be the package singulation demo where it is freespace and has a small cartesian component at the end before it picks up the package. |
I will merge after the tesseract_ros PR is ready to merge. |
@marip8 Do you want me to squash merge this? |
That works for me; this should be complete as far as this PR goes |
@marip8 It is merged into feat/ProfileRefactor which you can use to create PR's against as you work on the Profile Refactoring. |
Changes
getProfile
method now accepts a namespace argument that defaults to an empty string. If the string is empty, the nominal profile is returned. If the namespace string is not empty, the overridden profile name is returned if it exists; otherwise the nominal profile name is returnedgetProfile
function:getProfile
no longer returns a default profile. An exception is thrown if the named profile of the specified type cannot be found.Background
The move and composite instructions currently have a dependency on the profile dictionary which causes issues for the upcoming introduction of new profile interfaces and an updated profile dictionary (because the interfaces require information in move and composite instructions to produce motion planning profiles). Also, conceptually the profile dictionary belongs in the motion planning module. Most of this PR addresses the replacement of the current profile overrides (which were specified as a separate profile dictionary with different keys) with an optional profile name remapping for individual instructions.
After revising the profile dictionary, I also tried to simplify the API by consolidating several external helper functions (
getProfileString
,applyProfileOverrides
, etc.) and add more error information for when profiles can't be found. I also removed the behavior of the profile dictionary of returning a default profile when the queried profile cannot be found. This is a change in the nominal behavior, but will help significantly in understanding whether the specified profiles were actually found and used during motion planning. In updating the examples, I found that most of the profile names specified in the program instructions did not have corresponding objects in the profile dictionary and that an arbitrary default profile was being used instead. I also added two helper functions for adding default planner and task composer profiles to a dictionary for the case where the default profiles are sufficient.