-
Notifications
You must be signed in to change notification settings - Fork 30
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
ConcreteRobot uses ranker for PlantoTSR #503
Conversation
Codecov Report
@@ Coverage Diff @@
## master #503 +/- ##
=========================================
Coverage ? 77.66%
=========================================
Files ? 262
Lines ? 6784
Branches ? 0
=========================================
Hits ? 5269
Misses ? 1515
Partials ? 0
|
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.
Thanks for the PR! We should also probably update the new planner API: ConfigurationToTSR
and ConfigurationToConfiguration_to_ConfigurationToTSR
to have a ranker?
Co-Authored-By: gilwoolee <gilwoo301@gmail.com>
Co-Authored-By: gilwoolee <gilwoo301@gmail.com>
They already are. Ranker is one of the constructor arguments in |
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.
Looks mostly good! Just a couple minor questions.
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.
Looks great!
Co-Authored-By: gilwoolee <gilwoo301@gmail.com>
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.
Actually, I think we should update the dart::ConfigurationToConfiguration_to_ConfigurationToTSR
adapter to use the ranker? Also, we need to update the changelog.
@brianhou it was already using a ranker. I just changed it to use the |
I don't think the
|
Co-Authored-By: gilwoolee <gilwoo301@gmail.com>
lol!!! haha since I didn't make that change in this PR I didn't check... Let me fix that :P |
…tionRanker's rank method const, address PR comments
@brianhou @aditya-vk please take another look! |
std::vector<MetaSkeletonStateSpace::ScopedState> configurations; | ||
|
||
// Use a ranker | ||
ConstConfigurationRankerPtr configurationRanker(mConfigurationRanker); |
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.
Why do we need to create another pointer here? Can we not do:
if (!mConfigurationRanker)
{
mConfigurationRanker = NominalConfigurationRanker;
}
In robot/utils/planToTSR
, the ranker has been taken with a const
pointer so I guess that's fine there. Alternatively, we can leave this like this and change the data member to const
since we are initializing it in the constructor anyway.
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.
Summarizing my slack discussion with @aditya-vk , I think we should keep it as is, for the following reasons:
- if the planner is created with
mConfigurationRanker = nullptr
, the expectation is that a NominalConfigurationRanker would be created when this method is called and be initialized with thestartState
. So if we change the member variable as you suggested, the planner now has been mutated and it cannot be reused in the same way. Next time it is called, it'd use this ranker. - To fix, the ideal solution would be the second way you suggested, to have it as
const mConfigurationRanker
so that it never gets changed. Unfortunately, to my best understanding, because this class becomes a TSRPlanner via the templated adapter, it does not have access tomConfigurationRanker
during the initialization, i.e. I can't do: mConfigurationRanker(std::move(ranker)) { ... }
. It only has access to the constructor parameters of the PlannerAdapter, which is thestateSpace
andmetaSkeleton
. See stackoverflow .
Hence, in order to keep the member variable as-is (as if it's a const) and initialize it in constructor if it's passed in, I think we need to keep it the way I have it now.
@aditya-vk @brianhou please confirm!
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.
That's right, there's no way to have it in the initialization list. Hmm.
I think what we have now is good then. Since we don't give an option to change the ranker at all unless a new planner is created, I think it should be fine 👍
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.
Left a nit comment, otherwise good to go! Travis seems to be complaining about formatting.
…cs/aikido into robot_uses_ranker
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.
LGTM!
This PR updates
ConcreteRobot
class to useConfigurationRanker
when callingplanToTSR
. It changes theplanToTSR
logic a little bit accordingly.Before creating a pull request
make format
Before merging a pull request
CHANGELOG.md