-
Notifications
You must be signed in to change notification settings - Fork 41
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
Remove nested models #230
Remove nested models #230
Conversation
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
We do this by keeping track of links separately from DART so that APIs such as `Model::GetLink()` and `Link::GetIndex` are not affected by BodyNode's moving from one skeleton to another when a joint is created between different (nested) models. Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
…t in TPE Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
…ties Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
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.
This PR looks good, although I do have some nitpicks that I think will help with code clarity.
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
…els in tpelib::Model Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
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.
Works for me, tests look good, and nested models seemed to be deleted cleanly on ign-gazebo
for both DART and TPE.
I just have minor comments for your consideration
const DartSkeletonPtr &model = | ||
this->ReferenceInterface<DartWorld>(_worldID)->getSkeleton(_modelIndex); | ||
const std::size_t modelID = | ||
this->models.indexInContainerToID.at(_worldID)[_modelIndex]; |
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.
Should we do some checking to see if the index exists?
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.
Done in ea42d0c
const std::size_t nestedModelID = this->models.IdentityOf(nestedSkel); | ||
const auto filterPtr = GetFilterPtr(this, worldID); | ||
filterPtr->RemoveSkeletonCollisions(nestedSkel); | ||
return this->RemoveModelImpl(worldID, nestedModelID); |
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.
The logic here is pretty similar to RemoveNestedModelByIndex
, I think this function could call that one.
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 don't think it would be trivial to be able to call RemoveNestedModelByIndex
because we have to find the index based on the name first. Ideally the lines
const auto filterPtr = GetFilterPtr(this, worldID);
filterPtr->RemoveSkeletonCollisions(nestedSkel);
could go into RemoveModelImpl
, but that would involve moving GetFilterPtr
into Base.hh
. How about we revisit this later? I can leave a TODO for myself in the code.
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.
Yeah later is fine, it was just a small suggestion
…odel feature Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
In b3b9ae7, I renamed e I also realized the functions |
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
🎉 New feature
Summary
This adds a new feature,
RemoveNestedModelFromModel
, that allow users to remove a nested model via it's parent model entity. This PR also ensures that when a parent model is removed, all its nested models are removed as wellRequires:
[dartsim] Fix joint construction errors due to link name duplication or BodyNodes moving to other skeletons #220[dartsim] Ensure Link and Model APIs continue to work after joint creation in DART #227[dartsim] Add empty nested model construction and nested model entity management #228[tpe] Add empty nested model construction and nested model entity management #229Test it
Run tests
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge