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

Add flags to Saver classes to specify what to save #339

Merged
merged 7 commits into from
Feb 20, 2018

Conversation

brianhou
Copy link
Contributor

@brianhou brianhou commented Feb 18, 2018

Resolves #276. Resolves #293.

This implementation might not be ideal because the "options" can be arbitrary ints, rather than combinations of the options that we actually enumerate. If that's a problem, maybe something like this would be better?


Before creating a pull request

  • Document new methods and classes
  • Format code with make format

Before merging a pull request

  • Set version target by selecting a milestone on the right side
  • Summarize this change in CHANGELOG.md
  • Add unit test(s) for this change

@brianhou brianhou added this to the Aikido 0.3.0 milestone Feb 18, 2018
@codecov
Copy link

codecov bot commented Feb 18, 2018

Codecov Report

Merging #339 into master will decrease coverage by 0.02%.
The diff coverage is 59.37%.

@@           Coverage Diff            @@
##           master   #339      +/-   ##
========================================
- Coverage   81.02%    81%   -0.03%     
========================================
  Files         205    205              
  Lines        5997   6006       +9     
========================================
+ Hits         4859   4865       +6     
- Misses       1138   1141       +3
Impacted Files Coverage Δ
src/planner/WorldStateSaver.cpp 0% <0%> (ø) ⬆️
src/planner/vectorfield/VectorFieldPlanner.cpp 75% <100%> (ø) ⬆️
src/statespace/dart/MetaSkeletonStateSaver.cpp 76% <73.91%> (+7.57%) ⬆️

Copy link
Member

@jslee02 jslee02 left a comment

Choose a reason for hiding this comment

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

The article looks interesting. I personally would like to try to use it, but using int is also okay.

If we use int, I believe here is the best place to use unsigned integer (i.e., std::size_t)!

Nit: Let's use \param[in] for input arguments! 😄

/// \param _world World to save state from and restore to.
explicit WorldStateSaver(World* const _world);
/// \param world World to save state from and restore to.
/// \param options Options to specify what should be saved
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Let's use \param[in]!

explicit WorldStateSaver(World* const _world);
/// \param world World to save state from and restore to.
/// \param options Options to specify what should be saved
explicit WorldStateSaver(World* const world, int options = CONFIGURATIONS);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Please change to const World* world. They are identical but different style. I believe our convention is const World* world.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it was actually incorrect to be const since we restore the World state in the destructor.

Copy link
Member

Choose a reason for hiding this comment

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

@brianhou 👍

/// Construct a MetaSkeletonStateSaver and save the current state of the \c
/// MetaSkeleton. This state will be restored when MetaSkeletonStateSaver is
/// destructed.
///
/// \param _metaskeleton MetaSkeleton to save/restore
/// \param metaskeleton MetaSkeleton to save/restore
/// \param options Options to specify what should be saved
Copy link
Member

Choose a reason for hiding this comment

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

Nit: \param[in]

Copy link
Member

@jslee02 jslee02 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. I just have another minor nitpick, which shouldn't prevent merging this PR.

auto skeleton = Skeleton::create();
skeleton->createJointAndBodyNodePair<RevoluteJoint>();
public:
void SetUp()
Copy link
Member

Choose a reason for hiding this comment

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

Nit: setUp()? 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean? Isn't the correct name SetUp?

Copy link
Member

Choose a reason for hiding this comment

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

I believe function naming convention is to start with a lower case (note that SetUp begins with an upper latter "S").

Copy link
Member

Choose a reason for hiding this comment

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

Oh, this is required by gtest. Sorry for the noise. 😞

@brianhou brianhou mentioned this pull request Feb 19, 2018
5 tasks
@brianhou brianhou merged commit d5d51cc into master Feb 20, 2018
@brianhou brianhou deleted the enhancement/brianhou/saver-flags branch February 26, 2018 01:20
gilwoolee pushed a commit that referenced this pull request Jan 21, 2019
* Add flags to select what should be saved by Saver classes.

* Add more tests.

* Restructure SaverOptions.

* Address @jslee02's comments.

* Remove incorrect const specifier.

* Update CHANGELOG.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants