Skip to content
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

[Citadel] Add Base and EntityManagement to tpeplugin #32

Merged
merged 62 commits into from
May 13, 2020

Conversation

claireyywang
Copy link
Contributor

@claireyywang claireyywang commented Apr 17, 2020

This PR adds EntityManagementFeatures and Base.hh to lay the ground work of tpeplugin features. It should be merged after #45 which add functions to tpelib and before #46 which adds all the other features to tpeplugin.

@claireyywang claireyywang changed the title [Citadel] TPE Plugin [Citadel] Add Base and EntityManagement to tpeplugin Apr 29, 2020
@claireyywang claireyywang requested a review from azeey April 29, 2020 21:52
@claireyywang claireyywang changed the base branch from claire/tpelib_add_fns to ign-physics2 April 30, 2020 23:53
@claireyywang claireyywang requested a review from mxgrey as a code owner April 30, 2020 23:54
@claireyywang claireyywang added the 🏰 citadel Ignition Citadel label May 4, 2020
tpe/plugin/src/Base.hh Outdated Show resolved Hide resolved
tpe/plugin/src/EntityManagementFeatures.cc Outdated Show resolved Hide resolved
tpe/plugin/src/EntityManagementFeatures.hh Outdated Show resolved Hide resolved
tpe/plugin/src/EntityManagementFeatures.hh Outdated Show resolved Hide resolved
tpe/plugin/src/EntityManagementFeatures.hh Outdated Show resolved Hide resolved
@claireyywang claireyywang removed the request for review from mxgrey May 7, 2020 06:14
@chapulina chapulina added the 🔮 dome Ignition Dome label May 7, 2020
Signed-off-by: claireyywang <[email protected]>
@codecov
Copy link

codecov bot commented May 12, 2020

Codecov Report

Merging #32 into ign-physics2 will increase coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff                @@
##           ign-physics2      #32      +/-   ##
================================================
+ Coverage         82.16%   82.21%   +0.05%     
================================================
  Files                92       90       -2     
  Lines              3095     3025      -70     
================================================
- Hits               2543     2487      -56     
+ Misses              552      538      -14     
Impacted Files Coverage Δ
dartsim/src/JointFeatures.cc 60.44% <0.00%> (-8.56%) ⬇️
dartsim/src/Base.hh 98.94% <0.00%> (-0.04%) ⬇️
dartsim/src/plugin.cc 100.00% <0.00%> (ø)
include/ignition/physics/detail/Joint.hh 100.00% <0.00%> (ø)
include/ignition/physics/detail/FeatureList.hh 100.00% <0.00%> (ø)
include/ignition/physics/detail/PlaneShape.hh
include/ignition/physics/PlaneShape.hh
dartsim/src/ShapeFeatures.cc 39.13% <0.00%> (+1.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ce5f7a...5ce5f7a. Read the comment docs.

@claireyywang claireyywang requested a review from iche033 May 12, 2020 04:59
Copy link
Contributor

@iche033 iche033 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding the extra tests!

I noticed in the dartsim implementation, it makes use of ReferenceInterface function for fast retrieval of entities. I gave that a try in a couple of places and they seem to work fine. Should we update other functions?

{
modelName = it->second->model->GetName();
}
return modelName;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could use ReferenceInterface in this function to avoid lookups?

static std::string modelName =
    this->ReferenceInterface<ModelInfo>(_modelID)->model->GetName();
return modelName;

I now understand that static std::string is used because of the const & return type. I think it's designed to match the return type of dart's Skeleton::getName function

return it->second->model->GetChildCount();
}
// return invalid count if model not found
return -1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this also seems to work:

return this->ReferenceInterface<ModelInfo>(_modelID)->model->GetChildCount();

@claireyywang
Copy link
Contributor Author

thanks for adding the extra tests!

I noticed in the dartsim implementation, it makes use of ReferenceInterface function for fast retrieval of entities. I gave that a try in a couple of places and they seem to work fine. Should we update other functions?

Thanks for the review, @iche033 ! I have updated functions to use ReferenceInterface and that simplifies the code a lot. I have also cleaned up the code a bit more, so ready for another round whenever you are 😃

@claireyywang claireyywang requested a review from iche033 May 13, 2020 04:37
Copy link
Contributor

@iche033 iche033 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

A side note, I noticed that code check is not running on tpe src code. We can add the check here. After that, running sh tools/code_check.sh should pick up style issues. We can do that and fix the errors in a separate PR

@claireyywang
Copy link
Contributor Author

looks good to me!

A side note, I noticed that code check is not running on tpe src code. We can add the check here. After that, running sh tools/code_check.sh should pick up style issues. We can do that and fix the errors in a separate PR

Awesome, thanks for catching the code check! I didn't know it needs to be manually added. I'll follow up with another PR fixing styles as suggested.

@claireyywang claireyywang merged commit 3a5403a into ign-physics2 May 13, 2020
@claireyywang claireyywang deleted the tpe_plugin_citadel branch May 13, 2020 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel 🔮 dome Ignition Dome
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants